From: dblack@... Date: 2003-04-27T08:58:36+09:00 Subject: Re: can you guess Hi -- On Sun, 27 Apr 2003, Tim Bates wrote: > On Sun, 27 Apr 2003 6:19 am, Brian Candler wrote: > > As a guess - is it anything to do with the various string notations like > > %x{...} for execute etc? i.e. > > > > %{args} > > > > seems to give the same result. > > Yes, as does > %;args; > You can use any character as a delimiter in Ruby, remember? So in the case of > % args > You're using spaces as delimiters. I think. irb does some very strange things > in this case, depending on whether you put a space after the 'args' or not: > > (Replace '_' with space) > irb(main):027:0> class_String > irb(main):028:1> def_expand(*args) > irb(main):029:2> %_args_ > irb(main):030:2> end > irb(main):031:1> end > > Works fine. > > irb(main):015:0> class_String > irb(main):016:1> def_expand(*args) > irb(main):017:2> %_args > irb(main):018:2" end > irb(main):019:2" end > > Still thinks it's inside the string, because I haven't used a > 'closing space' yet. That's not strange though, is it? You've sort of contracted to provide a delimiting space, so it's just waiting for one. It's not irb-specific: $ ruby -e 'puts(%_ > abc > def > )' _ abc def (also using _ for space) (though it would work with literal '_' too :-) David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav