[Bug] --? (ref delete) doesn't do anything and compiles without error

Started by kajacx, March 26, 2017, 02:24:05 PM

Previous topic - Next topic

kajacx

After debugging a code for 15 minutes, I found out that the ref delete operator "--?" doesn't do anything! It even compiles without warning. It even leaves the vaariable name on stack. How did this happen?

Thankfully, you can write "--!" which is certaily better for people with OCD (and with a sence of order in general):

Operation    Normal       Reference
Read         <-varname    <-!
Write        ->varname    ->!
Exists       -?varname    -?!
Delete       --varname    --!


I have already changed the wiki and added the warning there, however not everyone will read the wiki or will go to the CRPL wiki for things like this (like I did).

So, can the operator "--?" start doing what it should, or at least throw a compilation error "--? is obsolete, use --! for ref delete instead".

If you want to try it out on your own:

"Test" ->test

#"test" --? #doesn't work
"test" --! #works

"StackSize: " StackSize 1 sub Trace2

"Is it defined?" -?test Trace2


By the way the exact same thing happens with global ref delete, "--?*" doesn't do anything (and still compiels fine), while "--!*" is the actual gobal ref delete.
Why do work yourself, when you can write a program that will do the work for you.

GoodMorning

--? is a valid command, being a delete for a variable '?'.

Mention can be made on the wiki, but...
A narrative is a lightly-marked path to another reality.

kajacx

Good idea to edit the wiki (already done), but it would still be a good idea to give people a warning when they use it: you probably didn't want to delete a variable named "?", and wanted to use a ref delete instead.
Why do work yourself, when you can write a program that will do the work for you.