Re: Differences between irb and ruby.
by Mauricio Fernandez other posts by this author
Jul 1 2006 4:15AM messages near this date
Re: Differences between irb and ruby.
|
Problem with gems, Windows, C extension
On Sat, Jul 01, 2006 at 01:32:54PM +0900, Logan Capaldo wrote:
> >What do you mean by 'evaled' and 'complete state'? And Why are the
> >visibility differences happening?
>
> irb is a repl written in ruby which means it uses eval (or
> module_eval or instance_eval). [...]
As for "complete state": irb needs a full ("complete") expression before it
can run eval(str). It is intelligent enough to keep reading until the
expression can be eval'ed, e.g. if you enter
class Foo
it will ask for input until it sees a matching 'end'.
Note that irb's lexer is not perfect so this might fail occasionally.
--
Mauricio Fernandez - http://eigenclass.org - singular Ruby
Thread:
Minkoo Seo
Ezra Zygmuntowicz
Minkoo Seo
Ezra Zygmuntowicz
Austin Ziegler
Minkoo Seo
Logan Capaldo
Mauricio Fernandez
|