active-group / active-group/active-data

Make record realms accessible during record definition

オープン
#6 コメント 4 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。