[plt-scheme] Lambda in a list... am I doing something wrong?

From: Jon Rafkind (rafkind at cs.utah.edu)
Date: Mon Oct 19 19:43:30 EDT 2009

Timothy McDowell wrote:
> I'm trying to write a little interactive fiction, and I have a setup like
> this:
> (define commands
> '(
> ("look" (lambda () (display "test")))))
>
>   

Try (define commands (list (list "look" (lambda () (display "test")))))

> The response I get from trying ((cdr (car commands))):
> procedure application: expected procedure, given: ((lambda () (display
> "test"))) (no arguments)
>
> Can someone explain to me what I am doing wrong?
>
> --  Thanks,
> --Timothy.
>
>   
> ------------------------------------------------------------------------
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>   



Posted on the users mailing list.