Type | Wish | Status | reviewed | Date | 12-May-2015 17:44 |
---|---|---|---|---|---|
Version | r3 master | Category | Native | Submitted by | fork |
Platform | All | Severity | minor | Priority | normal |
Summary | Make UNSET of unbound words cause error vs. fail silently |
---|---|
Description |
Currently if you try to unset a word that is not bound, it is a no-op: >> type? unset unbind 'x == unset! It returns an unset, but nothing happens. If you tried to set such a word, you'd get an error: >> set unbind 'x none ** Script error: x word is not bound to a context The same error could be given to indicate that x does not have any associated value to unset. This would be more consistent, because the behavior of unbound things and unset things are different in terms of the error messages you receive when they are run... and also when you use set or get with /any on them: >> do unbind 'x ** Script error: x word is not bound to a context >> do [x] ** Script error: x has no value >> get/any unbind 'x ** Script error: x word is not bound to a context >> type? get/any 'x == unset! |
Example code |
; current behavior >> type? unset unbind 'x == unset! ; desired behavior >> unset unbind 'x ** Script error: x word is not bound to a context |
Assigned to | n/a | Fixed in | - | Last Update | 12-May-2015 21:44 |
---|
Comments | |
---|---|
(0004642)
abolka 12-May-2015 21:44 |
+1 |
Date | User | Field | Action | Change |
---|---|---|---|---|
12-May-2015 21:44 | abolka | Comment : 0004642 | Added | - |
12-May-2015 21:44 | abolka | Status | Modified | submitted => reviewed |
12-May-2015 17:49 | Fork | Description | Modified | - |
12-May-2015 17:49 | Fork | Code | Modified | - |
12-May-2015 17:44 | Fork | Ticket | Added | - |