Not logged inOpenClonk Forum
Up Topic Functions in proplist constants, Effects

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Günther
Yes, number 3 doesn't apply to functions in constant proplists. However, looking in the proplist finds functions as well as other values, so that isn't a one-to-one replacement for local variables. There are several wacky solutions:
a) Check for all properties first, then keywords. You can always replace true with a local variable, and sometimes with a function.
b) Check for keywords first, then properties. You can sometimes replace true with a local variable, and never with a function.
c) Check the value in the property. Extra code to provide consistency with an historical accident.
d) Change the rules for all functions. I'm not sure where the best place for the keywords is - I like the compatibility aspect of allowing old code that uses a new keyword as an ordinary identifier to continue to work, so I'd tend to place them after functions. If we place them at the end, the difference between a global constant and true, false and nil shrinks, which looks tidy. On the other hand, a scenario with a global constant with the same name as a new keyword will probably break anyway. Also, the list of forbidden keywords is somewhat arbitrary, and should probably be checked at the point of declaration instead of usage.

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill