TodePond / DreamBerd

perfect programming language
https://dreamberd.computer
Other
11.31k stars 347 forks source link

Restrict the characters used for naming variables. #56

Open A-D-E-A opened 1 year ago

A-D-E-A commented 1 year ago

As of now, the specification says that "both variables and constants can be named with any Unicode character or string."

It poses a problem because then, variables could be named with the space symbol (`) which would inevitably lead to parsing errors, because parsing is hard and the current compiler is not happy when I tell it to use spaces as variables. I propose that the character set allowed is reduced to "any Unicode character or string, except the *whitespace* ( `) character and strings which contain it".

To be clear, we still should be able to use some whitespace or blank characters, such as   (alt+255), tab, newline, and others. First of all, because that rocks; second, because it means we can write variables like in inform7 that look like full sentences; finally, because any user of the code might want to port their whitespace codebase to DreamBeard and assigning white characters to instructions can make it happen. I think the spec should make it clear that DreamBerd is so perfect that it even is compatible with the whitespace programming language.

TodePond commented 1 year ago

I agree

jhonatan-3a commented 1 year ago

dang

thecaralice commented 3 weeks ago

I think we need to disallow usage of latin letters because they are usually used in strings and keywords