OpenDream icon indicating copy to clipboard operation
OpenDream copied to clipboard

Const vars can be reassigned or overridden

Open wixoaGit opened this issue 4 years ago • 1 comments

Constant vars can be reassigned by code or overridden in object definitions.

var/const/C = 1
world.log << C
C = 2
world.log << C

Note that in const-only contexts (such as switch cases) the initial value will still be used because the compiler uses the initial value at compile-time.

wixoaGit avatar Dec 15 '21 03:12 wixoaGit

oop

Altoids1 avatar Aug 20 '22 20:08 Altoids1