This keyword would be similar to how when detects when a variable mutates.
However, instead of detecting changes, it would detect the deletion of a primitive (such as with the delete statement).
Some potential names for this keyword include ondelete, ~ath (pronounced "til death"), or posthumous (pronounced "poz thoom us").
The addition of this keyword would greatly improve code safety by adding the ability for checks to be created to ensure that the primitives used in your program don't get deleted maliciously.
Additionally, this keyword would expand the event system in DreamBerd started by keywords such as when, after, and addEventListener.
Example code:
ondelete(4) {
'4 was deleted'?
}
delete 4! // prints '4 was deleted'
This keyword would be similar to how
when
detects when a variable mutates. However, instead of detecting changes, it would detect the deletion of a primitive (such as with thedelete
statement). Some potential names for this keyword includeondelete
,~ath
(pronounced "til death"), orposthumous
(pronounced "poz thoom us"). The addition of this keyword would greatly improve code safety by adding the ability for checks to be created to ensure that the primitives used in your program don't get deleted maliciously. Additionally, this keyword would expand the event system in DreamBerd started by keywords such aswhen
,after
, andaddEventListener
.Example code: