On 5/30/07, Greg Fodor <gfodor / gmail.com> wrote:
> > z = Complex[1, 1]
> > p it if a(z.conj.it!) # prints 1.414..., not Complex[1, -1]
> If there's anything our functional programming friends can
> teach us, it's that side effects will always come back to
> bite you. :)
>
> I like your syntax, though. Perhaps there is some wizardry
> that could be done that would get the semantics of let()
> but the syntax of it!() ?

I'm afraid only compiler-side wizardry can help here.

Ruby just isn't fit to accept this syntax :P

Is there a way in ruby to write a method that returns the caller's Binding? i.e.

def yourbinding
  #do magic stuff
  return binding
end
a = 6
yourbinding.eval("a = 8")
a #=> 8

?

Maybe using evil.rb things? The method must not be called
Kernel#binding, btw... that would be totally cheating.

Aur