i use this:
change-or-append: func [series key value /local found-here] [
either found-here: find series :key [change/only next found-here :value]
[append/only series :key append/only series :value]]
or that
now-known: func [ series key ] [
if not find series :key [ append/only series :k
Hi, just wondering what happened to associative arrays. I understand that
REBOL's blocks and hashes are powerful, but there's still no easy way as far
as I know to just say (like you can in Perl, for instance) $blah{'value'} =
"supercalifragilisticexpialidocious", and get the value by just saying
t;Apple" "Red"
>> col/set-item "App" "Office"
>> col/get-item "App"
== "Office"
>> col/get-item "Apple"
== "Red"
>> col/get-item 1
== "Red"
>> col/get-item 2
== "Office"
In article <[EMAIL PROTECTED]>, you wrote:
>I think select and paths should come close to what you're asking:
>>> select [ a "this is a" b "this is b" ] 'a
>== "this is a"
I'll have to ponder that for a while but my first thought
is that doing it that way would make it difficult to
populate it f
I think select and paths should come close to what you're asking:
for instance:
>> select [ a "this is a" b "this is b" ] 'a
== "this is a"
>> select [ a "this is a" b "this is b" ] 'b
== "this is b"
>> block: [ a "this is a" b "this is b" ]
== [a "this is a" b "this is b"]
>> block/a
== "this i
Is there any way to simulate Associative Arrays in Rebol?
The type where the index could be a list of random words
like in the language Awk?
Hi Keith, you wrote:
>Am I right in thinking that the only two ways to simulate associative arrays
>as they exist in languages such as Perl and Python are by
>
>1. Making an object and using it's fields for what would be the indexes
>2. Using the select keyword on a block, like so:
>
>data: ["key1
Am I right in thinking that the only two ways to simulate associative arrays
as they exist in languages such as Perl and Python are by
1. Making an object and using it's fields for what would be the indexes
2. Using the select keyword on a block, like so:
data: ["key1" value1 "key2" value2 "key3