danilopedraza / symstatic

The Symstatic programming language code repository
https://symstatic.org/book
GNU General Public License v3.0
2 stars 0 forks source link

Assignments #28

Open danilopedraza opened 3 months ago

danilopedraza commented 3 months ago

The language should let the user change the value of an existing symbol. After all, I'm not that compromised with functional style; I just promote it. I think of this syntax:

let a := 5
a := 6
a # 6
danilopedraza commented 3 days ago

The reason for having one syntax for declaring and another for assingning is that names can be reused in different scopes. For example:

let f(n) := 2*n

let g := n -> (
    let f(k) := 3*k,
    f(n)
)

f(2) # this is 2*2
g(2) # this is 3*2