IMHO, the tools for statically reasoning about prefab structs could use a 
little love. I'm trying to add better contract and type support for prefabs 
and I feel like I'm rewriting/duplicating boilerplate that should just 
exist in a `racket/prefab` module (and in fact if you search around you'll 
see there are a couple places where such boilerplate is lying around the 
Racket ecosystem).

For example, it would be nice to be able to---with just the prefab keys and 
field counts in hand---do the following (without _having_ to call `
prefab-key->struct-type` and `struct-type-info`):
1. normalize the key to it's canonical compact form,
2. normalize the key to it's canonical verbose form (if this is actually a 
sensible thing to do; there's currently a function like this in Typed 
Racket's implementation),
3. decide if a prefab key is compatible with a particular field count,
4. decide if one prefab-key+field-count is a "subtype/subkey" of another 
prefab-key+field-count,
5. extract a descriptor for the immutable/mutable fields given a 
prefab-key+field-count
6. inquire if a particular field is mutable/immutable for a given 
prefab-key+field-count (w/o allocating)
7. extract a parent prefab-key+count
etc (Carl's `mischief/struct` has more that people might consider useful)

Assuming at least some of those are useful and desirable, would it be 
better to:

1. Export any/all useful functions 
from 
https://github.com/racket/racket/blob/master/racket/src/cs/rumble/prefab.ss 
and then add any additional functionality to aν explicit `racket/prefab` 
module? (I like this because it means less duplicate code... but it would 
mean the `kernel` language exporting more identifiers (I think), and 
perhaps that's undesirable...?)

2. Re-implement each desired function at the Racket level in a 
`racket/prefab` module so there is one canonical place for this kind of 
boilerplate?

3. Something else sensible?

Best,
Andrew

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/8703dcdd-80ea-46cb-b31a-186388932794%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to