GulfOfMexico icon indicating copy to clipboard operation
GulfOfMexico copied to clipboard

Add

Open Agsgt2 opened this issue 6 months ago • 11 comments

Sequel to delete, instead of removing the command, it adds it back

delete print !

add print !

print("GulfOfMexico") ! //GulfOfMexico

Agsgt2 avatar Jun 11 '25 04:06 Agsgt2

Will this feature finally allow me to bring back the delete keyword that I accidentally deleted last year before deleting all keywords I needed?

SkyaTura avatar Jun 11 '25 22:06 SkyaTura

what happens with delete add ! ?

RENoMafex avatar Jun 23 '25 12:06 RENoMafex

@RENoMafex I do not recommend on testing since we may need a new keyword to fix that.

SkyaTura avatar Jun 23 '25 14:06 SkyaTura

why dont we make add un-deletable?

Agsgt2 avatar Aug 04 '25 21:08 Agsgt2

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.

Aluriak avatar Aug 05 '25 10:08 Aluriak

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 avatar Sep 10 '25 20:09 SkyaTura

@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

Agsgt2 avatar Sep 16 '25 02:09 Agsgt2

That way, you can prevent adding a name you don't want to see somewhere, like one-letter index variables !

weakprotect i, j, k !

Aluriak avatar Oct 21 '25 11:10 Aluriak

Should we move the protect and weakprotect proposals to a new issue? I see this may have a potential on it's own.

SkyaTura avatar Oct 29 '25 23:10 SkyaTura

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

cute-catgirl avatar Oct 30 '25 04:10 cute-catgirl

Can we do delete add! add<-1> add! So we call add from before it deleted and use it to add add

Try768 avatar Oct 31 '25 03:10 Try768