In RemoveItem() and InsertItem() NIL = 0, Is this a feature or a bug?
Posted: Thu Nov 14, 2024 5:32 pm
I know that NIL often is 0, but since I am quite often using a system where I put args to function with idea that some of them might not exist, like as example something like this:
then in practice mostly meant to be used:
Leaving the POS completely out, and only used when needed.
This have worked quite well in my functions but now that the InsertItem and RemoveItem treat NIL as 0, it makes me need to make an extra check of if it really is Nil first, I am therefore wondering that is this actually a supposed behavior or accidental, for after all, quite many commands in Hollywood are using NIL as an option, like MakeButton(NIL...), and if you put instead 0, then it doesn't do same as NIL.
Code: Select all
Function My_InsertItem(Table, Item, Pos)
InsertItem(Table, Item, Pos)
EndFunctionCode: Select all
My_InsertItem(Table, Item)This have worked quite well in my functions but now that the InsertItem and RemoveItem treat NIL as 0, it makes me need to make an extra check of if it really is Nil first, I am therefore wondering that is this actually a supposed behavior or accidental, for after all, quite many commands in Hollywood are using NIL as an option, like MakeButton(NIL...), and if you put instead 0, then it doesn't do same as NIL.