[#3006] mismatched quotation — "stevan apter" <apter@...>

ruby documentation uses a punctuation convention i've never seen

13 messages 2000/05/27

[ruby-talk:02646] Re: Ruby Toplevel

From: matz@... (Yukihiro Matsumoto)
Date: 2000-05-09 05:11:32 UTC
List: ruby-talk #2646
Hi.

In message "[ruby-talk:02645] Re: Ruby Toplevel"
    on 00/05/09, Dave Thomas <Dave@thomases.com> writes:

|> |Is there any way to express the Ruby toplevel in Ruby itself (without
|> |cheating and using TOPLEVEL_BINDING)?
|> 
|> I don't think there is.
|> Why don't you use TOPLEVEL_BINDING?  I'm curious.
|
|I was trying to write a section on the toplevel environment for the
|book. Writing it using TOPLEVEL_BINDING is sort of recursive, and
|doesn't really clarify the explanation. I think I'm just going to have
|to fall back on something like "At the top level, we're executing code
|in the context of some pre-defined object." (unless you can think of a 
|better way ;-)

I see what you mean.  I was misunderstanding you.
Just use `binding' method at the toplevel.  It returns the current binding.

							matz.

In This Thread