Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Strange IRB Syntax Error

Reply
Thread Tools

Strange IRB Syntax Error

 
 
Robert Klemme
Guest
Posts: n/a
 
      06-27-2003

Hi,

while playing around a bit I encountered this:

irb(main):001:0> RUBY_VERSION
"1.7.3"
irb(main):002:0> class Trivial
irb(main):003:1> def initialize(n)
irb(main):004:2> @n = n
irb(main):005:2> end
irb(main):006:1>
irb(main):007:1* def n
irb(main):008:2> @n
irb(main):009:2> end
irb(main):010:1>
irb(main):011:1* def == (anOther)
irb(main):012:1> @n == anOther.n
irb(main):013:1> end
SyntaxError: compile error
(irb):13: syntax error
from (irb):13
irb(main):014:0>
irb(main):015:0* def <=>(anOther)
irb(main):016:1> @n <=> anOther.n
irb(main):017:1> end
nil
irb(main):018:0>
irb(main):019:0* def eql?(o); self == o; end
nil
irb(main):020:0> end
SyntaxError: compile error
(irb):20: syntax error
from (irb):20
irb(main):021:0>

Strangely when parsed from a file there's no error. Why is that so? Does
it have to do with the specific way IRB parses inputs or is it a bug?

Regards

robert

 
Reply With Quote
 
 
 
 
nobu.nokada@softhome.net
Guest
Posts: n/a
 
      06-27-2003
Hi,

At Fri, 27 Jun 2003 17:03:11 +0900,
Robert Klemme wrote:
> while playing around a bit I encountered this:
>
> irb(main):001:0> RUBY_VERSION
> "1.7.3"


It's too old, and fixed already.

Note that 1.7 was old development version, and isn't supported.

--
Nobu Nakada

 
Reply With Quote
 
 
 
 
Robert Klemme
Guest
Posts: n/a
 
      06-27-2003

<(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed) uma.tochigi.jp...
> Hi,
>
> At Fri, 27 Jun 2003 17:03:11 +0900,
> Robert Klemme wrote:
> > while playing around a bit I encountered this:
> >
> > irb(main):001:0> RUBY_VERSION
> > "1.7.3"

>
> It's too old, and fixed already.
>
> Note that 1.7 was old development version, and isn't supported.


Ok, thank's for clarifying though. Next week I'll see whether I can get a
newer Win installation.

robert

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error? What syntax error? Assignment fo default values? Mark Richards Perl Misc 3 11-18-2007 05:01 PM
irb require ... where does irb look? what path? anne001 Ruby 1 06-27-2006 12:07 PM
irb question - variable definitions when calling irb from a script problem Nuralanur@aol.com Ruby 1 10-26-2005 09:13 PM
[ANN] irb-history 1.0.0: Persistent, shared Readline history for IRB Sam Stephenson Ruby 1 06-18-2005 08:56 AM
Question About Strange 'C' Code Syntax ( Well strange to me anyway ) Harvey Twyman C Programming 8 10-25-2003 05:54 AM



Advertisments