Definitions
The definition starts with let
keyword, and the =
sign connects the defined {name}
and its value evaluated from {expression}
. it returns defined variable.
(let {name} = {expression})
Definitions are all lambda-level (scoped in which they are defined, and all sub context).
One point to note is that you can refer the {name}
in the scope before definition, but the value at this time is nil
, and only after the definition, variable can be obtained.
(puts: foo) # foo == nil #
(let foo = 1) # without this expression, there will be a runtime error #