diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-09-16 13:40:13 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-09-16 13:40:13 -0700 |
commit | 26c497d7da95a7d3f38bfcf7868ab65378f88007 (patch) | |
tree | acf59590b4ca25e4231ec9a3817409aa90fe36cf /eval.c | |
parent | 14e48e6f78988bc323908df944fe0a534a38629d (diff) | |
download | txr-26c497d7da95a7d3f38bfcf7868ab65378f88007.tar.gz txr-26c497d7da95a7d3f38bfcf7868ab65378f88007.tar.bz2 txr-26c497d7da95a7d3f38bfcf7868ab65378f88007.zip |
Starting work on adding bit operations. The semantics is that
negative integers behave as an "infinite bit two's complement".
* arith.c (logand, logor, logxor): New functions.
* eval.c (eval_init): New intrinsic functions logand, logior, logxor.
* lib.h (logand, logor, logxor): Declared.
* mpi-patches/series: New patch, add-bitops.
* mpi-patches/add-bitops: New file.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2231,6 +2231,9 @@ void eval_init(void) reg_fun(intern(lit("/="), user_package), func_n0v(numneqv)); reg_fun(intern(lit("max"), user_package), func_n1v(maxv)); reg_fun(intern(lit("min"), user_package), func_n1v(minv)); + reg_fun(intern(lit("logand"), user_package), func_n2(logand)); + reg_fun(intern(lit("logior"), user_package), func_n2(logior)); + reg_fun(intern(lit("logxor"), user_package), func_n2(logxor)); reg_fun(intern(lit("regex-compile"), user_package), func_n1(regex_compile)); reg_fun(intern(lit("regexp"), user_package), func_n1(regexp)); |