[REBOL] serializing? Re:
From: al:bri:xtra at: 14-Sep-2000 19:36
Rishi wrote:
> I've created an object in my source file. I would like to save this object
to a text file, and later, retrieve this object and use it.
> This is called serialization of an object. Is there an easy way to do this
in rebol?
REBOL/View 0.10.33.3.1 10-Sep-2000
Copyright 2000 REBOL Technologies. All rights reserved.
>> o: make object! [
[ f: func [x][print x]
[ m: 1234
[ ]
>> help save
USAGE:
SAVE where value /header header-data /bmp /png
DESCRIPTION:
Saves a value or a block to a file or url.
SAVE is a native value.
ARGUMENTS:
where -- Where to save it. (Type: file url)
value -- Value to save. (Type: any)
REFINEMENTS:
/header -- Save it with a header
header-data -- Header block or object (Type: block object)
/bmp -- Save in .BMP format
/png -- Save in .PNG format
>> save %test.dat o
>> print read %test.dat
make object! [
f: func [x][print x]
m: 1234
]
>> z: do load %test.dat
>> z/m
== 1234
>> z/f 456
456
>> z/f 456 + 3
459
>>
Andrew Martin
ICQ: 26227169
http://members.ncbi.com/AndrewMartin/
http://members.xoom.com/AndrewMartin/