mirror of
https://github.com/kanaka/mal.git
synced 2024-09-21 10:37:58 +03:00
22 lines
524 B
PostScript
22 lines
524 B
PostScript
% [ ps_val1...] -> ps2mal -> [ mal_val1...]
|
|
/ps2mal {
|
|
% convert returned values to Mal types
|
|
[ exch
|
|
{ %forall returned values
|
|
dup ==
|
|
dup type /arraytype eq {
|
|
(here1\n) print
|
|
_list_from_array
|
|
}{ dup type /dicttype eq {
|
|
(here2\n) print
|
|
_hash_map_from_dict
|
|
}{
|
|
(here3\n) print
|
|
% no-op
|
|
} ifelse } ifelse
|
|
} forall
|
|
]
|
|
(here4\n) print
|
|
} def
|
|
|