It creates an array with about 4 million cells. On my PC (address "newlisp") returns 4054840 which is the address of the string "newlisp" in memory, taken by the 'array' statement as a number. In my case it took about 2 seconds to create the array but then spends a lot of time displaying 4 miliion 'nil' and the Tcl/Tk text box or your command shell may eventually freeze on Windows (mostly be fine on Linux).
'address' is used when manipulating memory directly. It always returns the address of an item in memory, i.e. the address of a string or a number or float:
Code: Select all
(set 'str "newLISP")
(set 'int-num 12345)
(set 'float-num 1.234)
(get-string (address str)) => "newLISP"
(get-int (address int-num)) = 12345
(get-float (address float-num)) = "1.234
You use all of the above frequently when writing interfaces to 'C' libraries. There is also a 'cpymem' which copies memory between two addresses.
As you say: "don't try this at home kids", it is only for grown up newLISP users and people not scared of segfaults, bus errors etc., ;)
Lutz