pmgl / microstudio

Free, open source game engine online
MIT License
921 stars 103 forks source link

Support 'nil' keyword as syntactic sugar for '0' #157

Closed Skaruts closed 2 years ago

Skaruts commented 2 years ago

In the same way the text editor recognizes true and false as keywords, it could also recognize the keyword nil.

Personally I already use nil for setting variables as null, just because it makes them stand out from other variables that are actually numeric. The only thing I feel is missing is having nil in a color that stands out, like true and false do.

I've been misunderstood about this before, so I should make it clear: I'm not asking for a null type to be added to microscript. I'm suggesting that the text editor could recognize and highlight a keyword.

pmgl commented 2 years ago

As you know already, microScript was designed to avoid any use of nil, null, none or undefined ; I understand your request but I am reluctant to add more keywords to the language, even if it is just for syntax highlighting. I have two suggestions for you: