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

[REBOL] Re: choice of representation - was paths & lookups & change

From: maximo:meteorstudios at: 24-Oct-2003 9:32

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.