Here's another version of %Associate.r that should cope with the tests that
Ladislav and Joel have thrown at it.
I haven't yet worked out how to fix Ladislav's concern yet:
> The other problem is, that your functions won't accept Any-type! values
for Key/Value
Comments and criticism gratefully
I'm probably going to get beaten up for this :), but if my question is
totally absurd, please excuse my ignorance...
You seem to put a lot of emphasis on being able to use block!s as keys. Is
this really necessary or desired?
It seems like an implementation would be easier and/or more efficient
I wrote:
> I don't like 'Encapsulate. Any one know of a better way to do it?
I blame the drugs I'm not taking...
Value: reduce [Value]
is a far better way of doing it.
[
Rebol [
Title: "Associate"
Name: 'Associate
File: %Associate.r
Author: "Andrew Martin"
Email:
Oh, shucks,
a bug:
>assoc-add: func [assoc [block!] candidates [block!] /local found] [
> if is-assoc? assoc [
>foreach [key value] candidates [
> either found: contains-key? assoc key [
>insert at assoc/values index? found value
The line
>insert at assoc/values index
Great stuff from both of you - I am thinking of changing my
INI file handling code to one of these methods (where I have
a hash of hashes so that a section value is really itself an
associative array).
But Elan, what do you mean when you say that there is a
problem with function code duplicatio
Silly me! Thanks for catching the oversight.
[EMAIL PROTECTED] wrote:
>
> - anyone want to make a /remove refinement ?
>
REBOL [
Title: "Minimal Associative Data Store"
File: %assoc.r
Date: 14-Sep-2000
Author:
I'm very impressed! This seems like it'll be really useful. Just wondering
how performance will be. :)
I still want something like this built into the language. Also, that way we
could use built ins like 'length? on it.
Hmm... this brings up another question. There's no way to do any kind of
ope