Type | Issue | Status | deferred | Date | 29-Mar-2010 23:38 |
---|---|---|---|---|---|
Version | alpha 97 | Category | Datatype | Submitted by | Ladislav |
Platform | All | Severity | minor | Priority | normal |
Summary | Contexts with "explicit" 'self field are not LOAD MOLD/ALL able or DO MOLD able |
---|---|
Description |
Contexts containing an "explicit" 'self field are formatted by MOLD/ALL into syntax that is not accepted by LOAD, or by MOLD into code that DO does not execute without error. This is a distinctive property, since contexts with an "implicit" 'self field are formatted by MOLD/ALL into syntax that *is* accepted by LOAD, as well as formatted by MOLD into code, executable by DO. |
Example code |
>> for self 1 1 1 [o: bind? 'self] == make object! [ self: 1 ] >> load mold/all o ** Script error: cannot set self - it is protected ** Where: transcode either if load ** Near: transcode/only data unless case [ :val = [rebol] [ ... >> do mold o ** Script error: cannot set self - it is protected ** Where: make catch either applier do ** Near: make object! [ self: 1 ] |
Assigned to | n/a | Fixed in | - | Last Update | 6-May-2010 08:55 |
---|
Comments | |
---|---|
(0002150)
BrianH 30-Mar-2010 02:03 |
There's more: All contexts with hidden fields are not LOAD/MOLDable. And most contexts aren't restored properly by LOAD from MOLD/all syntax: The bindings aren't restored properly unless you use DO, nor are circular references. The same goes for closures, functions and modules.
I guess the lesson here is that some datatypes in REBOL can only be properly created with code execution (DO). It is always possible to make data that can't be specified declaratively using MOLD/all syntax. |
(0002152)
Ladislav 30-Mar-2010 02:35 |
Contexts with hidden fields *are* LOAD/MOLDable, try it. I can only admit, that the result may not be what you want, but that does not bother me in this case. |
(0002154)
BrianH 30-Mar-2010 03:02 |
Well, the same can be said for the 'self restriction (except for the bothering you part, of course). MOLD/all of an object! does not generate something that is still usable after it's loaded, much of the time. It's a known gotcha in REBOL.
Nonetheless, modified the summary and description to focus on the specific implications of the additional restrictions on 'self as compared to other hidden fields. |
(0002250)
Carl 27-Apr-2010 06:21 |
http://www.rebol.net/r3blogs/0312.html discusses it.
We must decide quite soon. |
(0002332)
BrianH 6-May-2010 08:55 |
Deferred until we get object specs - otherwise there's no way to specify syntax for this. |
Date | User | Field | Action | Change |
---|---|---|---|---|
6-May-2010 08:55 | BrianH | Status | Modified | reviewed => deferred |
6-May-2010 08:55 | BrianH | Comment : 0002332 | Added | - |
27-Apr-2010 06:21 | carl | Comment : 0002250 | Added | - |
30-Mar-2010 10:47 | Ladislav | Description | Modified | - |
30-Mar-2010 10:37 | Ladislav | Description | Modified | - |
30-Mar-2010 10:36 | Ladislav | Code | Modified | - |
30-Mar-2010 10:33 | Ladislav | Description | Modified | - |
30-Mar-2010 10:33 | Ladislav | Summary | Modified | Contexts with overriden 'self are not LOADable from MOLD/all syntax => Contexts with "explicit" 'self field are not LOAD MOLD/ALL able or DO MOLD able |
30-Mar-2010 03:25 | BrianH | Description | Modified | - |
30-Mar-2010 03:23 | BrianH | Summary | Modified | Contexts with overriden 'self are not LOADable from MOLD or MOLD/all syntax => Contexts with overriden 'self are not LOADable from MOLD/all syntax |
30-Mar-2010 03:22 | BrianH | Comment : 0002154 | Modified | - |
30-Mar-2010 03:21 | BrianH | Status | Modified | submitted => reviewed |
30-Mar-2010 03:21 | BrianH | Type | Modified | Bug => Issue |
30-Mar-2010 03:21 | BrianH | Severity | Modified | major => minor |
30-Mar-2010 03:21 | BrianH | Category | Modified | Unspecified => Datatype |
30-Mar-2010 03:21 | BrianH | Description | Modified | - |
30-Mar-2010 03:21 | BrianH | Summary | Modified | Some contexts are not LOAD/MOLDable => Contexts with overriden 'self are not LOADable from MOLD or MOLD/all syntax |
30-Mar-2010 03:02 | BrianH | Comment : 0002154 | Added | - |
30-Mar-2010 02:44 | Ladislav | Comment : 0002152 | Modified | - |
30-Mar-2010 02:41 | Ladislav | Comment : 0002152 | Modified | - |
30-Mar-2010 02:37 | Ladislav | Comment : 0002152 | Modified | - |
30-Mar-2010 02:35 | Ladislav | Comment : 0002152 | Added | - |
30-Mar-2010 02:03 | BrianH | Comment : 0002150 | Added | - |
29-Mar-2010 23:39 | Ladislav | Severity | Modified | minor => major |
29-Mar-2010 23:39 | Ladislav | Code | Modified | - |
29-Mar-2010 23:38 | Ladislav | Ticket | Added | - |