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.
There are cases where we want to define a record via
def-recordand need access the record type in the body of the record definition. Example:Right now, this doesn't compile since the
foorecord type is not yet available during definition. To work around it, we can combine adeclarewith arealm/delayto achieve the desired result:It would be nice to be able to define such a record type without the cumbersome
declareplusdelayworkaround.