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.


In reply to Re^4: On Wormholes, Time-Travel and Closures by Jenda
in thread On Wormholes, Time-Travel and Closures by liverpole

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.