I often use objects and store them on disk as code using mold. With rebol writing text files is so easy.
but for larger data, I usually then go with blocks. using switch like so: data: [name ["snoopy"] age [30] race ["beagle"]] name: switch 'name data == "snoopy" I know many use blocks of the type: data: [[value data] [value data]] but then access time is much slower, as you have to scan the whole list in your code instead of letting fast 'switch or 'select functions take care of it. why use switch rather than select? I can use code when I need it, directly in my values. default-value: "n/a" data: [name [default-value] age [30] race ["beagle"]] name: switch 'name data == "n/a" also, the fact that values are within blocks makes the use of words as data possible. -MAx --- "You can either be part of the problem or part of the solution, but in the end, being part of the problem is much more fun." > -----Original Message----- > From: Brett Handley [mailto:[EMAIL PROTECTED] > Sent: Friday, October 24, 2003 3:43 AM > To: [EMAIL PROTECTED] > Subject: [REBOL] choice of representation - was paths & > lookups & change > > > > From Elan: > > > My preference for this kind of tasks is using objects. Even > though it is > > a little more verbose, I find it quite intuitive to use the > get and set > > functions, as in: > > Choice of an "information model" and representation is something I've > struggled/ruminated over for a while. I guess I am spoilt for choice. > > For some applications I think a distinction can be made for > informational/database representations depending whether they are > out-of-process in a serialised form (on disk / on the wire) > or in-process in > a tree or other structure suitable for fast evaluations. I > habitually try > to find a single REBOL representation that solves both needs > well, but after > I while I wonder whether I should really be considering multiple > representations of the same information for different needs. > > My latest feeling (I certainly have no firm conclusions) is > that when I need > the information stored on disk, a straight loadable block > format (complex > dialect or simple sequence) is better for saving in a textual > form. Where I > need a representation to faciliate in-process evaluations or I need to > affect the evaluation itself (e.g bind), objects can be a > good candidate. > Bridging the two, if necessary, a dialect. > > As I said, no firm conclusions, just more ruminations. I'm > interested to > know what other people think about their preference of > representation (e.g > Robert's preference for blocks, Elan's for objects) when you > consider the > in-process / out-of-process distinction. Or do people feel that the > distinction itself is not useful? > > I'm sort of assuming here that we're discussing a REBOL only > storage and > processing application. Another interesting line of > discussion would be on > useful REBOL idioms when programming a REBOL app to talk SQL. > > Regards, > Brett > > -- > To unsubscribe from this list, just send an email to > [EMAIL PROTECTED] with unsubscribe as the subject. > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
