You cannot tell what an expression does just by looking at the expression. You also have to look at the functions it calls (and the functions those call, etc.). If any of those change, then the expression may change as well.
You also need to look at local variables, as skybrain points out. For example, this function:
will behave badly: the first time you call it it will compute the answer for the value of x you give it. The second time you call it, it will compute the same answer, regardless of what x you give it.
Note to readers: justinpombrio’s parent comment was written when this post was titled “Place-Based Programming”, before I changed the title to “Place-Based Programming—Part 1″.
I think the disagreement here comes from me communicating different things to different people. I showed SatvikBeri a more complete system of which this post is just a tiny part. If all you see is this post (without the “Part 1”) then justinpombrio’s comment makes sense. If you see the entire project then SatvikBeri’s comment makes sense.
justinpombrio’s particular example can be solved with the defnp macro in Part 2.
More stable, but not significantly so.
You cannot tell what an expression does just by looking at the expression. You also have to look at the functions it calls (and the functions those call, etc.). If any of those change, then the expression may change as well.
You also need to look at local variables, as skybrain points out. For example, this function:
will behave badly: the first time you call it it will compute the answer for the value of x you give it. The second time you call it, it will compute the same answer, regardless of what x you give it.
Note to readers: justinpombrio’s parent comment was written when this post was titled “Place-Based Programming”, before I changed the title to “Place-Based Programming—Part 1″.
I think the disagreement here comes from me communicating different things to different people. I showed SatvikBeri a more complete system of which this post is just a tiny part. If all you see is this post (without the “Part 1”) then justinpombrio’s comment makes sense. If you see the entire project then SatvikBeri’s comment makes sense.
justinpombrio’s particular example can be solved with the
defnp
macro in Part 2.