Take the 2-minute tour ×

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!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

So I just figured this out, I had to use the name 'bind' within the Binding type. This work: (begin (bind-name (bind 'x (num 5))))

share|improve this answer
add comment

Your Answer


