summaryrefslogtreecommitdiffstats
path: root/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
* New ignerr macro.Kaz Kylheku2015-02-251-0/+11
| | | | | | | | | * eval.c (me_ignerr): New static function. (eval_init): Registered ignerr macro. * txr.1: Documented. * tl.vim, txr.vim: Regenerated.
* Introducing persistent error state on streams.Kaz Kylheku2015-02-251-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib.c (cobj_ops): New function. * lib.h (cobj_ops): Declared. * stream.c (null_ops): Initializer updated. (struct stdio_handle): New member, err. (stdio_stream_mark): Mark the err member. (errno_to_string): New static function. (stdio_maybe_read_error, stdio_maybe_error): Set persistent error state. Use errno_to_string_function. (stdio_put_string, stdio_put_char, stdio_put_byte, stdio_seek, stdio_get_line): Set errno to zero, so that if the underlying operations do not set errno on err, we don't misinterpret some pervious errno value as pertaining to the failed stream operation. (stdio_get_error, stdio_get_error_str, stdio_clear_error): New static functions. (stdio_ops, tail_ops, pipe_ops): Update initializer with new functions. (string_in_get_error, string_in_get_error_str): New static functions. (string_in_ops): Update initializer with new functions. (byte_in_get_error, byte_in_get_error_str): New static functions. (byte_in_ops): Update initializer with new functions. (string_out_ops, strlist_out_ops): Update initializer with null pointers for new functions. (struct dir_handle): New struct type. (dir_destroy, dir_mark): New functions. (dir_get_line): Refactor for struct dir_handle context rather than DIR. Persist error state. (dir_close): Refactor for struct dir_handle. (dir_get_error, dir_get_error_str, dir_clear_error): New static functions. (dir_ops): Update initializer with new functions. (make_stdio_stream_common): Initialize new err member. (make_dir_stream): Refactor for struct dir_handle. (get_error, get_error_str, clear_error): New functions. (cat_get_error, cat_get_error_str, cat_clear_error): New static functions. (cat_stream_ops): Update initializer with new functions. (stream_init): Register get-error, get-error-str, clear-error intrinsics. * stream.h (struct strm_ops): New function pointer members, get_error, get_error_str and clear_error. (strm_ops_init): Macro extended with new arguments for new function pointers. (get_error, get_error_str, clear_error): Declared. * syslog.c (syslog_strm_ops): Update initializer with null pointers for new functions. * txr.1: Documented get-error, get-error-str and clear-error.
* Improved error reporting, particularly for macro expansion.Kaz Kylheku2015-02-211-0/+21
| | | | | | | | | | | | | | | | | | | * eval.c (last_form_expanded): New variable. (do_expand): New static function; contains previous expand function. (expand): Becomes a wrapper for do_expand, with re-entry counting. (eval_init): GC-protect last_form_expanded. * eval.h (last_form_expanded): Declared. * parser.l (regex_parse, lisp_parse): Just use a simple word for the name of the regex or string parse location, not the entire expression itself. * unwind.c (uw_throw): Check whether expansion was going on when the unhandled exception was thrown and print additional information.
* * regex.c (match_regex_right): Bugfix: zero length matchesKaz Kylheku2015-02-201-0/+6
| | | | | should return zero length, rather than nil. This is achieved by trying the match at one past the last character.
* String-returning wrappers for some regex matching functions.Kaz Kylheku2015-02-201-0/+13
| | | | | | | | | | | * eval.c (eval_init): Register search-regst, match-regst and match-regst-right intrinsics. * regex.c (search_regst, match_regst, match_regst_right): New functions. * regex.h (search_regst, match_regst, match_regst_right): Declared. * txr.1: Documented new variants.
* * regex.c (print_rec): A compound must use parentheses forKaz Kylheku2015-02-151-0/+5
| | | | elements which have a higher precedence than catenation.
* * lib.c (list_collect, list_collect_append): In errorKaz Kylheku2015-02-121-0/+7
| | | | | | messages about bad appends, do not show the list being appended because it may be an infinite lazy list. For instance (append* 3 lazy-list).
* New functions pad and weave.Kaz Kylheku2015-02-121-0/+10
| | | | | | | | * eval.c (pad_func, pad, weave_while, weave_gen, weavev): New static functions. (eval_init): Registered pad and weave intrisics. * txr.1: Documented pad and weave.
* * lib.c (lazy_appendv_func, lazy_appendv): Bugfix: append*Kaz Kylheku2015-02-121-0/+10
| | | | | | | | | was silently ignoring lists after the first atom, instead of throwing an error. Also, it was not detecting the case that the last argument is a list which should just be returned, and instead trying to find its tail in preparation for the next call to lazy_appendv_func, the consequences being runaway iteration over an infinite list.
* * eval.c (symacro_k, fun_k): New keyword variables.Kaz Kylheku2015-02-101-0/+11
| | | | | | | | | | (lexical_lisp1_binding): New static function. (eval_init): Initialize symacro_k and fun_k; register new intrinsic function lexical-lisp1-binding. * match.h (var_k): Existing external name declared. * txr.1: Documented lexical-lisp1-binding.
* * Makefile: Add dependency froml $(EXTRA_OBJS-y) to headerKaz Kylheku2015-02-091-0/+6
| | | | | file and config.h, so windows resource file is rebuilt when the version changes.
* * Makefile: Removing bogus eval which refers to nonexistentKaz Kylheku2015-02-091-0/+5
| | | | DEP_INSTANTIATE macro.
* * Makefile (clean): Remove $(EXTRA_OBJS-y) so the Windows .resKaz Kylheku2015-02-091-0/+5
| | | | file is removed.
* Version 104.txr-104Kaz Kylheku2015-02-081-0/+10
|
* * arith.c (trunc_rem): New function.Kaz Kylheku2015-02-071-0/+12
| | | | | | | | | | * eval.c (eval_init): Register trunc-rem intrinsic. * lib.h (trunc_rem): Declared. * txr.1: Documented trunc-rem. * tl.vim, txr.vim: Updated.
* * Makefile (CFLAGS): Removed puzzling, unnecessary definitionsKaz Kylheku2015-02-071-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of XMALLOC, XCALLOC, XREALLOC and XFREE for $(MPI_OBJS). MPI does not use such macros and the allocator is already retargetted to use the TXR one. * mpi-patches/use-txr-allocator: In this patch, we don't need external declaration for chk_malloc or chk_realloc because they are not used. Only chk_calloc is used. * mpi-patches/add-bitops: Refreshed. * mpi-patches/add-mp-hash: Likewise. * mpi-patches/add-mp-set-intptr: Likewise. * mpi-patches/add-mpi-toradix-with-case: Likewise. * mpi-patches/bit-search-optimizations: Likewise. * mpi-patches/export-mp-eq: Likewise. * mpi-patches/faster-square-root: Likewise. * mpi-patches/fix-bad-shifts: Likewise. * mpi-patches/fix-ctype-warnings: Likewise. * mpi-patches/fix-mult-bug: Likewise. * mpi-patches/mpi-set-double-intptr: Likewise. * mpi-patches/mpi-set-mpi-word: Likewise. * mpi-patches/mpi-to-double: Likewise.
* Support txr-win.exe target which has no console window.Kaz Kylheku2015-02-071-0/+12
| | | | | | | | | | * Makefile (EACH_CONF): Iterate over arguments. (opt/txr-win.o, dbg/txr-win.o): New special object files. (opt/%-win.o, dbg/%-win.o): New pattern rule to build special object files. ($(PROG)-win, $(PROG)-win-dbg): New program targets. * inst.nsi: Install txr-win.exe.
* * txr.1: fixed flurry of phrasing, formatting fumbles.Kaz Kylheku2015-02-071-0/+4
|
* * tests/011/macros-1.txr: Add test for lexical functionKaz Kylheku2015-02-071-0/+7
| | | | | | shadowing symbol macro. * tests/011/macros-1.expected: Updated.
* * unwind.c (uw_throw): Detect invalid re-entry and bail.Kaz Kylheku2015-02-061-0/+6
| | | | | Cautiously, we use fprintf rather than our streams system, in case some problem with the streams is involved in this mess.
* * unwind.c (uw_throw): Put a txr: prefix on the unhandledKaz Kylheku2015-02-061-0/+5
| | | | exception in early initialization message.
* Slight internal representation change of string-only exceptions.Kaz Kylheku2015-02-061-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | One upshot of all this is that (throw 'foo "msg") now does exactly the same thing as (throwf 'foo "msg"). A message-only exception really is a one-string exception argument list ("message ..."), like the documentation says. * unwind.h (struct uw_catch): exception member renamed to args. (uw_catch): Macro follows structure member rename. * eval.c (op_catch): Removed now unnecessary kludge of turning non-list exception argument list into a one-element argument list. * match.c (v_try): Similar hack to the one in op_catch removed here. * unwind.c (uw_unwind_to_exit_point, uw_push_catch): Follows rename of exception member. (uw_throw): The exception parameter is renamed to args. The kludge removed from op_catch re-appears here, because numerous calls to uw_throw just pass a string as args. It's less of a kludge here because this is the master entry point to exception processing, and it straightens out the representation right away. The exception arguments or message are printed in a clearer way.
* Serious bugfix in the op macro, and derived macro, inKaz Kylheku2015-02-061-0/+12
| | | | | | | | | | | the handling of missing meta-numbers (for instance (op ... @1 .. @3): 1 and 3 occur, but not 2. * eval.c (supplement_op_syms): Bugfix: loop was testing and updating the wrong variable, causing it to be looking at the first element of the syms list in every iteration. Not a regression: this was implemented wrong when the function was introduced on October 6, 2013.
* * eval.c (subst_vars): Bugfix. When an ordinary variableKaz Kylheku2015-02-061-0/+12
| | | | | | | | | | | occurs in the quasi syntax (which is the result of substitution of metanums like @1 by the op macro), if that variable evaluated to a list form, it was not being converted to a string. The resulting form was then examined for variable substitutions as if it were part of the quasi syntax. This was introduced at the same time as the feature of being able to use metanums in a quasiliteral (Feb 13, 2012: last change before Version 57).
* * eval.c (transform_op): When expanding @rest and metanumsKaz Kylheku2015-02-061-0/+8
| | | | | | | like @1, @2, preserve the (sys:var X args ..) structure if there are args (but of course with X replaced by the appropriate gensym). This allows syntax like `@{1 10}` to work in quasiliterals: in other words, modifiers on interpolated metas, on par with @{a 10}.
* * sysif.c (abort_wrap): New static function.Kaz Kylheku2015-02-061-0/+11
| | | | | | | | | | (sysif_init): Registered abort intrinsic. * txr.1: Documented abort. Changed Unix Programming heading to System Programming, since exit, abort and errno are not Unix-specific, but C-specific. * tl.vim, txr.vim: Updated.
* * unwind.c (unhandled_hook_s): New static variable.Kaz Kylheku2015-02-061-0/+20
| | | | | | | | | | | | | | | | | | | (uw_throw): In the unhandled case, check if *unhandled-hook* variable has a function, and use it instead of the default logic. If it's not a function, abort with an error message. Clear it so that if the hook function re-enters this code, it will not be used. Always exit now on unhandled exceptions; do not abort. (uw_late_init): New function. * unwind.h (uw_late_init): Declared. * lib.c (init): Call uw_late_init. * txr.1: Documented *unhandled-hook*. * genvim.txr: Scan the unwind.c file, since it has a reg_var now. * tl.vim, txr.vim: Updated.
* * win/env.nsh: Before the potentially length SendMessage,Kaz Kylheku2015-02-051-0/+5
| | | | print an informative message.
* * win/env.nsh: Improve messages about environmentKaz Kylheku2015-02-051-0/+5
| | | | variable modification.
* Symbol macros shadowed by functions under dwim.Kaz Kylheku2015-02-031-0/+13
| | | | | | | | | | | * eval.c (lookup_symac_lisp1, expand_lisp1, expand_forms_lisp1): New static functions. (expand): Handle dwim's arguments via expand_forms_lisp1, rather than as a generic compound form. * txr.1: Revised text in several places to clarify this expansion rule.
* Version 103.txr-103Kaz Kylheku2015-02-011-0/+10
|
* Update copyright notices from 2014 to 2015.Kaz Kylheku2015-02-011-0/+13
| | | | | | | | | | | * arith.c, arith.h, combi.c, combi.h, debug.c, debug.h, eval.c, eval.h, filter.c, filter.h, gc.c, gc.h, hash.c, hash.h, lib.c, lib.h, match.c, match.h, parser.h, rand.c, rand.h, regex.c, regex.h, signal.c, signal.h, stream.c, stream.h, sysif.c, sysif.h, syslog.c, syslog.h, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h: Update. * LICENSE, METALICENSE: Likewise.
* Windows installer.Kaz Kylheku2015-02-011-0/+8
| | | | | | * inst.nsi: New file. * win/env.nsh: New file.
* On Windows, add icon and identifying meta-data to executable.Kaz Kylheku2015-01-311-0/+17
| | | | | | | | | | | | | | | * Makefile (EXTRA_OBJS-y): New variable. (WINDRES): New recipe. * configure: Check for presence of windres, and generate add_win_res variable in config.make. * win/txr.xcf: New file: GIMP project for icon. * win/txr.ico: New file: icon with three sizes generated from GIMP project. * win/txr.rc: New file.
* Use macro to initialize strm_ops.Kaz Kylheku2015-01-291-0/+12
| | | | | | | | | | * stream.h (strm_ops_init): New macro. * stream.c (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): Initialize using macro. * syslog.c (syslog_strm_ops): Likewise.
* Use macro to initialize cobj_ops.Kaz Kylheku2015-01-291-0/+12
| | | | | | | | | | * lib.h (cobj_ops_init): New macro. * hash.c (hash_ops, hash_iter_ops): Initialize with cobj_ops_init. * rand.c (random_state_ops): Likewise. * regex.c (char_set_obj_ops, regex_obj_ops): Likewise.
* * arith.c (make_ubignum): New static function.Kaz Kylheku2015-01-291-0/+13
| | | | | | | | | | | | (sign_extend): New function. * eval.c (eval_init): Register sign-extend intrinsic. * lib.h (sign_extend): Declared. * txr.1: Documented sign-extend. * tl.vim, txr.vim: Updated.
* * txr.1: fixed use of nonexistent str-int in @(require) example;Kaz Kylheku2015-01-291-0/+5
| | | | fixed bad formatting under logtrunc and partition.
* * eval.c (get_opt_param_syms): Fix broken function. ThisKaz Kylheku2015-01-281-0/+7
| | | | | | was choking on keywords like :env in the lambda list, and failing to handle the nested patterns of macro lambda lists. Failing case: (defmacro x (: opt :env foo)).
* * eval.c (bind_macro_params): Bugfix: the colon argument's specialKaz Kylheku2015-01-281-0/+6
| | | | | meaning "treat the argument as missing" must apply only to optional parameters.
* * lib.c (make_like): Fix regression introduced in 102.Kaz Kylheku2015-01-271-0/+6
| | | | | A one element list being converted to a string treated as an empty list, leading to empty string.
* * arith.c (width): New function.Kaz Kylheku2015-01-271-0/+10
| | | | | | | | * arith.h (width): Declared. * eval.c (eval_init): Width registered as intrisinc. * txr.1: Documented width.
* * eval.c (call_f): new global variable.Kaz Kylheku2015-01-251-0/+10
| | | | | | | | | (do_mapf, mapf): new static functions. (eval_init): protect call_f from gc, and initialize it. re-register call function using call_f. register mapf intrinsic. * txr.1: Documented mapf.
* * eval.c (eval_init): Register dupl and swap_12_21 asKaz Kylheku2015-01-251-0/+12
| | | | | | | | | | | the dup and flip intrinsics. * lib.c (do_dup): New static function. (dupl): New function. * lib.h (dupl): Declared. * txr.1: Documented dup and flip.
* * eval.c (callf): New static function.Kaz Kylheku2015-01-241-0/+7
| | | | | | (eval_init): callf registered. * txr.1: Documented callf.
* Basic implementation of constantp. Does notKaz Kylheku2015-01-211-0/+12
| | | | | | | | | | | recognize forms like (+ 2 2) as constant. * eval.c (constantp_noex, constantp): New functions. (eval_init): Registered constantp as intrinsic. * tl.vim, txr.vim: Updated. * txr.1: Documented constantp.
* * stream.c (get_string): New argument, close_after_p.Kaz Kylheku2015-01-211-0/+12
| | | | | | | | | | | Close the stream unless close_after_p is specified and is nil, or when it is missing, an there is no compatibility or it's newer than version 102. * stream.h (get_string): Updated declartion. * txr.1: Documented default closing behavior of get-string and the new optional argument for overriding it.
* * txr.1: Minor fix in split-str-set documentation.Kaz Kylheku2015-01-211-0/+4
|
* Allow macros to tell what symbols have lexical functionKaz Kylheku2015-01-211-0/+12
| | | | | | | | | | | or variable bindings. * eval.c (lexical_var_p, lexical_fun_p): New local functions. (eval_init): Registered as intrinsics. * txr.1: Documented lexical-var-p and lexical-fun-p. * tl.vim, txr.vim: Updated.
* Version 102.txr-102Kaz Kylheku2015-01-131-0/+12
|