prefab-key sanity check please! Does this seem like a reasonable predicate to determine if a prefab key corresponds to prefab structs which have 1 or more mutable fields: (define (prefab-key-with-mutable-fields? key)
(match key
[(? symbol?) #f]
[(list-rest _ mutable-flds _)
(not (eqv? 0 (vector-length mutable-flds)))]))
@pnwamk I think that will miss the case when it has mutable fields but they are inherited from the parent struct type.
@ryanc ah, thanks!
Is there a lot of duplicated boilerplate code floating around the racket repositories to work with prefabs?
and am trying to wrap my head around the prose in the Racket reference and all this code :persevere:
I’m tempted to start w/ a PR adding a grammar of valid prefab-keys to the reference…
I don’t know how much there is for prefabs. I haven’t often had to care what the structure of a prefab key was. My personal hobgoblin is module paths and module path indexes. I keep resolving to write the one true module path conversion/canonicalization library … “when I get time”.
For this particular question, you could also convert it to a struct-type and then use struct-type-info, I think.
Did you figure this out?
I’m trying to understand how provide/require are implemented.
@aydar.js has joined the channel
Yes please, if I don’t get to it first
I’ve gotten a few questions answered but they mostly just led me to more questions
Trying to work out how to get contract-out
to play nicely with my syntax annotations project