What is Nostr?
jason /
npub1k3q…tk47
2024-12-19 18:04:10

jason on Nostr: Live language devlog 2 The "once" keyword before any expression enables state ...

Live language devlog 2

The "once" keyword before any expression enables state preservation across changes. It can be arbitrarily nested and is based on the hash of the expression. So if you change the expression, it'll "reinitialize".

Notice the lines show the last evaluated value, while variables show their current value. So the lines that initialize "a" and "b" fields in the "state" variable are never re-evaluated during this video.

Author Public Key
npub1k3qxq2tyq200eha2s0as254wy04nevy4sjtrja9tk3t5sr6m8ysqa7tk47