summaryrefslogtreecommitdiffstats
path: root/place.tl
Commit message (Collapse)AuthorAgeFilesLines
* Adding pushnew.Kaz Kylheku2015-05-221-0/+12
| | | | | | * place.tl (pushnew): New macro. * lisplib.c (set_place_dlt_entries): Add pushnew.
* symbol-function, symbol-value and fun become places.Kaz Kylheku2015-05-221-0/+47
| | | | | | | | | * eval.c (op_setqf): New function. (eval_init): Register sys:setqf operator. Also expose global variable hash tables via sys:top-vb and sys:top-fb. * place.tl (sys:get-fb, sys:get-vb): New functions. (fun, symbol-function, symbol-value): New places defined.
* Variables are now deletable places, if they are global.Kaz Kylheku2015-05-151-4/+16
| | | | | | * place.tl (sys:sym-delete-expander): New function. (get-delete-expander): Retrieve delete expander for symbols.
* * place.tl (define-modify-macro): New macro.Kaz Kylheku2015-05-131-1/+9
| | | | * lisplib.c (set_place_dlt_entries): Add define-modify-macro.
* * place.tl (push): Ensure left-to-right eval order.Kaz Kylheku2015-05-131-2/+4
|
* * place.tl (rlet): For the sake of sane evaluation orderKaz Kylheku2015-05-121-2/+2
| | | | | in the face of unknown side effects, do not thread symbolic references; only propagate constants.
* DWIM places must use Lisp-1 semantics.Kaz Kylheku2015-05-121-48/+81
| | | | | | | | | | | | | | | | | | | | This really only affects code which does something like (set [f x] y) and f resolves as a function. (The TXR Program bent over backwards to install a mutable object into a function binding.) In this situation, we need to update the function binding f, rather than some variable f. * eval.c (op_lisp1_setq, op_lisp1_value): New static functions. (eval_init): Register sys:lisp1-setq and sys:lisp1-value special forms. * place.tl (sys:*lisp1*): New special variable. (sys:sym-place-update-expander, sys:sym-place-clobber-expander): React to sys:*lisp1* variable by doing symbol access using Lisp-1 semantics, with help of newly introduced special forms. (dwim): Bind sys:*lisp1* to true, if main argument is a symbolic place, so that the update is done using Lisp-1 semantics. Use the sys:lisp1-value operator when evaluating arguments.
* Adding pset operator.Kaz Kylheku2015-05-091-0/+20
| | | | | | * place.tl (pset): New macro. * lisplib.c (set_place_dlt_entries): Add pset.
* * place.tl (set): Take multiple place/value pairs. Allow zeroKaz Kylheku2015-05-091-3/+10
| | | | arguments.
* single-body-form-fixupKaz Kylheku2015-05-261-48/+48
|
* New macro-based framework for assignment places.Kaz Kylheku2015-05-061-0/+416
The operators set, inc, dec, pop and others are now macros which generate code, rather than built-in special forms that use "C magic". Moreover, new such macros are easy to write, and several new ones are already available. Moreover, new kinds of assignable places are easy to create. * place.tl: New file. * lisplib.c, lisplib.h: New files. * Makefile (OBJS): New target, lisplib.o. (GEN_HDRS): New variable. (LISP_TO_C_STRING): New recipe macro, with rule. (clean): Remove generated headers named in $(GEN_HDRS). * eval.c (dec_s, push_s, pop_s, flip_s, del_s): Variables removed. (setq_s): New variable. (lookup_var, lokup_sym_lisp_1, lookup_var_l, lookup_fun, lookup_mac, lookup_symac, lookup_symac_lisp1): Trigger the delayed loading of libraries for undefined global symbols, and re-try the lookup. (op_modplace, dwim_loc, force_l): Static functions removed. (op_setq): New static function. (eval_init): Initialize setq_s; remove initializations of removed variables; remove registrations for op_modplace; add registration for sys:setq, sys:rplaca, sys:rplacd, sys:dwim-set and sys:dwim-del intrinsics. Call lisplib_init to initialize the dynamic library loading module. * lib.c (sys_rplaca, sys_rplacd): New functions, differing in return value from rplaca and rplacd. (ref, refset): Handle hash table. (dwim_set, dwim_del): New functions. * lib.h (sys_rplaca, sys_rplacd, dwim_set, dwim_del): Declared. * genvim.txr: Include place.tl in scan. * tests/010/seq.txr: The del operator test case no longer throws at run-time but at macro-expansion time, so the test case is simply removed. * tests/010/seq.expected: Updated output. * tests/011/macros-2.txr: Reset *gensym-counter* to zero, because the textual output of the test case includes gensyms, whose numberings fluctuate with the content of the new Lisp library material. * tests/011/macros-2.expected: Updated output.