Repository navigation
Replies: 1 comment
|
I was away for a week, thank you for your question.
It's a function accepting a word a value and it assigns binds a value to the word and marks word a "variable" in current contex. It can be used like any other function, for example as dot word, with a star ... etc I see the value of var functions, that you can explicitly say "here I am declaring that this word is a variable and this is it's initial value and now changing it's value". While mod word is less specific saying "I am creating or changing this value". So you can use modwords but code clearer if you use var where you can. Unfortunately it's not practical to use var in looping functions, where mod-word seems to be the way to go (or function blocks if you want cleaner contexts / code). If not for that wide case, I would make mod-words only modify the already declared variable words. If we find some clean syntax / concept for it this might still change. So for a quick script or repl use you can just use mod words, but in a larger programs I would use var where possible, default being all const (set-word) anyway. |
Uh oh!
There was an error while loading. Please reload this page.
Since assignment of vars defined using Var have the double colon, why the Var keyword?
Using varname:: value does it all, or ot?
All reactions