in reply to Re: On Wormholes, Time-Travel and Closures
in thread On Wormholes, Time-Travel and Closures

yikes, hope i never have to maintain code like that. it's hard enough tracing what happens, with that i'll have to enumerate and trace all possible futures as well

spooky action indeed!


It's not what you look like, when you're doin' what you’re doin'.
It's what you’re doin' when you’re doin' what you look like you’re doin'!
     - Charles Wright & the Watts 103rd Street Rhythm Band, Express yourself
  • Comment on Re^2: On Wormholes, Time-Travel and Closures

Replies are listed 'Best First'.
Re^3: On Wormholes, Time-Travel and Closures
by Limbic~Region (Chancellor) on Dec 11, 2006 at 15:40 UTC
    qbxk,
    No offense, but this likely has to do with your lack of exposure to pure functional languages. In some languages, variables can't change value so it is moot. It does kind of make you wonder why they still call them variables. In other languages, you need to desginate this behavior (default being eager) which is a visual indicator like tie.

    We are of course talking about Perl, not other languages, so your point is well taken. Re: Evaluating variables when called is an example of such a desire. I am kind of interested in where Perl 6 will go with this.

    Cheers - L~R

      Well, if you say, in math, that function f() is defined by equation f(x) = 2*x + 1 + sin(x) what would you call the "x"? A variable. And does it change within evaluation of the 2*x + 1 + sin(x)? The sentence that variables can't change value is not really correct actually. Next time you evaluate a function the x defined as its parameter or as an internal variable may have a totally different value. It's just that instead of "hey, I want to have a blackboard on which I'll write numbers and I'll call it X. Write 5 there now! OK and now clean it and write 10 there!" you just say "the value of something I wish to call X depends on the parameters of the function like this". And it's just the habits from imperative language that force you to look for ways to overwrite the X later instead of using a different name for the result of a different computation.