You 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 <hsha...@gmail.com> wrote:

> I have this definition for a procedure:
>
> (define type-of (lambda (item)
>                          (cond
>                            [(pair? item) 'pair]
>                            [(null? item) 'empty-list]
>                            [(number? item) 'number]
>                            [(symbol? item) 'symbol]
>                            [else 'some-other-type])))
>
> My understanding is that if the first 4 conditions fail (=> #f
> <https://plus.google.com/s/%23f/posts>), then the last expression (the
> else expression) is evaluated.
> When I apply this procedure to John, as in (type-of John) I get an error
> (; john: undefined; ; cannot reference an identifier before its
> definition).
>
> What is going on?
> Thanks
>
> --
> 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.

Reply via email to