active-group / active-group/active-data

Make record realms accessible during record definition

未關閉
#6 4 則留言 0 個 reaction 已指派 1 人 已被 @mikesperber 認領 在 GitHub 檢視
主要語言
Clojure
星號
3
分支
2
PR 合併指標
30 天內沒有已合併 PR

描述

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.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。