[racket] Unexpected error extracting value from request bindings.

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sun Jul 31 17:58:47 EDT 2011

Gensym produces symbols that are not eq to any other symbols created any other way. The bindings library produces symbols from strings, so they aren't eq to the gensym'd one. 

Jay

Sent from my iPhone

On 2011/07/31, at 15:13, J G Cho <gcho at fundingmatters.com> wrote:

> I am a bit puzzled by this error:
> 
> 
> Exception
> The application raised an exception with the message:
> 
> extract-binding/single: 'q10493 not found in '((q10493 . "no"))
> 
> 
> Context:
> Symbol q10493 was generated by (gensym 'q) and used in
> 
> (list (radio-input (symbol->string nom) "yes")
>                 (radio-input (symbol->string nom) "no")))
> 
> When I try to extract it
> 
> (define (extract-single nom)
>  (λ (bindings)
>    (extract-binding/single nom bindings)))
> 
> it complains....
> 
> So I changed to
> (define (extract-single nom)
>  (λ (bindings)
>    (extract-binding/single (string->symbol (symbol->string nom))
>                            bindings)))
> 
> And it seems to work but left me scratching my head.
> 
> Does anybody care to shed some light on this?
> 
> jGc
> 
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users



Posted on the users mailing list.