Strange Ruby String behavior 
Author Message
 Strange Ruby String behavior

I discovered some bizarre behavior in Ruby, and I wonder if there's an
answer.  I don't believe it is a bug, per se, but it is strange.

I had the following line of code:


See the '#' near the end?  The strange thing is that, time after time, this
didn't cause Ruby 1.6.6 to {*filter*}on my Linux box -- however, when Markus
tried to run it on 1.6.5 on his machine (some Unix or Linux variant, I'm
not sure which), it gave him an error:

  /usr/local/lib/ruby/site_ruby/1.6/rexml/entity.rb:8: compile error in
string expansion (SyntaxError)

Was this something that changed between 1.6.5 and 1.6.6, or am I seeing
something else?  The question is probably moot; I moved the hash to the end
of the string and there are no problems.  I'm just curious.

--- SER



Sun, 31 Oct 2004 06:27:25 GMT  
 Strange Ruby String behavior



3



So the fix is to not put these together.



Sun, 31 Oct 2004 06:43:48 GMT  
 Strange Ruby String behavior
Hello --

Quote:

> I discovered some bizarre behavior in Ruby, and I wonder if there's an
> answer.  I don't believe it is a bug, per se, but it is strange.

> I had the following line of code:


> See the '#' near the end?  The strange thing is that, time after time, this
> didn't cause Ruby 1.6.6 to {*filter*}on my Linux box -- however, when Markus
> tried to run it on 1.6.5 on his machine (some Unix or Linux variant, I'm
> not sure which), it gave him an error:

>   /usr/local/lib/ruby/site_ruby/1.6/rexml/entity.rb:8: compile error in
> string expansion (SyntaxError)

> Was this something that changed between 1.6.5 and 1.6.6, or am I seeing
> something else?  The question is probably moot; I moved the hash to the end
> of the string and there are no problems.  I'm just curious.

It looks like is was a change.   Scanning the 1.6.6 ChangeLog:

   * parse.y (str_extend): should not process immature #$x and

David

--
David Alan Black


Web:   http://www.*-*-*.com/ ~blackdav



Sun, 31 Oct 2004 06:43:48 GMT  
 Strange Ruby String behavior

Quote:

> It looks like is was a change.   Scanning the 1.6.6 ChangeLog:

Thanks, David.

--- SER



Sun, 31 Oct 2004 22:09:49 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Strange ruby 1.6.0/cygwin1.1/Nt4 behavior/bug

2. Strange string behavior

3. Strange instance class valiable behavior

4. Strange behavior of VM with Delphi COM Servers.

5. AXValueConvertingControlSite strange behavior

6. Strange news groups behavior

7. Strange behavior of AWK I can't understand

8. Strange RB3 behavior

9. windows 2000 strange behavior on save

10. Strange compilation behavior RB2

11. ABC Browse - Strange Behavior

12. Strange Browse Box Behavior when App is minimized - 5PE

 

 
Powered by phpBB® Forum Software