Script Library: 1238 scripts
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

Discussion posts for script associate.r

3-Jan-2005 21:25
Silly question. Does this create something similar to an associative array (or 'hash' as the Perl world calls them)?
3-Jan-2005 22:55

I think so. Here's some tricks with associate -- decide for yourself :-)

myAA: copy [] ;; start a new associative array

associate myAA 'today now

associate myAA 'myname 'Sunanda

associate myAA 'my age 21 ;; It was once. Then again later in hex.....

associate myAA 1-jan-2000 {new millennium}

associate myAA 15 [4 5 6] [1 2 3 4 5] ;; ways to sum 15 as consecutive integers

;; read some of them back:

associate? myAA 15

== [4 5 6] [1 2 3 4 5]

associate? myAA 'today

== 3-Jan-2005/22:17:39 ;; well, it was when I did it -- it's a static value

;; let's get a date that really does update itself:

associate myAA 'today [(now)]

compose associate? myAA 'today

;; result will change each time

;; being just a rebol block, I can write it to a file, and reload it later

write %myAA-file mold myAA

myAA: none ;; to prove it's gone

myAA: load %myAA-file

associate? myAA 15

== [4 5 6] [1 2 3 4 5] ;; same values as before

I could add the whole thing to another associate array

my-other-AA: copy []

associate my-other-AA 'AA1 myAA

;; I could even add it to itself:

associate myAA 'myAA myAA

24-May 3:56

Neve encountered this before, but it seems good already.


Placerville Dentistry

MakeDoc2 by REBOL- 24-May-2021
30-Aug 5:35

South Korea has opened a new programming club at Soongsil University. Only a few students are allowed to attend the lectures of the famous US and UK professors who do these cheap writings an associate degree.

20-Nov 20:29

Great Post. Love it. landscaping in fresno


MakeDoc2 by REBOL- 20-Nov-2021