[#4595] New block syntax — Daniel Amelang <daniel.amelang@...>

I'm really sorry if this isn't the place to talk about this. I've

25 messages 2005/03/21
[#4606] Re: New block syntax — "David A. Black" <dblack@...> 2005/03/21

Hi --

[#4629] Re: New block syntax — "Sean E. Russell" <ser@...> 2005/03/30

On Monday 21 March 2005 16:17, David A. Black wrote:

[#4648] about REXML::Encoding — speakillof <speakillof@...>

Hi.

15 messages 2005/03/31
[#4659] Re: about REXML::Encoding — "Sean E. Russell" <ser@...> 2005/04/04

On Thursday 31 March 2005 09:44, speakillof wrote:

Re: proc and block local variables causes a [BUG]

From: Yukihiro Matsumoto <matz@...>
Date: 2005-03-10 18:26:24 UTC
List: ruby-core #4556
Hi,

In message "Re: proc and block local variables causes a [BUG]"
    on Fri, 11 Mar 2005 00:20:23 +0900, URABE Shyouhei <s-urabe@par.odn.ne.jp> writes:

|Maybe I just don't understand what is happening to the CVS but...
|
|% ruby -e'1.times {|i; j=i| p[i, j] }'
|[0,0]
|% ruby -e'{|i; j=i| p [i, j]}.call(0)'
|-e:1: [BUG] bug in variable assignment
|ruby-1.9.0 (2005-03-10) [powerpc-darwin7.7.0]

It is a bug.  Thank you for reporting.

							matz.
Index: parse.y
===================================================================
RCS file: /var/cvs/src/ruby/parse.y,v
retrieving revision 1.373
diff -p -u -1 -r1.373 parse.y
--- parse.y	9 Mar 2005 09:29:51 -0000	1.373
+++ parse.y	10 Mar 2005 18:25:51 -0000
@@ -2540,3 +2540,6 @@ primary		: literal
 		    /*%%%*/
-			$$ = NEW_LAMBDA($3, dyna_init($5, $<vars>4));
+			$3->nd_body = block_append($3->nd_body,
+						   dyna_init($5, $<vars>4));
+			$$ = $3;
+		        nd_set_type($3, NODE_LAMBDA);
 			nd_set_line($$, $<num>1);

In This Thread

Prev Next