11-30-2020, 03:34 PM
Hi,
Yes this is until they are forgotten for the remembered values.
No the (set Var ....) is also kept in memory along all the game, until that variable is modified once again.
Only the pending values are automatically reset after one move.
No the (set Var ...) can not be set in the starting rules.... That would be possible of course, but it would be much better to avoid that. These variables are there to allow more power into Ludii but are not nice to be used. We try to keep the .lud files as closer as possible to a game description which is not really the case if too many variables like that are used. Except if you know a game already existing which can required that.
If the value is tested before to be set the default value is returned (which is the most general default integer value in Ludii, UNDEFINED which is equal to -1 as described in the doc).
null is not allowed, see the grammar or the LLR. That's not a word of the language. Null can never be used, if a null pointer is reached a bug happens, that's why we check the most cases we can to return the default value in case of something impossible is tested, like if you try to get the value of a variable not set as explained just before.
All these information are in the doc in the sections related to that. Except for the "null" question, that's just not part of the language and we absolutely do not want that.
Regards,
Eric
Yes this is until they are forgotten for the remembered values.
No the (set Var ....) is also kept in memory along all the game, until that variable is modified once again.
Only the pending values are automatically reset after one move.
No the (set Var ...) can not be set in the starting rules.... That would be possible of course, but it would be much better to avoid that. These variables are there to allow more power into Ludii but are not nice to be used. We try to keep the .lud files as closer as possible to a game description which is not really the case if too many variables like that are used. Except if you know a game already existing which can required that.
If the value is tested before to be set the default value is returned (which is the most general default integer value in Ludii, UNDEFINED which is equal to -1 as described in the doc).
null is not allowed, see the grammar or the LLR. That's not a word of the language. Null can never be used, if a null pointer is reached a bug happens, that's why we check the most cases we can to return the default value in case of something impossible is tested, like if you try to get the value of a variable not set as explained just before.
All these information are in the doc in the sections related to that. Except for the "null" question, that's just not part of the language and we absolutely do not want that.
Regards,
Eric