Lambda {|(v0,v1),v2|}.call([1],2)

e$B0J2<$NNc$Oe(B ArgumentError e$B$K$J$j$^$;$s!#e(B

% ./ruby -ve ‘lambda {|(v0,v1),v2| p [v0,v1,v2]}.call([1],2)’
ruby 1.9.0 (2007-08-18 patchlevel 0) [i686-linux]
[1, nil, 2]

[ruby-dev:29616] e$B$rEv$F$kA0$Ne(B matzruby e$B$G$Oe(B ArgumentError
e$B$Ge(B
e$B$9!#e(B

% bin/ruby -ve ‘lambda {|(v0,v1),v2| p
[v0,v1,v2]}.call([1],2)’
ruby 1.9.0 (2006-09-27) [i686-linux]
-e:1: wrong number of arguments (1 for 2) (ArgumentError)
from -e:1
from -e:1:in `Proc#call’
from -e:1

[ruby-dev:29616] e$B$rEv$F$?$b$N$G$be(B ArgumentError e$B$G$9!#e(B

% bin/ruby -ve ‘lambda {|(v0,v1),v2| p [v0,v1,v2]}.call([1],2)’
ruby 1.9.0 (2006-09-27) [i686-linux]
-e:1: wrong number of arguments (1 for 2) (ArgumentError)
from -e:1
from -e:1:in `Proc#call’
from -e:1

1.8 e$B$G$be(B ArgumentError e$B$K$J$j$^$9!#e(B

% ruby-1.8 -ve ‘lambda {|(v0,v1),v2| p [v0,v1,v2]}.call([1],2)’
ruby 1.8.6 (2007-08-16 patchlevel 5000) [i686-linux]
-e:1: wrong number of arguments (1 for 2) (ArgumentError)
from -e:1:in `call’
from -e:1

lambda e$B$re(B call
e$B$7$?:]$N0z?t$N?t$N8!::$N87L)2=$,%M%9%H$7$?0z?te(B
e$B$NItJ,$K$b:F5"E*$KE,MQ$5$l$k$+$I$&$+$,0[[email protected]$H;W$&$N$G$9e(B
e$B$,!"[email protected]$7$?$3$H$"$j$^$7$?$C$1e(B?

[email protected]$G$9!#e(B

Tanaka A. wrote:

e$B0J2<$NNc$Oe(B ArgumentError e$B$K$J$j$^$;$s!#e(B

% ./ruby -ve ‘lambda {|(v0,v1),v2| p [v0,v1,v2]}.call([1],2)’
ruby 1.9.0 (2007-08-18 patchlevel 0) [i686-linux]
[1, nil, 2]

lambda e$B$re(B call e$B$7$?:]$N0z?t$N?t$N8!::$N87L)2=$,%M%9%H$7$?0z?te(B
e$B$NItJ,$K$b:F5"E*$KE,MQ$5$l$k$+$I$&$+$,0[[email protected]$H;W$&$N$G$9e(B
e$B$,!"[email protected]$7$?$3$H$"$j$^$7$?$C$1e(B?

[email protected]$7$F$$$J$$$H;W$$$^$9!#e(B

e$B!!<BAuB&$N0U8+$H$7$F$O!"$3$l$r87L)$K%A%’%C%/$9$k$h$&$K$9$k$N$O$H$F$be(B
e$B$H$F$bBgJQ$J$N$G!“[email protected]$J$!!”$H;W$$$^$9!#e(B

e$B!!;EMME*$K$O$I$&$J$s$G$7$g$&$M!#87L)$K$7$F$b$i$&$H4r$7$$Nc$C$F$"$k$se(B
[email protected]$m$&$+!#e(B

e$B!!$A$J$_$K!“e(Blambda
e$B4X78$J$/$F$U$D$&$N%a%=%C%I$G$b$G$-$k$s$G$9$,!”$3e(B
e$B$l$O$I$&$J$s$G$7$g$&!#e(B

def m((a, b), c)
p [a, b, c]
end

m([], 1)
m([1], 2)
m([1, 2], 3)
m([1, 2, 3], 4)

#=>
[nil, nil, 1]
[1, nil, 2]
[1, 2, 3]
[1, 2, 4]

In article [email protected],
SASADA Koichi [email protected] writes:

[email protected]$7$F$$$J$$$H;W$$$^$9!#e(B

e$B$d$O$j!#e(B

e$B!!<BAuB&$N0U8+$H$7$F$O!"$3$l$r87L)$K%A%’%C%/$9$k$h$&$K$9$k$N$O$H$F$be(B
e$B$H$F$bBgJQ$J$N$G!“[email protected]$J$!!”$H;W$$$^$9!#e(B

e$B$J$k$[$I!#e(B

e$B!!;EMME*$K$O$I$&$J$s$G$7$g$&$M!#87L)$K$7$F$b$i$&$H4r$7$$Nc$C$F$"$k$se(B
[email protected]$m$&$+!#e(B

e$B;d$,e(B [ruby-dev:29616] e$B$G$$$8$C$?$H$-$K$=$&$7$?$N$O$?$V$s$b$He(B
e$B$b$H$=$&$J$C$F$$$?$+$i$G!“[email protected]$JM}M3$,$”$C$F$=$&$7$?$o$1$G$Oe(B
e$B$J$$$G$9!#$*$=$i$/!#e(B

e$B!!$A$J$_$K!“e(Blambda e$B4X78$J$/$F$U$D$&$N%a%=%C%I$G$b$G$-$k$s$G$9$,!”$3e(B
e$B$l$O$I$&$J$s$G$7$g$&!#e(B

def m((a, b), c)
p [a, b, c]
end

e$B$s!<!"$3$l$C$F$$$D$+$i$G$-$k$h$&$K$J$C$?$s$G$9$+e(B?
[email protected]$,$"$j$^$7$?$C$1e(B?

e$B5nG/$Ne(B 9e$B7n$O$G$-$^$;$s$G$7$?$h$M!#e(B

% bin/ruby -ve ‘def m((a, b), c) end’
ruby 1.9.0 (2006-09-27) [i686-linux]
-e:1: syntax error, unexpected tLPAREN, expecting ‘)’
def m((a, b), c) end
^
-e:1: syntax error, unexpected ‘)’, expecting ‘=’
def m((a, b), c) end
^

[email protected]$G$9!#e(B

Tanaka A. wrote:

e$B$s!<!"$3$l$C$F$$$D$+$i$G$-$k$h$&$K$J$C$?$s$G$9$+e(B?
[email protected]$,$"$j$^$7$?$C$1e(B?

e$B!!$?$V$sL5$+$C$?$s$8$c$J$$$G$7$g$&$+!#$$$D$N4V$K$+$G$-$F$$$?46$8!#0le(B
e$BEY$^$D$b$H$5$s$KJ9$$$F$_$?$3$H$,$"$C$?$h$&$J!#e(B

In article [email protected],
SASADA Koichi [email protected] writes:

e$B!!$?$V$sL5$+$C$?$s$8$c$J$$$G$7$g$&$+!#$$$D$N4V$K$+$G$-$F$$$?46$8!#0le(B
e$BEY$^$D$b$H$5$s$KJ9$$$F$_$?$3$H$,$"$C$?$h$&$J!#e(B

e$B$3$l!"e(Btrunk e$B$G$Oe(B r12117 e$B$Ne(B half-baked-1.9 e$B$Ne(B
merge e$B$G$9$M!#e(B
f_arg e$B$,e(B
f_norm_arg e$B$Ne(B comma separated list e$B$+$ie(B
f_arg_item e$B$Ne(B comma separated list e$B$KJQ2=$7$F$^$9!#e(B

half-baked-1.9 [email protected]$He(B r11888 e$B$G$9$,!"e(B

Revision 11888 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 26 08:25:28 2007 UTC (5 months, 2 weeks ago) by matz
File length: 194174 byte(s)
Diff to previous 11886

[email protected]: matz | 2007-02-26 17:25:35 +0900

  • parse.y, node.h: update to the latest.

e$B$H$$$&$N$,%m%0$_$?$$$G$9!#e(B

e$B$G!"e(Bthe latest e$B$C$F$I$3$N:G?7$G$9$+$Me(B?
x31 e$B$N:G?7e(B?

e$B$7$+$7!“2>0z?t$N$H$3$m$r3HD%$9$k$J$i!”$"$s$^$j$D$+$($J$$G[Nse(B
e$B$NJ,2r$h$j$O!"$`$7$me(B (e$B;DG0$J$,$i6X;_$NJ}8~$K$"$k$1$l$Ie(B)
e$B%$%se(B
e$B%9%?%s%9JQ?t$H$+$r;H$($k$N$r3HBg$7$F$[$7$$$H$3$m$G$9$,!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:31476] Re: lambda {|(v0,v1),v2|}.call([1],2)”
on Sat, 18 Aug 2007 14:02:38 +0900, SASADA Koichi [email protected]
writes:

|> lambda e$B$re(B call e$B$7$?:]$N0z?t$N?t$N8!::$N87L)2=$,%M%9%H$7$?0z?te(B
|> e$B$NItJ,$K$b:F5"E*$KE,MQ$5$l$k$+$I$&$+$,0[[email protected]$H;W$&$N$G$9e(B
|> e$B$,!"[email protected]$7$?$3$H$"$j$^$7$?$C$1e(B?
|
|[email protected]$7$F$$$J$$$H;W$$$^$9!#e(B

e$B$7$F$J$+$C$?$C$1!#e(B

|e$B!!<BAuB&$N0U8+$H$7$F$O!"$3$l$r87L)$K%A%’%C%/$9$k$h$&$K$9$k$N$O$H$F$be(B
|e$B$H$F$bBgJQ$J$N$G!“[email protected]$J$!!”$H;W$$$^$9!#e(B

e$B$+$C$3$NFbB&$OB?=EBeF~$G!"$H$$$&$h$&$JOC$r$7$?$h$&$J5$$,$7$Fe(B
[email protected]$1$I!"GrCkL4$+$J!#e(B

[email protected]$G$9!#e(B

Yukihiro M. wrote:

|e$B!!<BAuB&$N0U8+$H$7$F$O!"$3$l$r87L)$K%A%’%C%/$9$k$h$&$K$9$k$N$O$H$F$be(B
|e$B$H$F$bBgJQ$J$N$G!“[email protected]$J$!!”$H;W$$$^$9!#e(B

e$B$+$C$3$NFbB&$OB?=EBeF~$G!"$H$$$&$h$&$JOC$r$7$?$h$&$J5$$,$7$Fe(B
[email protected]$1$I!"GrCkL4$+$J!#e(B

e$B!!$"!"e(BML e$B0J30$G$O$7$F$?$+$b!#e(B

e$B!!$H$j$"$($:!"B?=EBeF~$K$7$F$b$i$($k$H4r$7$$$G$9$M$’!#e(B

In article [email protected],
Yukihiro M. [email protected] writes:

e$B$+$C$3$NFbB&$OB?=EBeF~$G!"$H$$$&$h$&$JOC$r$7$?$h$&$J5$$,$7$Fe(B
[email protected]$1$I!"GrCkL4$+$J!#e(B

e$B0z?t$N?t$N8!::$r87L)2=$9$k0U?^$O$J$$!"$H$$$&[email protected]$O$o$+$j$^$7$?!#e(B
e$B;d$b$=$&$7$F$[$7$$;v>p$,$"$k$o$1$G$O$J$$$N$G$H$/$KLdBj$O$"$je(B
e$B$^$;$s!#e(B

[email protected]!"B?=EBeF~$H$$$&[email protected]$O$3$N5!G=$KBP$7$FITE,@[email protected]$H;W$$$^$9!#e(B

  • e$B3g8L$NFbB&$KB?=EBeF~$N:8JU$G$O$J$$$b$N$,=q$1$ke(B:

    • {|(a)|} e$B$Ge(B a = … e$B$J$iB?=E$8$c$J$$$+$be(B
    • {|((a))|} e$B$Ge(B (a) = … e$B$J$ie(B syntax error
  • e$B1&JU$KBP1~$9$k<0$,B8:_$7$J$$>l9g$,$"$ke(B:
    yield v e$B$Ge(B {|a, (b, c)|} e$B$H$+$Oe(B b, c e$B$KBP1~$9$kCMe(B
    e$B$re(B v e$B$+e(B
    e$B$i<h$j=P$9$,!"BP1~$9$k<0$O$J$$!#e(B
    e$BBeF~$r2r<a$9$k$?$a$K$ON>JU$,I,MW$J$N$G1&JU$rDj5A$7$J$$$H$$e(B
    e$B$1$J$$!#e(B

  • e$BDj?t!&%$%s%9%?%s%9JQ?t$X$NBeF~$J$I!"B?=EBeF~$G2DG=$J$3$H$,e(B
    e$B$G$-$J$$!#e(B

  • e$B2a5n$N7P0^$H$7$FB?=EBeF~$OJ#;(2x4q$J%$%a!<%8e(B
    (e$B$"$k$$$O;v<Be(B)
    e$B$,$"$k$,!"$3$NItJ,$O$b$C$HC1=c$J5!G=$K;W$($k!#e(B

e$B0c$&8F$S$+$?$r$7$?$[$&$,NI$$$H;W$$$^$9!#$?$H$($P!"G[Ns$NJ,2re(B
e$B$H$+!#e(B

e$B$J$^$8B?=EBeF~$H8F$V$H!"B?=EBeF~$NJ#;(2x4q$5$r$3$3$K:F8=$9$ke(B
e$B$-$C$+$1$K$J$k$H$b8B$j$^$;$s$7!#$=$&$7$?$$$N$G$J$1$P!"8F$P$Je(B
e$B$$$[$&$,AGD>$G$7$g$&!#e(B

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