[ruby-talk:00325] Re: binding

From: Pros Yeboah <yeboah@...>
Date: 1999-05-18 08:21:27 UTC
List: ruby-talk #325
Yukihiro Matsumoto wrote:

> Hi.
>
> In message "[ruby-talk:00323] binding"
>     on 99/05/18, Pros Yeboah <yeboah@tu-harburg.de> writes:
>
> |Can someone please explain to me  the meaning  and usage of
> |1)the  built-in method binding.
>
> binging contains the local variable closure.  You can supply it as
> the second argument of eval().
>
>   def foo
>     a = 25
>     b = 55
>     return binding
>   end
>
>   bind = foo            # returns foo's binding
>   p eval("[a,b]", bind) # evaluate as if within foo
>
> |2)the Kernel method  callcc.
>
> It's a continuation.  If you know scheme's call/cc, that's it.  If you
> don't know... hmm.. Could somebody explain it please?  Shugo?
>
>                                                 matz.


I was away  for a while and just came in. Thanks  matz. You are a great
help.
Pros


In This Thread