active-group / active-group/active-data

Make record realms accessible during record definition

Đang mở
#6 4 bình luận 0 reaction 1 người được giao Được @mikesperber nhận Xem trên GitHub
Ngôn ngữ chính
Clojure
Star
3
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.