Error, bug or mis-use on my part?
[1/3] from: Karl:Lewin:BNSF at: 24-Sep-2003 11:04
(This may be unclear, if so please ask questions so I can clarify)
I am observing some "interesting" behavior using SAVE and LOAD
Using this sample code:
REBOL []
objA: make object! [
a: "blah blah"
item: [
make object! [
n:
make object! [
value?: "Letter N"
]
m:
make object! [
second-case: "howdy"
value?: "Letter M"
]
]
]
item: reduce item
]
And doing this:
>> do %file-where-the-above-is-saved
Script: "Untitled" (none)
>> save %objA.save objA
>> checksum mold objA
== 1710923
>>
Then in another session:
>> objA: do load %/c/proj/rss/myp/objA.save
>> checksum mold objA
== 12690384
>> save %objA2.save objA
>>
I would have expected the checksum's to be the same so I compare the two
files containing the saved objects and at first check, they come out the
same. When I check with whitespace being significant though there is a
difference.
Contents of %objA.save:
make object! [
a: "blah blah"
item: [
make object! [
n:
make object! [
value?: "Letter N"
]
m:
make object! [
second-case: "howdy"
value?: "Letter M"
]
]]
]
Contents of objA2.save (extra whitespace changed to X's):
make object! [
a: "blah blah"
item: [
make object! [
n:
make object! [
value?: "Letter N"
]X
m:
make object! [
second-case: "howdy"X
value?: "Letter M"
]
]]
]
This only seems to happen in a block of objects nested inside a containing
object and when a closing ] is followed by an alpha character or a closing "
is followed by an alpha character.
I'm not sure if this is a bug or if it is me trying to do something the hard
way when there is an easier way to get the same funcionality.
[2/3] from: ingo::2b1::de at: 24-Sep-2003 18:30
Hi Karl
Lewin, Karl E wrote:
> (This may be unclear, if so please ask questions so I can clarify)
>
> I am observing some "interesting" behavior using SAVE and LOAD
[text on different whitespaces in a molded object snipped]
To me this looks like a bug in mold, the following seems to work, though
(at least on your sample data and /Core 2.5.6.4.2 ).
>> checksum trim/lines mold objA
== 2341746
(I tried mold/flat first, but this gives inconsistent behaviour like
plain mold.)
Kind regards,
Ingo
[3/3] from: rotenca:telvia:it at: 25-Sep-2003 15:44
Hi,
> To me this looks like a bug in mold, the following seems to work, though
> (at least on your sample data and /Core 2.5.6.4.2 ).
>
> >> checksum trim/lines mold objA
> == 2341746
A simple trim makes the same job.
> (I tried mold/flat first, but this gives inconsistent behaviour like
> plain mold.)
Mold/all has not this side effect:
>> x: load mold/all obja
>> checksum mold/all x
== 10116687
>> checksum mold/all obja
== 10116687
---
Ciao
Romano