REBOL3 tracker
  0.9.12 beta
Ticket #0002233 User: anonymous


Previous Next
Short URL:
TypeIssue Statussubmitted Date31-Jul-2015 05:36
Versionr3 master CategoryEvaluation Submitted byfork
PlatformAll Severitymajor Prioritynormal

Summary LIT-PATH! evaluation changes type but reuses series data
Description Consider the following:

>> code: [path: 'foo/bar]
== [path: 'foo/bar]

>> result: do code
== foo/bar

>> same? result second code
== false

>> append result 'baz
== foo/bar/baz

>> code
== [path: 'foo/bar/baz]

Something unsettling is that you now have a single series "backing store" of data being aliased as two different types. In one place, that data is a LIT-PATH!, and in another place that data is a PATH!. Modifying one modifies the other. Yet they are not the "same".

While there's currently nothing mechanically preventing the aliasing of series data as more than one value type, it seems unsound to me, and should likely be prohibited. When the evaluator processes an ANY-BLOCK! that is lit-quoted to produce an unquoted value, it probably needs to COPY/DEEP it (which copy-on-write semantics might be able to mitigate the cost of).
Example code


Assigned ton/a Fixed in- Last Update31-Jul-2015 05:37


Date User Field Action Change
31-Jul-2015 05:37 Fork Description Modified -
31-Jul-2015 05:36 Fork Ticket Added -