CONSTRUCT doesn't special-case none, logic! keywords, lit-words or lit-paths like R2. #651
Labels
CC.resolved
Issue with CureCode status built, tested or complete
Datatype: object!
Status.important
Test.written
Type.bug
Submitted by: BrianH
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.
Imported from: CureCode [ Version: alpha 36 Type: Bug Platform: All Category: n/a Reproduce: Always Fixed-in:alpha 38 ]
Imported from: metaeducation#651
Comments:
Submitted by: BrianH
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.
Submitted by: Carl
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.
Submitted by: BrianH
Well, since it's a bug I have to change the description accordingly:
Description updated (again) and more comprehensive examples added.
Submitted by: BrianH
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.
Submitted by: Carl
All above should be fixed now.
Please move /only to a new ticket, so we can close the urgent part of this one.
Submitted by: BrianH
The /only option has been moved to #687.
The text was updated successfully, but these errors were encountered: