langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
|
|
@ -0,0 +1,22 @@
|
|||
;;; Create expandable hash table of initial size 50 and with default
|
||||
;;; value 0 (default value is returned when the item is absent).
|
||||
vars ht = newmapping([], 50, 0, true);
|
||||
;;; Set value corresponding to string 'foo'
|
||||
12 -> ht('foo');
|
||||
;;; print it
|
||||
ht('foo') =>
|
||||
;;; Set value corresponding to vector {1 2 3}
|
||||
17 -> ht({1 2 3});
|
||||
;;; print it
|
||||
ht({1 2 3}) =>
|
||||
;;; Set value corresponding to number 42 to vector {0 1}
|
||||
{0 1} -> ht(42);
|
||||
;;; print it
|
||||
ht(42) =>
|
||||
|
||||
;;; Iterate over keys printing keys and values.
|
||||
appproperty(ht,
|
||||
procedure (key, value);
|
||||
printf(value, '%p\t');
|
||||
printf(key, '%p\n');
|
||||
endprocedure);
|
||||
Loading…
Add table
Add a link
Reference in a new issue