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

[REBOL] Essay on Associative Data Stores Re:(3)

From: ole_f:post3:tele:dk at: 20-Sep-2000 14:32

Hi Joel, 19-Sep-2000 you wrote: [...]
>I'll wait to respond with specifics until I've had a chance to look >them over adequately. I'm curious about the motivations (and >the performance) of your compromise solution -- part object, part >function library. >Would I be correct in guessing that you chose to make associate-ads >and lookup-ads standalone functions instead of object methods to >avoid the duplication which REBOL (currently -- hint, hint, hint) >imposes on objects?
You can get rid of the duplication by doing a super-object containing the functions, then cloning this object for all your "real objects". So no, that wasn't the case. The reason was laziness ;-) 1: I needed to encapsulate the two different lists into something, and I chose an object. Could've used a list with the two lists as the only elements, but I just didn't. 2: When I tested my code, I just wanted to be able to 'do the source file and then directly use the functions on my existing object. If I had put the functions inside the object, then i would have to create a new object in order to use the new functions. This is the laziness part. So, there wasn't any clever reason. And anyway, I just wrote it to show how to do the thing relatively elegant by separating the keys and the values into two separate lists, instead of the approach everybody else uses by cramming everything into a single list. Anyway, it can be done a lot nicer than I have done. Kind regards, -- Ole Friis <[ole_f--post3--tele--dk]> Amiga is a trademark of Amiga Inc.