YARV vs. lambda

Hi all.

Somebody knows why YARV do this:

l = lambda{|*arg| p arg}

l[1] #prints 1 instead of [1]
l[2,3] #prints 2 instead of [2,3]
l[] #prints 0 instead of []

Thanks.

Victor

On May 11, 2006, at 9:08 PM, Victor S. wrote:

Hi all.

Somebody knows why YARV do this:

l = lambda{|*arg| p arg}

l[1] #prints 1 instead of [1]
l[2,3] #prints 2 instead of [2,3]
l[] #prints 0 instead of []

YARV doesn’t yet pass ‘make test’ so those aren’t supported.


Eric H. - [email protected] - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

Hi,

On 5/12/06, Victor S. [email protected] wrote:

Hi all.

Somebody knows why YARV do this:

l = lambda{|*arg| p arg}

l[1] #prints 1 instead of [1]
l[2,3] #prints 2 instead of [2,3]
l[] #prints 0 instead of []

Works here… Try the SVN HEAD?

On 5/13/06, Eric H. [email protected] wrote:

l[2,3] #prints 2 instead of [2,3]

oh, looks like i was using an old revision

[email protected]:~/code/yarv> ./ruby-yarv -ve ‘lambda{|*a| p a}[2,3]’
ruby 2.0.0 (Base: Ruby 1.9.0 2006-02-14) [i686-linux]
YARVCore 0.4.0 Rev: 482 (2006-03-08) [opts: ]
[2, 3]

[email protected]:~/code/yarv> ./ruby -ve ‘lambda{|*a| p a}[2,3]’
ruby 2.0.0 (Base: Ruby 1.9.0 2006-04-08) [i686-linux]
YARVCore 0.4.0 Rev: 497 (2006-05-07) [opts: ]
2

sorry for the confusion

On May 12, 2006, at 11:59 AM, Ilmari H. wrote:

Works here… Try the SVN HEAD?

How did you compile it?

$ ruby-yarv -ve ‘lambda { |*a| p a }[2,3]’
ruby 2.0.0 (Base: Ruby 1.9.0 2006-04-08) [powerpc-darwin8.6.0]
YARVCore 0.4.0 Rev: 497 (2006-05-07) [opts: ]
2


Eric H. - [email protected] - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs