diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-03-14 13:27:06 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-03-14 13:27:06 -0700 |
commit | 0592949de3e274b7d9700ec74466b541055c3bca (patch) | |
tree | 7782121888bf42e1719834cf23594b51bb3ce4a4 /hash.h | |
parent | 96f072cfdb5d1eac3e32dbdb15704b0a32258a37 (diff) | |
download | txr-0592949de3e274b7d9700ec74466b541055c3bca.tar.gz txr-0592949de3e274b7d9700ec74466b541055c3bca.tar.bz2 txr-0592949de3e274b7d9700ec74466b541055c3bca.zip |
Allow quasi-quoting over hash table literals,
to express dynamic hash table construction
* eval.c (expand_qquote): Recognize hash-construct
forms: expand the hash arguments and pairs separately,
then rewrite to a new hash-construct form.
(eval-init): hash-construct intrinsic function added.
* hash.c (hash_construct_s): New symbol variable.
(hash_construct): New function.
(hash_init): Initialize hash_construct_s.
* hash.h (hash_construct_s, hash_construct): Declared.
* parser.y (hash): Rule rewritten to emit either a literal
hash table object, or a hash-construct form, based on
whether quasiquote unquotes occur within the syntax.
(hash_from_notation): Function removed.
Diffstat (limited to 'hash.h')
-rw-r--r-- | hash.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -25,6 +25,7 @@ */ extern val weak_keys_k, weak_vals_k, equal_based_k; +extern val hash_construct_s; val make_hash(val weak_keys, val weak_vals, val equal_based); val *gethash_l(val hash, val key, val *new_p); @@ -44,6 +45,7 @@ val hash_next(val *iter); val hash_eql(val obj); val hash_equal(val obj); val hashv(val args); +val hash_construct(val hashv_args, val pairs); void hash_process_weak(void); |