Re: [racket-users] Help understanding cond expression

2019-01-12 Thread Hassan Shahin
ourse, there is none, hence the error." - Hassan On Sunday, January 13, 2019 at 7:52:53 AM UTC+2, Jon Zeppieri wrote: > > > > On Sun, Jan 13, 2019 at 12:37 AM Hassan Shahin > wrote: > >> Thanks Jack and Mike! >> >> You are right. Arguments to procedur

Re: [racket-users] Help understanding cond expression

2019-01-12 Thread Hassan Shahin
, which is not the case. Thanks again On Sunday, January 13, 2019 at 7:29:10 AM UTC+2, Jack Rosenthal wrote: > > On Sat, 12 Jan 2019 at 21:12 -0800, Hassan Shahin wrote: > > When I apply the procedure to 'John it will evaluate to 'symbol. The > idea > > of the procedure

Re: [racket-users] Help understanding cond expression

2019-01-12 Thread Hassan Shahin
ou need to apply the function to 'John, with a single quote in front of > it. The word John without that quote is just a variable reference to > something that you have not actually defined. > > On Sat, Jan 12, 2019 at 11:34 PM Hassan Shahin > wrote: > >> I have this defini

[racket-users] Help understanding cond expression

2019-01-12 Thread Hassan Shahin
I have this definition for a procedure: (define type-of (lambda (item) (cond [(pair? item) 'pair] [(null? item) 'empty-list] [(number? item) 'number] [(symbol?

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

2018-10-24 Thread Hassan Shahin
s 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 types: > > > > (define-typ

[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