[racket] Unbound identifier bug in contracts?

From: Brian Adkins (racketusers at lojic.com)
Date: Wed Jul 23 10:01:55 EDT 2014

Wow, quick work! Thanks :)

One of the many things that drew me to Racket was seeing Eli's relentless announcements of new Racket releases on comp.lang.lisp, and elsewhere, over the years which left an impression of a language that is being, and likely to continue to be, actively developed. There aren't a lot of languages that have both the features that are important to me *and* an active community.

--
Brian Adkins
Lojic Technologies, LLC
http://lojic.com/

On Jul 22, 2014, at 11:44 PM, Robby Findler wrote:

> Yes, that's a bug. I've pushed a fix. Thanks for the test case!
> 
> Robby
> 
> On Tue, Jul 22, 2014 at 7:18 PM, Brian Adkins <racketusers at lojic.com> wrote:
>> On Jul 22, 2014, at 8:03 PM, Brian Adkins wrote:
>>> Does this seem like a bug? I'm running DRRacket 6.0.1 on Mac OSX 10.6.8.
>>> 
>>> Given:
>>> 
>>> (define (valid? a b)
>>> (< a b))
>>> 
>>> Case 1 - works fine:
>>> 
>>> (define/contract (foo a b)
>>> (->i ([x (z) (curry valid? z)] [z any/c]) any)
>>> (+ a b))
>>> 
>>> Case 2 (adding a 3rd arg) - results in:
>>> "z10: unbound identifier;
>>>   also, no #%top syntax transformer is bound in: z10"
>>> 
>>> (define/contract (foo a b c)
>>> (->i ([x (z) (curry valid? z)] [y any/c] [z any/c]) any)
>>> (+ a b))
>> 
>> Sorry, I included valid? because it was in my earlier test cases, I can simplify this to something nearly identical to the example in 8.2 of the Racket Reference:
>> 
>> (define/contract (foo a b c)
>>  (->i ([x (z) (>=/c z)] [y any/c] [z any/c]) any)
>>  (+ a b))
>> 
>> results in:
>> 
>> "z10: unbound identifier;
>> also, no #%top syntax transformer is bound in: z10"
>> 
>> Remove c & y, and it works fine.
>> 
>> 
>> 
>> ____________________
>>  Racket Users list:
>>  http://lists.racket-lang.org/users



Posted on the users mailing list.