I'm not exactly sure what you mean by "feed a type into a macro" or "the constituent elements .. of a given type". But Typed Racket runs macro expansion entirely _before_ type checking, so this is unlikely to be possible.
Sam On Tue, Feb 14, 2017 at 1:32 PM, Robert Kuzelj <rob...@robkuz.com> wrote: > Hi Matthias, > > thanks for answering. As it seems my question was a bit imprecise - let me > rephrase it: > > given a type definition in typed/racket like > > (define-type BinaryTree (U Number (Pair BinaryTree BinaryTree))) > > would it be possible to feed that type into a macro (aka not runtime) so that > > (define-transformed-type MyBinaryTree BinaryTree) > > and would that macro be able to access the constituent elements and their > types of given type? > > Best regards > > Robert > > Am Dienstag, 14. Februar 2017 13:08:05 UTC+1 schrieb Matthias Felleisen: >> A value is a run-time entity, namely, the result of a computation. >> A first-class value can flow anywhere within the core language. >> >> A type is a syntactic concept. It does not exist at run-time at all >> (contrary to the propaganda concerning ‘dynamic typing’). >> >> >> > On Feb 14, 2017, at 4:04 AM, Robert Kuzelj <rob...@robkuz.com> wrote: >> > >> > That means: can I inspect the declaration and see all the defined members >> > and types? >> >> Of course you can. Just read the type definition and the declarations. >> >> But I can’t figure out what the defined member of a type is. > > -- > 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.