Type | Bug | Status | tested | Date | 22-Feb-2009 23:00 |
---|---|---|---|---|---|
Version | alpha 36 | Category | n/a | Submitted by | BrianH |
Platform | All | Severity | major | Priority | urgent |
Summary | CONSTRUCT doesn't special-case none, logic! keywords, lit-words or lit-paths like R2. |
---|---|
Description |
CONSTRUCT in R3 doesn't special-case none, true, false, on and off keywords like R2 does, so the assigned values end up being the words none, true, false, on and off instead. Also, lit-words end up being assigned as lit-word! values, rather than word! values, and lit-paths end up being assigned as lit-path! values, rather than path! values. Among other things, this currently affects REBOL headers because LOAD calls CONSTRUCT, same as in R2. Proposed default behavior: Like R2's CONSTRUCT, except also have yes and no keywords translate to logic! values, and have unset! values translate to none. Both of these improvements are critical. The screening code in mezz-load 620-621 is a good model. Also see #687 for an /only option. |
Example code |
; In R2: >> type? get in construct [a: true] 'a == logic! >> type? get in construct [a: false] 'a == logic! >> type? get in construct [a: on] 'a == logic! >> type? get in construct [a: off] 'a == logic! >> type? get in construct [a: yes] 'a == word! >> type? get in construct [a: no] 'a == word! >> type? get in construct [a: none] 'a == none! >> type? get/any in construct head insert tail [a:] () 'a == unset! >> type? get in construct [a: b] 'a == word! >> type? get in construct [a: 'b] 'a == word! >> type? get in construct [a: b/c] 'a == path! >> type? get in construct [a: 'b/c] 'a == path! ; In R3 2.100.36: >> type? get in construct [a: true] 'a == word! >> type? get in construct [a: false] 'a == word! >> type? get in construct [a: on] 'a == word! >> type? get in construct [a: off] 'a == word! >> type? get in construct [a: yes] 'a == word! >> type? get in construct [a: no] 'a == word! >> type? get in construct [a: none] 'a == word! >> type? get/any in construct head insert tail [a:] () 'a ** Script error: invalid argument: unset! ** Where: construct ** Near: construct head insert tail [a: unset!] [] 'a >> type? get in construct [a: b] 'a == word! >> type? get in construct [a: 'b] 'a == lit-word! >> type? get in construct [a: b/c] 'a == path! >> type? get in construct [a: 'b/c] 'a == lit-path! ; Desired R3 behavior without /only >> type? get in construct [a: true] 'a == logic! >> type? get in construct [a: false] 'a == logic! >> type? get in construct [a: on] 'a == logic! >> type? get in construct [a: off] 'a == logic! >> type? get in construct [a: yes] 'a == logic! >> type? get in construct [a: no] 'a == logic! >> type? get in construct [a: none] 'a == none! >> type? get/any in construct head insert tail [a:] () 'a == none! >> type? get in construct [a: b] 'a == word! >> type? get in construct [a: 'b] 'a == word! >> type? get in construct [a: b/c] 'a == path! >> type? get in construct [a: 'b/c] 'a == path! |
Assigned to | n/a | Fixed in | alpha 38 | Last Update | 25-Mar-2009 05:34 |
---|
Comments | |
---|---|
(0000452)
BrianH 22-Feb-2009 23:28 |
I am personally in favor of keeping this change, as it makes CONSTRUCT more useful for data structure creation.
LOAD workaround in mezz-load 617. It might be a good idea to have the workaround behavior by default, and the no-workaround behavior with an /only option - that would be REBOL-like. Either that or add the workaround as a mezzanine. |
(0000478)
Carl 26-Feb-2009 00:25 |
It's a bug. CONSTRUCT exists mainly to load things like headers. If we want a lighter version that does not safe-reduce, we can add that as a refinement.
|
(0000481)
BrianH 26-Feb-2009 07:39 |
Well, since it's a bug I have to change the description accordingly:
Description updated (again) and more comprehensive examples added. |
(0000483)
BrianH 26-Feb-2009 23:05 |
Testing of 2.100.37 confirms that the bug is partially fixed: the keywords true, false, on, off and none are translated.
Still to do: yes and no keywords, lit-word! translation to word!, lit-path! translation to path!, unset! translation to none!, and the /only option to undo all of this. Of these the only urgent one is the unset! translation to none! - the rest are only high or normal priority. |
(0000501)
Carl 25-Mar-2009 04:05 |
All above should be fixed now.
Please move /only to a new ticket, so we can close the urgent part of this one. |
(0000503)
BrianH 25-Mar-2009 04:57 |
The /only option has been moved to #687. |
Date | User | Field | Action | Change |
---|---|---|---|---|
25-Mar-2009 05:34 | BrianH | Status | Modified | built => tested |
25-Mar-2009 05:34 | BrianH | Code | Modified | - |
25-Mar-2009 04:57 | BrianH | Comment : 0000503 | Added | - |
25-Mar-2009 04:56 | BrianH | Code | Modified | - |
25-Mar-2009 04:56 | BrianH | Description | Modified | - |
25-Mar-2009 04:15 | carl | Status | Modified | reviewed => built |
25-Mar-2009 04:15 | carl | Fixedin | Modified | => alpha 38 |
25-Mar-2009 04:05 | carl | Comment : 0000501 | Added | - |
26-Feb-2009 23:06 | BrianH | Code | Modified | - |
26-Feb-2009 23:05 | BrianH | Comment : 0000483 | Added | - |
26-Feb-2009 22:40 | BrianH | Comment : 0000481 | Modified | - |
26-Feb-2009 22:34 | BrianH | Status | Modified | built => reviewed |
26-Feb-2009 22:34 | BrianH | Fixedin | Modified | alpha 37 => none |
26-Feb-2009 22:34 | BrianH | Version | Modified | alpha 33 => alpha 36 |
26-Feb-2009 22:34 | BrianH | Code | Modified | - |
26-Feb-2009 07:39 | BrianH | Comment : 0000481 | Added | - |
26-Feb-2009 07:39 | BrianH | Description | Modified | - |
26-Feb-2009 07:36 | BrianH | Description | Modified | - |
26-Feb-2009 07:36 | BrianH | Type | Modified | Note => Bug |
26-Feb-2009 04:29 | carl | Type | Modified | Bug => Note |
26-Feb-2009 04:29 | carl | Status | Modified | reviewed => built |
26-Feb-2009 04:29 | carl | Fixedin | Modified | => alpha 37 |
26-Feb-2009 04:29 | carl | Description | Modified | - |
26-Feb-2009 02:31 | BrianH | Type | Modified | Note => Bug |
26-Feb-2009 02:31 | BrianH | Description | Modified | - |
26-Feb-2009 00:25 | carl | Priority | Modified | normal => urgent |
26-Feb-2009 00:25 | carl | Severity | Modified | minor => major |
26-Feb-2009 00:25 | carl | Comment : 0000478 | Added | - |
24-Feb-2009 07:35 | BrianH | Comment : 0000452 | Modified | - |
23-Feb-2009 20:03 | BrianH | Comment : 0000452 | Modified | - |
23-Feb-2009 06:04 | BrianH | Comment : 0000452 | Modified | - |
23-Feb-2009 00:26 | BrianH | Type | Modified | Issue => Note |
23-Feb-2009 00:25 | BrianH | Comment : 0000452 | Modified | - |
22-Feb-2009 23:28 | BrianH | Comment : 0000452 | Added | - |
22-Feb-2009 23:00 | BrianH | Status | Modified | submitted => reviewed |
22-Feb-2009 23:00 | BrianH | Code | Modified | - |
22-Feb-2009 23:00 | BrianH | Description | Modified | - |
22-Feb-2009 23:00 | BrianH | Ticket | Added | - |