summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* defstruct bugfix: nonexistent function called.Kaz Kylheku2015-10-101-6/+6
| | | | | * share/txr/stdlib/struct.tl (defstruct): The nonexistent uw-throwf function was called instead of throw.
* Version 119.txr-119Kaz Kylheku2015-10-106-406/+479
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* New macro: with-objects.Kaz Kylheku2015-10-103-1/+62
| | | | | | | | | | | * lisplib.c (with_resources_set_entries): "with-objects" added to name table. * share/txr/stdlib/with-resources.tl (with-objects): New macro. * txr.1: Documented with-objects. Added note to :fini specifier of defstruct pointing to call-finalizers and with-objects.
* Improve progn expansion.Kaz Kylheku2015-10-091-4/+13
| | | | | * eval.c (do_expand): Reduce (progn) to nil, and (progn single) to single.
* Tweaking expansions of when and until.Kaz Kylheku2015-10-092-6/+14
| | | | | | | * eval.c (me_when): Expand to if if there aren't multiple body forms. (me_unless): Simplify progn. * tests/012/struct.tl: Update string representation in struct test case.
* Add note to :init and :fini.Kaz Kylheku2015-10-091-0/+14
| | | | * txr.1: Unlike methods, these don't have an implicit block.
* Various stream-related with- macros introduced.Kaz Kylheku2015-10-083-0/+241
| | | | | | | | | | * lisplib.c (with_stream_set_entries, with_stream_instantiate): New static functions. (lisplib_init): Register new functions in dl_table. * share/txr/stdlib/with-stream.tl: New file. * txr.1: Documented new macros.
* Adding defex macro and related functions.Kaz Kylheku2015-10-082-0/+148
| | | | | | | | | | * eval.c (me_defex, register_exception_subtypes): New static functions. (eval_init): Registered new defex macro, and register-exception-subtype and exception-subtype-p intrinsic functions. * txr.1: Documented new macro and functions.
* Report objects with ~s in exception registration code.Kaz Kylheku2015-10-081-4/+4
| | | | | * unwind.c (uw_register_subtype): Error messages should print symbols with ~s, not the information-losing ~a.
* Add note to Limitations of interactive listener.Kaz Kylheku2015-10-081-0/+3
| | | | * txr.1: listener doesn't handle Unicode properly.
* Doc fixes: interactive listener section.Kaz Kylheku2015-10-071-3/+4
| | | | | * txr.1: spelling and grammar errors in various places in Interactive Listener section.
* Adding promisep function.Kaz Kylheku2015-10-072-0/+33
| | | | | | | * eval.c (promisep): New static function. (eval_init): Registered promisep intrinsic. * txr.1: Documented promisep.
* Better diagnostic for cramped floating literals.Kaz Kylheku2015-10-071-2/+7
| | | | | | * parser.l: Different text needed for ).1 and a.1 cases, because the insertion of a zero cannot fix the latter. Might as well make the messages more detailed.
* Vim: better indentation for some forms.Kaz Kylheku2015-10-071-1/+7
| | | | | * genvim.txr: Some operators should indent like functions. We don't want these in lispwords.
* New function: reset-struct.Kaz Kylheku2015-10-063-0/+50
| | | | | | | | | * struct.c (reset_struct): New function. (struct_init): Register reset_struct intrinsic. * struct.h (reset_struct): Declared. * txr.1: documented reset-struct.
* New function: replace-struct.Kaz Kylheku2015-10-063-0/+60
| | | | | | | | | * struct.c (replace_struct): New function. (struct_init): Register replace_struct intrinsic. * struct.h (replace_struct): Declared. * txr.1: documented replace-struct.
* New function: clear-struct.Kaz Kylheku2015-10-063-0/+34
| | | | | | | | | * struct.c (clear_struct): New function. (struct_init): Register clear-struct intrinsic. * struct.h (struct_init): Declared. * txr.1: documented clear-struct.
* New function: call-finalizers.Kaz Kylheku2015-10-063-0/+51
| | | | | | | | | * gc.c (gc_call_finalizers): New function. (gc_late_init): Register call-finalizers intrinsic. * gc.h (gc_call_finalizers): Declared. * txr.1: documented call-finalizers.
* Fix misleading documentation under if/iffi.Kaz Kylheku2015-10-061-4/+4
| | | | | | | | | | | * txr.1: Examples under iff and iffi had two issues: the false predicate function was used in a role which calls for a function that unconditionally returns nil. The correct function is nilf. Square brackets must be used, otherwise nilf and identity are unbound variables. Also the equivalence for [iff a] now indicates that it's equiavlent to a, showing that it's not useful to default both arguments.
* New function, expand-right.Kaz Kylheku2015-10-062-0/+101
| | | | | | | | * eval.c (expand_right_fun, expand_right): New static functions. (eval_init): Register expand-right intrinsic. * txr.1: Documented expand-right.
* Allow conses functions to work on vecs and strings.Kaz Kylheku2015-10-061-2/+6
| | | | | * lib.c (conses): Use consp termination test only if input is a list.
* New function: ginterate.Kaz Kylheku2015-10-062-1/+48
| | | | | | | | * eval.c (ginterate_func): New static function. (ginterate): New function. (eval_init): Registered ginterate as intrinsic. * txr.1: Documented.
* New functions take, drop, {take,drop}-{while,until}.Kaz Kylheku2015-10-054-0/+380
| | | | | | | | | | | | * lib.c (take_list_fun, take_while_list_fun, take_until_list_fun): New static functions. (take, take_while, take_until, drop, drop_while, drop_until): New functions. * eval.c (eval_init): Register intrinsics take, take-while, take-until, drop, drop-while, drop-until. * txr.1: Documented.
* Copy lazy strings without forcing.Kaz Kylheku2015-10-052-1/+28
| | | | | | | * lib.c (copy_lazy_str): New static function. (copy_str): Use copy_lazy_str to copy lazy strings. * txr.1: Documentation added under copy-str.
* Optional arguments in boa construction.Kaz Kylheku2015-10-043-10/+56
| | | | | | | | | | | | * share/txr/stdlib/struct.tl (defstruct): Split boa arguments on colon and generate the lambda accordingly. The generated function detects which optional arguments are actually present and only performs the slot updates for those. * tests/012/struct.tl: Corrected boa test case. * txr.1: Documented.
* Bugfix: boa must apply last, as documented.Kaz Kylheku2015-10-041-3/+3
| | | | | * struct.c (make_struct): Process property list first, then call boa constructor, not vice versa.
* Eliminate recursion from make_struct.Kaz Kylheku2015-10-041-2/+4
| | | | | * struct.c (make_struct): Don't wastefully evaluate the symbolp test twice via recursion; assign and fall through.
* Interactive listener: substring completion.Kaz Kylheku2015-10-032-4/+33
| | | | | | | * parser.c (find_matching_syms): Take advantage of the linenoise Ctrl-X Tab feature by providing substring matches. * txr.1: Documented Ctrl-X Tab.
* linenoise: substring flag in completion callback.Kaz Kylheku2015-10-032-4/+8
| | | | | | | | | | | | | | | | | | | A feature is hereby introduced into linenoise whereby completion mode can be entered via Ctrl-X Tab also, not only Tab. This is distinguished with a flag in the completion structure. The intent is that the callback can use this to provide substring matches not only prefix matches. * linenoise/linenoise.c (complete_line): Takes a new argument, and stores it in the new substring member of lino_completions_t. (edit): If Tab is typed while in Ctrl-X extended mode, then fall through to the regular switch, where the TAB case now recognizes that it is in extended mode and passes the mode flag to complete_line. * linenoise/linenoise.h (lino_completions_t): New member, substring.
* Missing formatting added under meth.Kaz Kylheku2015-10-031-1/+1
| | | | | * txr.1: Missing denotation of meta-syntactic identifiers in meth macro syntax.
* slot-p renamed to slotp, conforming with Lisp conventions.Kaz Kylheku2015-10-034-8/+19
| | | | | | | | | | | | | | * share/txr/stdlib/struct.tl (sys:prune-nil-inits): Use of slot-p renamed. * struct.c (struct_init): Register slotp, and make registration of slot-p conditional on compatibility option. (slot_p): Function renamed to slotp. * struct.h (slot_p): Declaration renamed. * txr.1: References to slot-p fixed to slotp. Compat notes added.
* Missing compatibility notes.Kaz Kylheku2015-10-031-0/+6
| | | | | * txr.1: Added missing compatibility notes for 117 that should have been released with 118.
* New umeth and umethod macro and function.Kaz Kylheku2015-10-034-0/+112
| | | | | | | | | | * share/txr/stdlib/struct.tl (umeth): New macro. * struct.c (struct_init): Registered umethod intrinsic. (umethod_fun): New static function. (umethod): New function. * txr.1: Documented.
* Optimization: elide some nil slot initializations.Kaz Kylheku2015-10-031-2/+13
| | | | | | | | | | | If a defstruct slot specifier calls for a slot to be initialized to nil, that doesn't have to be done explicitly if the slot isn't inherited. * share/txr/stdlib/struct.tl (sys:prune-nil-inits): New function. (defstruct): Use prune-nil-inits to try to reduce the lists of static and instance slot specifiers.
* Fix inappropriate "does not name a struct type" error.Kaz Kylheku2015-10-031-1/+2
| | | | | | | * struct.c (struct_handle): The situation is that the object isn't a structure instance, not that the argument isn't a struct type. Use appropriate error message.
* Allow empty loops to be interrupted by signals.Kaz Kylheku2015-10-021-0/+5
| | | | | * eval.c (eval_progn): If there are no forms to evaluate, then check for signals.
* linenoise: Ctrl-X/Ctrl-[AWR] relative to hist pos.Kaz Kylheku2015-10-022-8/+17
| | | | | | | | | | * linenoise/linenoise.c (edit): The recall previous word, atom and line features now offset relative to the current navigation position in the history. Previous line means the line before the currently showing history line, not the line most recently entered into the history. * txr.1: Documented.
* Struct methods and functions set up named block.Kaz Kylheku2015-10-022-3/+24
| | | | | | | | * share/txr/stdlib/struct.tl (defstruct): Generate a named block around the body forms of the :method and :function lambdas, whose name matches the slot name. * txr.1: Documented.
* linenoise: insert previous line command.Kaz Kylheku2015-10-022-0/+22
| | | | | | | * linenoise/linenoise.c (edit): Extended Ctrl-X Ctrl-R/r command added. * txr.1: Documented.
* bugfix: macro-time not bound as special operator.Kaz Kylheku2015-10-022-1/+1
| | | | | | | * eval.c (eval_init): Bind macro-time to op_error. * genvim.txr: No longer manually add macro-time to txl-orig-sym.
* Set lispwords for better indenting.Kaz Kylheku2015-10-021-8/+23
| | | | | * genvim.txr (txl-orig-sym, lispwords): New variable. (generate): Generate Vim set lispwords command.
* bugfix: symbol-function throws on builtin macro.Kaz Kylheku2015-10-011-2/+2
| | | | | * eval.c (symbol_value): lookup_mac doesn't return a cons cell binding; don't do cdr on it.
* Syntax formatting fixes in structs documentation.Kaz Kylheku2015-10-011-6/+6
| | | | | * txr.1: Formatting blunders in defstruct (description of :fini), new macro, make-struct-type.
* Version 118.txr-118Kaz Kylheku2015-10-016-156/+237
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* linenoise: Ctrl-A/E overloaded in multi-line mode.Kaz Kylheku2015-10-012-3/+13
| | | | | | | | | | | | | * linenoise/linenoise.c (edit_move_sol): If the cursor is already at the beginning of a line, then move it to the start of the buffer. (edit_move_eol): If the cursor is at the end of the line, then move it to the end of the buffer. This also fixes a bug: previously, if the cursor was at the end of the line already, it moved to the end of the following line. * txr.1: Documented.
* Allow super to take an instance as an argument.Kaz Kylheku2015-10-012-4/+9
| | | | | | | | * struct.c (super): Detect structure instance and resolve it to its type. Recursion eliminated in favor of imperative approach that eliminates redundant checks. * txr.1: Description of super updated.
* New super-method function.Kaz Kylheku2015-10-013-1/+40
| | | | | | | | | * struct.c (struct_init): Register super-method. (super_method): New function. * struct.h (super_method): Declared. * txr.1: Documented.
* Support for reverse order in finalization.Kaz Kylheku2015-10-015-26/+45
| | | | | | | | | | | | | | | | | | | | | | A new optional argument on finalize allows it to be expressed that multiple finalizers on the same object are to be called in reverse order, which is potentially for objects with inheritance. * gc.c (gc_finalize): New optional argument, rev_order_p. Insert at the head of the list if this argument is specified and true. (gc_late_init): Register finalize as three-argument function with optional argument. * gc.h (gc_finalize): Declaration updated. * share/txr/stdlib/struct.tl (defstruct): Register :fini functions in reverse, so that derived finalizers are called before supertype finalizers. * txr.1: Documented new finalize argument, and behavior of :fini.
* linenoise: fix multi-line issue in history search.Kaz Kylheku2015-09-301-1/+12
| | | | | | | | | | | | | | | | Aborting a multi-line search result with Ctrl-C messes up display because the row-related values are being done on a linenoise copy, and their latest values aren't backpropagated to the master lino_t. * linenoise/linenoise.c (copy_display_params): New static function. (history_search): Use the lino_t copy when clearing the screen, because lino_clear_screen manipulates a display parameter. When leaving the function, copy the latest display-related parameters from lc to l, so that l has the latest number of columns and all the right row stuff for multi-line mode.
* Fix incorrect "during expansion of ..." error reporting.Kaz Kylheku2015-09-301-1/+4
| | | | | | | | * eval.c (eval_intrinsic): Treat last_form_expanded just like last_form_evaled: save it, set to nil, and restore it. If it is not set to nil, then an evaluation error will be falsely reported as being during the expansion of that form.