[racket] Lazy take is the identity?
I meant to say, I'm seeing that list-ref behaves the same in #lang
lazy and #lang racket.
On Wed, Jan 26, 2011 at 11:12 AM, Stephen Chang <stchang at ccs.neu.edu> wrote:
>> P.S. I was surprised to see that list-ref in #lang lazy takes the args in
>> opposite order than in #lang racket (which takes the list first).
>
> I'm seeing the same behavior:
>
> Welcome to DrRacket, version 5.0.99.6 [3m].
> Language: Lazy Racket [custom].
>> (list-ref '(1 2 3) 1)
> 2
>> (list-ref 1 '(1 2 3))
> . . C:\plt\collects\lazy\lazy.rkt:43:24: list-ref: expects type
> <non-negative exact integer> as 2nd argument, given: (1 2 3); other
> arguments were: 1
>
>
>
>
> On Wed, Jan 26, 2011 at 3:40 AM, Mark Engelberg
> <mark.engelberg at gmail.com> wrote:
>> I get an error in 5.0.2, rather than 0.
>>
>> --Mark
>>
>> P.S. I was surprised to see that list-ref in #lang lazy takes the args in
>> opposite order than in #lang racket (which takes the list first).
>>
>> On Tue, Jan 25, 2011 at 11:27 PM, John Clements <clements at brinckerhoff.org>
>> wrote:
>>>
>>> I would expect this program to signal an error:
>>>
>>> #lang lazy
>>>
>>> (define zeros (cons 0 zeros))
>>>
>>> (define should-be-error (list-ref (take 15 zeros) 1324))
>>>
>>>
>>> ... but instead should-be-error is bound to zero. How can I take the
>>> 1000th element of a list with only 15 elements? I'm tempted to make snide
>>> comments about laziness, but I'm sure it'll backfire when it turns out that
>>> somehow that's the right answer after all.
>>>
>>> Bug report?
>>>
>>> John
>>>
>>>
>>> _________________________________________________
>>> For list-related administrative tasks:
>>> http://lists.racket-lang.org/listinfo/users
>>
>>
>> _________________________________________________
>> For list-related administrative tasks:
>> http://lists.racket-lang.org/listinfo/users
>>
>