It's official now: you CAN use lists (and records?... and even tables?) as
table keys!
Although there seems to be a catch:
#global Table #### GLOBAL or LOCAL doesn't matter!
procedure main()
local l1,l3,l4,l5,l6,k,Table
l1:=["test","test-1"]
l3:=copy(l1);l4:=copy(l1);l5:=copy(l1);l6:=copy(l1)
Table:=&null; Table:=table(); k:=&null
#------------------------------------------
Table[["test","test-1"]]:=22; write(*Table)
Table[["test","test-1"]]:=33; write(*Table)
Table[["test","test-1"]]:=44; write(*Table)
Table[["test","test-1"]]:=55; write(*Table)
every (k:=key(Table),write(Table[k]))
#------------------------------------------
write()
Table:=&null; Table:=table(); k:=&null
Table[l3]:=66; write(*Table)
Table[l4]:=77; write(*Table)
Table[l5]:=88; write(*Table)
Table[l6]:=99; write(*Table)
every (k:=key(Table),write(Table[k]))
#=========================================OK (expected behavior)
write()
Table:=&null; Table:=table(); k:=&null
Table[l1]:=6; write(*Table)
Table[l1]:=7; write(*Table)
Table[l1]:=8; write(*Table)
Table[l1]:=9; write(*Table)
every (k:=key(Table),write(Table[k]))
write("OK-OK-OK!")
#=========================================OK (expected behavior)
end
## Bob ##
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group