Skip to content

Make record realms accessible during record definition #6

Description

@neshtea

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:

(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:

(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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions