Type | Bug | Status | complete | Date | 6-Dec-2012 00:52 |
---|---|---|---|---|---|
Version | alpha 112 | Category | Native | Submitted by | Ladislav |
Platform | All | Severity | minor | Priority | normal |
Summary | VALUE? inconsistency |
---|---|
Description |
The VALUE? function served in R2 as a kind of guard against triggering an error when trying to get a value of a word. This property made the function useful and it was also in agreement with the documentation stating that "Returns TRUE if the word has been set...Returns FALSE for all other values." (in R2) or "The VALUE? function returns TRUE if the specified word has a value. It returns FALSE if not." (in R3). In both cases it is a consequence of logic that when the VALUE? function doesn't return TRUE it shall return FALSE. |
Example code |
; a word that "isn't bound to a context" first to block! "x" ; == x bound? first to block! "x" ; == none ; another word that "isn't bound to a context at present" f: func [x] ['x] f none ; == x ; now observe how the former is handled by VALUE? value? first to block! "x" ; == false ; however, the latter is not handled in a compatible manner value? f none ; ** Script error: x word is not bound to a context ; ** Where: value? ; ** Near: value? f none ; note that I do not disagree with the formulation; ; I disagree with the inconsistency |
Assigned to | n/a | Fixed in | - | Last Update | 18-Aug-2013 13:30 |
---|
Comments | |
---|---|
(0003251)
BrianH 6-Dec-2012 19:52 |
This is a side effect of #1893. In the case of value? f none, the script error returned is incorrect. The word is not really not bound to a context, it's just bound to an out-of-scope function context. So, VALUE? isn't being inconsistent, the contexts are. |
(0003254)
Ladislav 8-Dec-2012 09:03 |
Yes, the "out-of-scope function context" text looks more accurate. However, my opinion is that the VALUE? function documentation specifies that the function shall return FALSE when it does not return TRUE. Also, I do not think it is a side-effect of #1893. |
(0003904)
Ladislav 30-Jul-2013 08:57 |
In the core-tests suite. |
(0003908)
Ladislav 2-Aug-2013 18:43 |
Pull request submitted. |
Date | User | Field | Action | Change |
---|---|---|---|---|
18-Aug-2013 13:30 | Ladislav | Status | Modified | pending => complete |
2-Aug-2013 18:44 | Ladislav | Status | Modified | submitted => pending |
2-Aug-2013 18:43 | Ladislav | Comment : 0003908 | Added | - |
1-Aug-2013 14:36 | Ladislav | Comment : 0003254 | Modified | - |
30-Jul-2013 08:57 | Ladislav | Comment : 0003904 | Added | - |
18-Feb-2013 00:16 | Ladislav | Description | Modified | - |
18-Feb-2013 00:16 | Ladislav | Description | Modified | - |
18-Feb-2013 00:14 | Ladislav | Description | Modified | - |
18-Feb-2013 00:12 | Ladislav | Comment : 0003254 | Modified | - |
17-Feb-2013 23:53 | Ladislav | Comment : 0003254 | Modified | - |
19-Dec-2012 17:23 | Ladislav | Description | Modified | - |
19-Dec-2012 17:22 | Ladislav | Description | Modified | - |
19-Dec-2012 17:12 | Ladislav | Comment : 0003254 | Modified | - |
19-Dec-2012 17:11 | Ladislav | Category | Modified | Error Handling => Native |
19-Dec-2012 17:11 | Ladislav | Description | Modified | - |
8-Dec-2012 09:06 | Ladislav | Comment : 0003254 | Modified | - |
8-Dec-2012 09:04 | Ladislav | Comment : 0003254 | Modified | - |
8-Dec-2012 09:04 | Ladislav | Comment : 0003254 | Modified | - |
8-Dec-2012 09:03 | Ladislav | Comment : 0003254 | Added | - |
6-Dec-2012 20:02 | BrianH | Category | Modified | Unspecified => Error Handling |
6-Dec-2012 20:02 | BrianH | Code | Modified | - |
6-Dec-2012 20:01 | BrianH | Comment : 0003251 | Modified | - |
6-Dec-2012 19:52 | BrianH | Comment : 0003251 | Added | - |
6-Dec-2012 00:52 | ladislav | Ticket | Added | - |