Extracting fields from a define-type object in Scheme
- by Mike
Hi,
I am trying to extract the field 'name' or 'named-expr' from the following object:
(bind 'x (num 5)) ;; note that this is not a list, but a type Binding
With the Binding definition:
(define-type Binding
(bind (name symbol?) (named-expr WAE?)))
I have tried, but received the error "reference to an identifier before its definition: Binding-name." Here is what I tried typing:
(begin (Binding-name (bind 'x (num 5))))
(begin (define x (bind 'x (num 5))) (Binding-name x))
Thank you!