[racket] Unexpected error extracting value from request bindings.

From: J G Cho (gcho at fundingmatters.com)
Date: Sun Jul 31 23:07:42 EDT 2011

That sounds like a black magic. I am almost tempted to ask how it's done.

I imagined (gensym) would generate some unique sequence not used so
far. Why would this approach not work?

2011/7/31 Jay McCarthy <jay.mccarthy at gmail.com>:
> 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.