summaryrefslogtreecommitdiffstats
path: root/share
Commit message (Collapse)AuthorAgeFilesLines
* Version 115.txr-115Kaz Kylheku2015-09-101-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Bugfix: multiple evaluation problem in slot place.Kaz Kylheku2015-09-091-4/+5
| | | | | | * share/txr/stdlib/place.tl (defplace slot): The slot argument must be evaluated only once, a gensym is established for it, just like for the object form.
* Fix fun, symbol-function and symbol-value places.Kaz Kylheku2015-09-091-5/+5
| | | | | | | * share/txr/stdlib/place.tl (defplace fun, defplace symbol-function, defplace symbol-value): Fix incorrect splicing substitution of body into the output.
* Version 114.txr-114Kaz Kylheku2015-09-021-1/+1
| | | | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * genvim.txr: Scan struct.c, path-test.tl and struct.tl files. * txr.vim, tl.vim: Regenerated.
* Move stat functions to use a struct.Kaz Kylheku2015-08-301-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib.c (init): Move hash_init and struct init before sysif_init. * share/txr/stdlib/path-test.tl (sys:path-test-mode, path-mine-p, path-my-group-p, sys:path-access, path-newer, path-examine): Convert to struct return of stat functions. * stream.c (dev_k, ino_k, mode_k, nlink_k, uid_k, gid_k, rdev_k, size_k, blksize_k, blocks_k, atime_k, mtime_k, ctime_k): Global variable definitions removed from here. (stream_init): Initializations of moved global variables removed from here. * stream.h (dev_k, ino_k, mode_k, nlink_k, uid_k, gid_k, rdev_k, size_k, blksize_k, blocks_k, atime_k, mtime_k, ctime_k): Declarations removed from here. * sysif.c (stat_s, dev_s, ino_s, mode_s, nlink_s, uid_s, gid_s, rdev_s, size_s, blksize_s, blocks_s, atime_s, mtime_s, ctime_s): New global variables. (dev_k, ino_k, mode_k, nlink_k, uid_k, gid_k, rdev_k, size_k, blksize_k, blocks_k, atime_k, mtime_k, ctime_k): Existing variables moved here. (stat_to_struct): New static function. (stat_impl): Use stat_to_struct, except under 113 compatibility. (sysif_init): Initialize new symbol variables. Make stat struct type. * sysif.h (stat_s, dev_s, ino_s, mode_s, nlink_s, uid_s, gid_s, rdev_s, size_s, blksize_s, blocks_s, atime_s, mtime_s, ctime_s): Declared.
* Introducing structs.Kaz Kylheku2015-09-022-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * args.c (args_cat_zap): New function. * args.h: (args_cat_zap): Declared. * eval.c (struct_lit_s): New symbol variable. (eval_init): Initialize struct_lit_s. * eval.h (struct_lit_s): Declared. * gc.c (finalize): If a symbol has a struct slot hash attached to it, we must free it when the symbol is reclaimed. * lib.c (make_sym): Initialize symbol's slot_cache pointer to null. (copy): Copy structure objects. (init): Call struct_init to initialize struct module. * lib.h (SLOT_CACHE_SIZE): New preprocessor symbol (slot_cache_line_t, slot_cache_t): New typedefs. (struct sym): New member, slot_cache. * lisplib.c (struct_set_entries, struct_instantiate): New static functions. (liplib_init): Register new functions in dl_table. parser.y (HASH_S): New terminal symbol. (struct): New grammar rule. (n_expr): Derive struct. (yybadtoken): Map HASH_S to #S string. parser.l (grammar): Recognize #S and return HASH_S token. share/txr/stdlib/place.tl (slot): New defplace. share/txr/stdlib/struct.tl: New file. struct.c: New file. struct.h: New file. * Makefile (OBJS): Adding struct.o.
* Version 113.txr-113Kaz Kylheku2015-08-141-1/+1
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.
* Version 112.txr-112Kaz Kylheku2015-08-141-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * tl.vim, txr.vim: Regenerated.
* Diagnose bad consing dot syntax like (a . b . c).Kaz Kylheku2015-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | * parser.y (r_exprs): Use unique object in the terminating cons to indicate the empty spot where the dotted cdr item will go. Check for misplaced consing dot. (misplaced_consing_dot_check): New static function. Checks for the terminator atom spot being taken already. Thus, the spot may be taken only by the very last reduction, such that the next reduction is r_exprs -> n_exprs where the terminating atom is processed. * parser.c (unique_s): New global variable. (parse_init): Initialize unique_s. * parser.h (unique_s): Declared. * share/txr/stdlib/place.tl (sys:placelet-1): We have a misplaced consing dot here! It was working correctly by "terminating atom propagation" behavior, which allowed (a . b c d) to produce (a c d . b). If a single terminating atom occurred in the middle of a list, it was promoted to the end.
* Version 111.txr-111Kaz Kylheku2015-08-081-1/+1
|
* New filesystem object testing functions.Kaz Kylheku2015-08-051-0/+98
| | | | | | | | | | * lisplib.c (path_test_set_entries, path_test_instantiate): New static functions. (dlt_register): Registered new functions to dl_table. * txr.1: Documented new functions. * share/txr/stdlib/path-test.tl: New file.
* Switching some globals to lexical and changing some names.Kaz Kylheku2015-08-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * arith.c (arith-init): Changing *flo-...* from special to lexical, and adding un-earmuffed variants. The earmuffed versions are obsolescent. Adding %pi% and %e% global lexicals. Earmuffed versions are also made global lexical, and obsolescent. * eval.c (lookup_global_var, lookup_global_var_l): New functions. (lookup_var): Uses lookup_global_var. (reg_varl): New function. (reg_var): Uses reg_var. (eval_init): Register global lexicals user-package, system-package and keyword-package. Old symbols with earmuffs are obsoleted, and also turned into global lexicals. (top-vb, top-fb): Changed to lexical. * eval.h (lookup_global_var, lookup_global_var_l, reg_varl): Declared. * genvim.txr: Scan ver.tl so that the lib-version variable is included. Extract reg_varl calls. * glob.c (glob_init): glob-err and other variables made lexical. * lib.c (get_user_package, get_system_package, get_keyword_package): Use lookup_global_var_l to avoid searching dynamic scope for lexicals which cannot be dynamically rebound. * share/txr/stdlib/ver.tl (lib-version): New global lexical variable. (*lib-version*): Turned lexical. Obsolescent. * signal.c (sig-init): sig-* variables turned lexical. * sysif.c (sysif-init): s-*, poll-* and w-* variables turned lexical. * syslog.c (syslog-init): log-* variables turned lexical. * txr.c (sysroot-init): stdlib and *txr-version* variables turned lexical. txr-version variable added, and *txr-version* is obsolescent. (txr-main): self-path variable added. *self-path* turns lexical and is obsolescent. * txr.1: Documentation updated. Lexical variables not referred to as special. Special variables referred to as special.
* * share/txr/stdlib/txr-case.tl (txr-case-impl): Bugfix,Kaz Kylheku2015-07-281-0/+1
| | | | handle nil case in recursion.
* Version 110.txr-110Kaz Kylheku2015-07-251-1/+1
|
* Bugfix: place-form-p must expand place macros.Kaz Kylheku2015-07-242-7/+7
| | | | | | | | | * share/txr/stdlib/place.tl (place-form-p): Take environment parameter. Expand the place form using sys:pl-expand. * share/txr/stdlib/ifa.tl (ifa): Pass environment to place-form-p. (nthcdr): Pass environment down to place-form-p.
* Adding with-resources macro.Kaz Kylheku2015-07-231-0/+17
| | | | | | | | | | * share/txr/stdlib/with-resources.tl: New file. * lisplib.c (with_resource_set_entries, with_resources_instantiate): New static functions. (lisplib_init): Register new functions under dlt_register. * txr.1: Document with-resources.
* Adding nthcdr as accessor.Kaz Kylheku2015-07-221-0/+20
| | | | | | | | | | | | * eval.c (eval_init): Register nthcdr function. * lib.c (nthcdr): New function. * lib.h (nthcdr): Declared. * share/txr/stdlib/place.tl (nthcdr): New defplace. * txr.1: Documented.
* Improve bad argument diagnosis for place macros.Kaz Kylheku2015-07-221-2/+5
| | | | | | | | | | * eval.c (op_mac_param_bind): New static function. (eval_init): Register mac-param-bind operator. * share/txr/stdlib/place.tl (define-place-macro): Use mac-param-bind inside a lambda instead of tb macro. * txr.1: Document mac-param-bind.
* Implementing second through tenth as places.Kaz Kylheku2015-07-221-0/+9
| | | | | | | | | | | | | | | | | | * eval.c (eval_init): Register second through tenth as intrinsic. * gencadr.txr: New cadr.c changes encoded. * lib.c (second, third, fourth, fifth, sixth): Functions reimplemented using ref, so they are much more efficient for vectors and strings. (seventh, eighth, ninth, tenth): New functions. * lib.h (seventh, eighth, ninth, tenth): Declared. * share/txr/stdlib/place.tl: place macros defined for second through tenth. * txr.1: Documented.
* * lisplib.c (place_set_entries): Add *place-macro* andKaz Kylheku2015-07-221-11/+24
| | | | | | | | | | | | | | define-place-macro to list of names. * share/txr/stdlib/place.tl (*place-macro*): New global hash. (sys:tigger-load, sys:pl-expand): New functions. (call-update-expander, call-clobber-expander, call-delete-expander): Recognize and expand place macros. (define-place-macro): New macro. (first, rest): Places redefined using define-place-macro, replacing the old hack of copying the expanders from one table entry to another. * txr.1: Documented place macros.
* * share/txr/stdlib/place.tl: Indentation.Kaz Kylheku2015-07-221-20/+20
|
* Implementing caar, cadr, cdar and friends.Kaz Kylheku2015-07-211-0/+1104
| | | | | | | | | | | | | | | | | | | | * lib.c (init): Call cadr_init. * lisplib.c (dl_table, set_dlt_entries, dlt_register): Externalize. * lisplib.h (dl_table, set_dlt_entries, dlt_register): Declared. * Makefile (OBJS): Add cadr.o. * cadr.c: New file. * cadr.h: New file. * gencadr.txr: New file. * share/txr/stdlib/cadr.tl: New file. * txr.1: Document cadr accessors.
* * share/txr/stdlib/place.tl (defplace cdr): Change deletionKaz Kylheku2015-07-211-1/+5
| | | | | | semantics so that (del (cdr x)) is symmetric with (del (car x)). * txr.1: Update documentation.
* * share/txr/stdlib/ifa.tl (ifa): Use placelet toKaz Kylheku2015-07-121-4/+15
| | | | allow "it" to be mutable when it denotes a place form.
* * share/txr/stdlib/place.tl (place-form-p): New function.Kaz Kylheku2015-07-121-0/+5
| | | | * lisplib.c (place_set_entries): Add place-form-p to list of names.
* Let's have placelet and placelet*.Kaz Kylheku2015-07-111-4/+15
| | | | | | | | * share/txr/stdlib/place.tl (placelet*): New macro. * lisplib.c (place_set_entries): Add placelet* to list of names. * txr.1: Updated to document placelet* and fix mistakes.
* * share/txr/stdlib/place.tl (defplace dwim): EliminateKaz Kylheku2015-07-111-8/+6
| | | | | | | ogetter-sym variable for caching the sequence; use the getter for the sequence place to access it. Again, this is for placelet, where the caching is visible. Another way to fix this is to clobber the cache variable when updating the sequence place.
* New placelet macro.Kaz Kylheku2015-07-101-11/+34
| | | | | | | | | | | | | | * lisplib.c (place_set_entries): Add placelet to list of names. * share/txr/stdlib/place.tl (sys:placelet1, placelet): New macros. (defplace dwim): Do not retrieve the place's value into a local variable and have the getter expand to that variable. Rather, have the getter retrieve the value. A getter that refers to a cached copy breaks the semantics of placelet, and any place operator which can evaluate the location after it is stored. * txr.1: Documented placelet.
* Allow op arguments like @1 to be places.Kaz Kylheku2015-07-031-0/+6
| | | | | | | * share/txr/stdlib/place.tl: Introducing new defplace for (sys:var ...) which is treated as if it were a symbol, in anticipation of the op/do macro placing that syntax with a symbol.
* * share/txr/stdlib/place.tl: Get rid of big progn around theKaz Kylheku2015-06-221-527/+526
| | | | | | whole module. * genvim.txr: Handle (def's not preceded by spaces.
* Version 109.txr-109Kaz Kylheku2015-06-211-1/+1
|
* * lisplib.c (ifa_set_entries): Add conda.Kaz Kylheku2015-06-211-0/+7
| | | | | | | | * share/txr/stdlib/ifa.tl (conda): New macro. * tests/012/ifa.tl: Adding test for conda. * txr.1: Documenting conda.
* Remove places.h generation hack.Kaz Kylheku2015-06-201-0/+557
| | | | | | | | | | | | | | * Makefile (GEN_HDRS, LISP_TO_C_STRING): Variables removed. (%.h: %.tl): Rule removed. The place.h header is no longer generated from place.tl. * lisplib.c (place_instantiate): Load place.tl from stdlib directory, rather than obtaining it from a string literal in generated header place.h. * place.tl: Moved to share/txr/stdlib directory. * genvim.txr: Refer to place.tl in stdlib.
* * txr.1: Documented ifa.Kaz Kylheku2015-06-191-4/+12
| | | | | | | * share/txr/stdlib/ifa.tl: Tightened up the tests for situations when the macro is ill-formed, following the improved specification. Also, eval-error is thrown instead of just error.
* Library .txr files become .tl and are autoloaded.Kaz Kylheku2015-06-184-43/+44
| | | | | | | | | | | | | | | | | * lisplib.c (ver_set_entries, ver_instantiate, txr_case_set_entries, txr_case_instantiate): New static functions. (lisplib_init): Register new functions. * share/txr/stdlib/txr-case.txr: Reduced to a load for the corresponding .tl file, retained for backward compatibility. * share/txr/stdlib/ver.txr: Likewise. * share/txr/stdlib/txr-case.tl: New file, based on previous contents of corresponding .txr file. * share/txr/stdlib/ver.tl: Likewise.
* Adding anaphoric ifa macro.Kaz Kylheku2015-06-171-0/+44
| | | | | | | | | | | | | | | | | | | | * Makefile (install): Install .tl files present in stdlib directory. (INSTALL): Handle argument 2 being a list. * eval.c (load): New function. * eval.h (load): Declared. * lisplib.c (ifa_set_entries, ifa_instantiate): New functions to lazily load ifa.tl. (lisplib_init): Register new functions. * txr.c (stdlib_path): New variable. (sysroot_init): Store the stdlib path in stdlib_path. * txr.h (stdlib_path): Declared. * share/txr/stdlib/ifa.tl: New file.
* Version 108.txr-108Kaz Kylheku2015-06-131-1/+1
|
* Version 107.txr-107Kaz Kylheku2015-04-261-1/+1
|
* Version 106.txr-106Kaz Kylheku2015-04-211-1/+1
|
* Version 105.txr-105Kaz Kylheku2015-03-141-1/+1
|
* Version 104.txr-104Kaz Kylheku2015-02-081-1/+1
|
* Version 103.txr-103Kaz Kylheku2015-02-011-1/+1
|
* Version 102.txr-102Kaz Kylheku2015-01-131-1/+1
|
* Version 101.txr-101Kaz Kylheku2015-01-011-1/+1
|
* Version 100.txr-100Kaz Kylheku2014-10-221-1/+1
|
* * eval.c (eval_init): Register notf intrinsic function.Kaz Kylheku2014-10-211-8/+2
| | | | | | | | | | | | | | * lib.c (do_not): New static function. (notf): New function. * lib.h (notf): Declared. * txr.1: Documented notf. * share/txr/stdlib/txr-case.txr (bindable): Eliminated. (txr-if): Use functional expression, taking advantage of notf. * txr.vim: Regenerated.
* * share/txr/stdlib/txr-case.txr: New file.Kaz Kylheku2014-10-211-0/+48
| | | | | | | | | | | | * txr.1: Document txr-if, txr-when and txr-case. * genvim.txr: Added new macro names. * tests/011/txr-case.expected: New file. * tests/011/txr-case.txr: New file. * txr.vim: Regenerated.
* Version 99.txr-99Kaz Kylheku2014-10-051-1/+1
| | | | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version. * share/txr/stdlib/ver.txr: Likewise * Makefile: Improve binary packaging rules. * regex.c: #include <stdarg.h> added.
* Version 98.txr-98Kaz Kylheku2014-09-261-1/+1
|
* Version 97.txr-97Kaz Kylheku2014-08-291-1/+1
|