summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* * txr.1: In introduction of user-defined places, mentioningKaz Kylheku2015-07-282-2/+38
| | | | | placelet as a way of writing place update macros. Example added under placelet.
* * txr.1: Bad syntax in placelet example; bad font in headings.Kaz Kylheku2015-07-281-11/+9
|
* Version 110.txr-110Kaz Kylheku2015-07-257-331/+482
|
* * genvim.txr: Improved highlighting of items in quasiquote.Kaz Kylheku2015-07-252-5/+11
| | | | | Lists can be spliced and quoted. Metanums and metavars can be prefixed by multiple @'s.
* * genvim.txr: Do not refer to installed code via stdlib.Kaz Kylheku2015-07-252-3/+9
| | | | Refer to source tree.
* * txr.1: Notes about interaction between op and quasiliterals.Kaz Kylheku2015-07-251-1/+65
|
* Quasiliteral tests.Kaz Kylheku2015-07-253-0/+23
| | | | | | * tests/012/quasi.expected: New file. * tests/012/quasi.tl: New file.
* * Makefile (tst/tets/012/%): Disable --gc-debug forKaz Kylheku2015-07-252-0/+6
| | | | tests in this directory.
* * tests/012/ifa.tl: New test for it being bound to a place.Kaz Kylheku2015-07-242-0/+9
|
* Bugfix: place-form-p must expand place macros.Kaz Kylheku2015-07-243-7/+18
| | | | | | | | | * 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.
* * txr.1: Clarifications in ifa description.Kaz Kylheku2015-07-241-5/+5
|
* * eval.c (op_quote): Improved diagnostic.Kaz Kylheku2015-07-242-1/+5
|
* Set up blank top_srcdir if building in source directory.Kaz Kylheku2015-07-233-19/+48
| | | | | | | | | | | | | | | | | | This means short, relative names are used for C source files when compiling in the source directory. * Makefile (CFLAGS): Exclude -iquote $(top_srcdir) arguments if top_srcdir is blank. Remove slash after $(top_srcdir), since the variable includes it now, if its value is not blank. (SRCS, ABBREV, opt/%-win.o, lex.yy.c, y.tab.c, install): Remove slash after $(top_srcdir). (dbg/%.o, opt/%.o): Only include rules for depending on $(top_srcdir)%.c prerequisite if top_srcdir is not blank. In the blank case, the rules are redundant. * configure: if configuring in the root of the source tree, establish top_srcdir as blank, otherwise establish is as an absolute path with a trailing slash.
* Split off test macros from ifa.tl into common file.Kaz Kylheku2015-07-234-18/+30
| | | | | | | | | | | * Makefile (TESTS_OUT): Don't use find to hunt down tests; but rather wildcard. This way common.tl is not mistakenly identified as an independent test file. * tests/012/ifa.tl: Removed test code, placed in new file which is loaded. * tests/common.tl: New file.
* Fixes for building in separate dir.Kaz Kylheku2015-07-232-11/+28
| | | | | | | | | | | | | * Makefile (CFLAGS): Search for mpi header in $(top_srcdir). (ABBREV): Remove top_srcdir prefix from source names. (dbg/%.o, opt/%.o): Extra set of pattern rules for searching for prerequisites in $(top_srcdir) where primary C sources are found and in the local dir where some generated C is found. This way we don't rely on VPATH. (opt/%.res): Bogus target removed. (VPATH): Removed in favor of explicitly referencing $(top_srcdir). Was causing problems for tests. (lex.yy.c, y.tab.c): Prerequisites referenced in $(top_srcdir).
* * parser.l (grammar): Do not allow unescaped newline inKaz Kylheku2015-07-233-7/+48
| | | | | | | | | | | word list literals and word list quasiliterals, except in <= 109 compatibility mode. An escaped newline in these literals, together with surrounding whitespace, now produces a single space, except in <= 109 compatibility mode. * txr.1: Documented new rules for WLL's and QLL's, and added compatibility notes.
* * genvim.txr: Scan cadr.c, cadr.tl, with-resources.tl, txr-case.tl.Kaz Kylheku2015-07-232-7/+12
| | | | | Remove hard-coded txr-case symbols. Recognize operators registered with in-line intern.
* Adding with-resources macro.Kaz Kylheku2015-07-234-0/+114
| | | | | | | | | | * 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-226-0/+109
| | | | | | | | | | | | * 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.
* * txr.1: Delete accidentally introduced bogus text.Kaz Kylheku2015-07-221-2/+1
|
* Improve bad argument diagnosis for place macros.Kaz Kylheku2015-07-224-3/+48
| | | | | | | | | | * 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-226-22/+96
| | | | | | | | | | | | | | | | | | * 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-224-16/+85
| | | | | | | | | | | | | | 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.
* * lib.c (obj_print, obj_pprint): Bugfix: incorrectKaz Kylheku2015-07-222-2/+10
| | | | | value returned when printing dwim forms, due to mutating the obj variable.
* * share/txr/stdlib/place.tl: Indentation.Kaz Kylheku2015-07-221-20/+20
|
* Implementing caar, cadr, cdar and friends.Kaz Kylheku2015-07-2110-6/+1903
| | | | | | | | | | | | | | | | | | | | * 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-213-8/+41
| | | | | | semantics so that (del (cdr x)) is symmetric with (del (car x)). * txr.1: Update documentation.
* * eval.c (eval_init): Register new split function.Kaz Kylheku2015-07-215-2/+155
| | | | | | | | | | | | * lib.c (split_func): New static function. (partition_split_common): New static function, based on on contents of partition function. (partition): Now a wrapper around partition_split_common. (split): New function. * lib.h (split): Documented. * txr.1: Documented split.
* * txr.1: Fixes in description of partition.Kaz Kylheku2015-07-211-8/+10
|
* * txr.1: Document place binding behavior of ifa.Kaz Kylheku2015-07-201-5/+13
|
* * parser.c (open_txr_file): Bugfix: the name of the parsedKaz Kylheku2015-07-132-1/+7
| | | | | stream should be the resolved name, not the abstract original, so that error messages correlate to the file.
* * share/txr/stdlib/ifa.tl (ifa): Use placelet toKaz Kylheku2015-07-122-4/+20
| | | | allow "it" to be mutable when it denotes a place form.
* * share/txr/stdlib/place.tl (place-form-p): New function.Kaz Kylheku2015-07-123-0/+12
| | | | * lisplib.c (place_set_entries): Add place-form-p to list of names.
* Expand away sys:lisp1-value based on lexical info.Kaz Kylheku2015-07-112-2/+37
| | | | | | | * eval.c (sys_lisp1_value_s): New global symbol variable. (expand_lisp1_value): New static function. (do_expand): Use expand_lisp1_value. (eval_init): Initialize sys_lisp1_value_s.
* Let's have placelet and placelet*.Kaz Kylheku2015-07-114-8/+46
| | | | | | | | * 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-112-8/+14
| | | | | | | 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.
* * eval.c (eval_init): Register bindable as intrinsic.Kaz Kylheku2015-07-103-1/+27
| | | | * txr.1: Documented.
* New placelet macro.Kaz Kylheku2015-07-104-11/+134
| | | | | | | | | | | | | | * 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.
* Handle setting of parse name through prime_parser.Kaz Kylheku2015-07-104-7/+22
| | | | | | | | | | | | * parser.c (prime_parser): Take name as argument, and install it into parser. (lisp_parser): Pass name to parse, instead of setting it in the parser object. * parser.y (parse): Take name as argument and pass down to prime_parser. * parser.h (prime_parser, parse): Declarations updated.
* Fix wrong name reported for errors in first top-level form.Kaz Kylheku2015-07-102-1/+9
| | | | | * parser.c (read_eval_stream): Get name of original stream, and pass that down to lisp_parse as the name argument.
* Fix off by one error line numbers for .tl files.Kaz Kylheku2015-07-102-3/+14
| | | | | * parser.c (read_eval_stream): Add terminating newline to the first line that was examined for hash bang.
* Remove unused "primer" member from parser_t.Kaz Kylheku2015-07-103-9/+18
| | | | | | | | | | | * parser.c (parser_mark, parser_common_init): Remove reference to primer. (parser): Don't take primer argument, remove reference to member. (ensure_parser): Don't take primer argument, don't pass to parser function. (lisp_parse): Don't pass primer string to ensure_parser. * parser.h (primer_t): Remove primer member. (parser): Declaration updated.
* Bugfix: lexer loses unmatched "hold char" between top-level forms.Kaz Kylheku2015-07-105-11/+39
| | | | | | | | | | | | | | | | | | Test case: file containing 4(prinl 3). Scanner consumes 4 and (. The ( is lost when the scanner is reset for the next call to yyparse, resulting in jut prinl being read and interpreted as a variable. * parser.c (prime_parser): If present, append hold byte to priming string. Takes parser_t * instead of parser, and returns void now. * parser.l (reset_scanner): Now returns int value, the value of the scanner's yy_hold_char variable which is nonzero when the scanner is hanging on to an unmatched byte of input. * parser.h (reset_scanner, prime_parser): Declarations updated. * parser.y (parse): Pass hold byte returned by reset_scanner to prime_parser.
* * stream.c (byte_in_unget_byte): Wrong function name in error message.Kaz Kylheku2015-07-102-1/+5
|
* Fix unget-byte and unget-char on catenated streams.Kaz Kylheku2015-07-102-2/+9
| | | | | * stream.c (cat_unget_byte, cat_unget_char): Recursive call to unget_byte and unget_char with reversed arguments.
* Parser cleanup: embed scanner in parser.Kaz Kylheku2015-07-095-28/+72
| | | | | | | | | | | | | | | | | | | | | | | * parser.c (parser_destroy): New GC finalizer static function. (parser_ops): Register parser_destroy. (parser_common_init): New function, shared by parse and parse_once. Initializes embedded scanner. (parser_cleanup): New function, shared by parse_once and parser_destroy. (parser): Use parser_common_init. * parser.h (parser_t): New member, yyscan. (reset_scanner, parser_common_init): Declared. * parser.l (reset_scanner): New function. * parser.y (parse_once): Use parser_common_init, and thus perform only a few initializations. Do not define scanner as a local variable. (parse): Call reset_scanner instead of yylex_init since the scanner is being reused, and for the same reason do not call yylex_destroy. GC will do that now.
* Bugfix: define-modify-macro not registered for auto-loading.Kaz Kylheku2015-08-082-1/+8
| | | | | * lisplib.c (place_set_entries): Add define-modify-macro to list of names.
* * genvim.txr (chesc): Include space among escaped characters.Kaz Kylheku2015-07-071-1/+1
|
* Bugfix: allow @1 in brace variables.Kaz Kylheku2015-06-072-1/+10
| | | | | | | * parser.l (grammar): Scan a METANUM token in the BRACED state also. This allows us to correctly reference op arguments in a quasiliteral, as in `foo @{@1 [1..2] ","} bar`.
* Improved printing of stream objects.Kaz Kylheku2015-07-074-26/+74
| | | | | | | | | | | | | | | | | | | | | * stream.c (null_stream_print): Static function removed. (stream_print_op): New function. Prints stream's name and address. (null_get_prop): Pull stream name from strm_ops structure rather than hard-coding to "null-stream". (null_ops, stdio_ops, tail_ops, pipe_ops, string_in_ops, byte_in_ops, string_out_ops, strlist_out_ops, dir_ops, cat_stream_ops): Use stream_print_op in place of cobj_print_op. Initialize name. (stdio_stream_print): Use name from ops structure, and include object address. (string_in_get_prop): Likewise. (cat_stream_print): Likewise. * stream.h (struct strm_ops): New member, name. (strm_ops_init): Initialize name. (stream_print_op): Declared. * syslog.c (syslog_strm_ops): Use stream_print_op. Initialize name.