> On Nov 4, 2016, at 4:43 PM, Sam Tobin-Hochstadt <sa...@cs.indiana.edu> wrote:
> 
> Typed Racket chaperones the struct type to prevent further extension.

Ok, thanks. Where would I go to see how I would create a chaperone like this?

> Sam
> 
> On Fri, Nov 4, 2016 at 4:29 PM, Alex Knauth <alexan...@knauth.org> wrote:
>> Hello,
>> 
>> Is there a way to enforce that a particular struct is final, in other words, 
>> that no one can declare a sub-struct of it?
>> 
>> (struct foo (a b c) #:final)
>> 
>> (struct bar foo (d e f))
>> ; should produce a syntax error similar to:
>> ; struct: cannot inherit from the final struct foo
>> 
>> (make-struct-type 'bar struct:foo 3 0)
>> ; should produce an error at runtime:
>> ; make-struct-type: cannot inherit from the final struct foo
>> 
>> Does struct have a feature like this? If I'm remembering correctly, Typed 
>> Racket does something to make sure that untyped structs can't inherit from 
>> typed structs. What does Typed Racket do to do do that?
>> 
>> Alex Knauth
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to