Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: How to save objects in a file ?

From: etienne:alaurent:free at: 21-Aug-2001 15:27

Hi Brett and Christophe Christophe wrote :
>Depending of what you're intending to do, pick one of the two methods: > >1. save %object-file.r my-object >2. write %object-file.r mold my-object > >The advantage of the second method is that you can use the multiple >refinements of the _write_ function as in: > >write/append %object-file.r mold my-object
and Brett wrote :
>How about something like this: > >o1: context [description: "i am an object" date: now/date] >o2: context [description: "i am an object too" date: now/date] >objects: reduce [o1 o2] >save %objects.r objects >loaded-objects: reduce load %objects.r >print loaded-objects/1/description
It doesn't run ! My code is like this : =============================== obj1: make object! [ data1: copy "string 1" data2: copy "string 2" ] obj2: make object! [ data3: copy "string 3" data4: copy [] ] obj3: make obj1 [] obj4: make obj1 [] append tail obj2/data4 "object3" append tail obj2/data4 obj3 append tail obj2/data4 "object4" append tail obj2/data4 obj3 save %objects.r obj2 ================================= and at the time of the save execution, the app is frozen. Why ? what is the solution ? Cheers --- Etienne