From: "Guy N. Hurst" Date: 2000-10-23T18:43:56+09:00 Subject: [ruby-talk:5780] Re: Some newbye question ts wrote: > > >>>>> "G" == Guy N Hurst writes: > > I see 2 problems with your idea > > G> block{|a~,b~| > > if someone has defined a def 'block', it will have a problem no ? > Hmm. Could you explain what you mean more? > G> b # block variable, has value 12 > G> a # block variable, has value 24 > > You can't move the block with cut/paste because the value of 'a', and 'b' > depend of the previous variable 'a' and 'b', no ? > Right. > G> b = 24 > G> a = 36 > > G> Could this be implemented? > > You can perhaps implement a 'let' if you re-use an existing keyword like > for example 'do' > Well, the tilde notation implies a 'let', {|x,y~| ....} without having to resort to {|x, y=y| .... } y~ means make an in-block var initialized with local var 'y'. I think y=y is confusing. Guy N. Hurst -- HurstLinks Web Development http://www.hurstlinks.com/ Norfolk, VA - (757)623-9688 PHP/MySQL - Ruby/Perl - HTML/Javascript