Skip to content
pannous edited this page Nov 14, 2020 · 9 revisions

:= is identical be assignment and charged method definition :

square x be x*x
square x := x*x
to square x: x*x

All three are identical.

Difference between symbolic assignment :=, lazy assignment := and direct assignment = :

If symbols in the body of := do not occur on the right hand side, they remain lazy symbols waiting for evaluation.

square := x*x
x = 3
square == 9
x = 4
square == 16

Direct assignment = evaluates all symbols not occurring on the left hand side immediately:

square x = x*x # ok
square = x*x # error, unknown symbol x
x=3
square = x*x # ok, use symbol x from context
square == 9
x = 4
square == 9 # square was fully evaluated when x=3

Contrast the last behavior of square = x*x with
square := x*x
square x := x*x
square x = x*x

Home

Philosophy

data & code blocks

features

inventions

evaluation

keywords

iteration

tasks

examples

todo : bad ideas and open questions

⚠️ specification and progress are out of sync

Clone this wiki locally