Add
Sequel to delete, instead of removing the command, it adds it back
delete print !
add print !
print("GulfOfMexico") ! //GulfOfMexico
Will this feature finally allow me to bring back the delete keyword that I accidentally deleted last year before deleting all keywords I needed?
what happens with delete add ! ?
@RENoMafex I do not recommend on testing since we may need a new keyword to fix that.
why dont we make add un-deletable?
We could add a protect keyword, allowing us to prevent deletion of some keywords.
protect print !
delete print ! // error: print is protected from deletion
add print ! // error: print already exists
print("GulfOfMexico") ! // error: print is protected from usage
but protected being too vague, it would also affect the use of the object protected.
I like that, we could even delete the protect keyword after protecting all the essentials, therefore, avoiding accidental protection.
If this behavior is not intended, we could also go yolo mode: delete protect
@SkyaTura maybe add weakprotect, like protect, but it only protects it from being used, it can be deleted
weakprotect print !
print("GulfOfMexico") ! // Error : print is protected from usage
delete print !
print("GulfOfMexico") ! // Error : print is deleted
and don't even try adding it back!
add print ! // Error : print is protected from being added
That way, you can prevent adding a name you don't want to see somewhere, like one-letter index variables !
weakprotect i, j, k !
Should we move the protect and weakprotect proposals to a new issue? I see this may have a potential on it's own.
How is add able to add back keywords that don't exist??
I think the behavior would make more sense if it was like:
var var printunion = print!
delete print!
add print! // Error: 'print' is not defined
add printunion!
print("GulfOfMexico") // GulfOfMexico
Can we do delete add! add<-1> add! So we call add from before it deleted and use it to add add