Re: [racket-users] Built-in function for accessing fields of a composite type

2018-10-24 Thread Hassan Shahin
Many thanks Matthew! I couldn't believe I missed that. These are given for free. Yes. BTW, I am a big fan. Best On Thursday, October 25, 2018 at 5:12:13 AM UTC+3, Matthew Flatt wrote: > > Since `tag` is the constructor name and `children` is the field name, > `tag-children` is defined as the

Re: [racket-users] Built-in function for accessing fields of a composite type

2018-10-24 Thread Matthew Flatt
Since `tag` is the constructor name and `children` is the field name, `tag-children` is defined as the accessor function for the `children` field. I recommend using `type-case`, though. At Wed, 24 Oct 2018 19:05:44 -0700 (PDT), Hassan Shahin wrote: > using #lang Plait, I have defined these two

[racket-users] Built-in function for accessing fields of a composite type

2018-10-24 Thread Hassan Shahin
using #lang Plait, I have defined these two types: (define-type Property (property [name : Symbol] [value : (Boxof Symbol)])) (define-type Tag (tag [name : String] [id : String] [properties : (Listof Property)] [value : Content-Type] [children : (Boxof (Listof