active-group / active-group/active-data

Make record realms accessible during record definition

Open
#6 4 comments 0 reactions 1 assignee Claimed by @mikesperber View on GitHub
Dominant language
Clojure
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

There are cases where we want to define a record via `def-record` and need access the record type in the body of the record definition. Example:

```clojure
(record/def-record foo
[foo-do-something :- (realm/function -> foo)])
```

Right now, this doesn't compile since the `foo` record type is not yet available during definition. To work around it, we can combine a `declare` with a `realm/delay` to achieve the desired result:

```clojure
(declare foo)

(record/def-record foo
[foo-do-something :- (realm/function -> (realm/delay foo))])
```

It would be nice to be able to define such a record type without the cumbersome `declare` plus `delay` workaround.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.