summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-081-0/+171
| | | | | | | | | | * 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-081-0/+125
| | | | | | | | | | * 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.
* 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-071-0/+21
| | | | | | | * eval.c (promisep): New static function. (eval_init): Registered promisep intrinsic. * txr.1: Documented promisep.
* New function: reset-struct.Kaz Kylheku2015-10-061-0/+33
| | | | | | | | | * 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-061-0/+42
| | | | | | | | | * 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-061-0/+18
| | | | | | | | | * 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-061-0/+17
| | | | | | | | | * 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-061-0/+72
| | | | | | | | * eval.c (expand_right_fun, expand_right): New static functions. (eval_init): Register expand-right intrinsic. * txr.1: Documented expand-right.
* New function: ginterate.Kaz Kylheku2015-10-061-1/+17
| | | | | | | | * 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-051-0/+181
| | | | | | | | | | | | * 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-051-0/+12
| | | | | | | * 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-041-3/+34
| | | | | | | | | | | | * 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.
* Interactive listener: substring completion.Kaz Kylheku2015-10-031-3/+29
| | | | | | | * parser.c (find_matching_syms): Take advantage of the linenoise Ctrl-X Tab feature by providing substring matches. * txr.1: Documented Ctrl-X Tab.
* 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-031-3/+12
| | | | | | | | | | | | | | * 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-031-0/+81
| | | | | | | | | | * 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.
* linenoise: Ctrl-X/Ctrl-[AWR] relative to hist pos.Kaz Kylheku2015-10-021-2/+8
| | | | | | | | | | * 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-021-1/+18
| | | | | | | | * 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-021-0/+8
| | | | | | | * linenoise/linenoise.c (edit): Extended Ctrl-X Ctrl-R/r command added. * txr.1: Documented.
* 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-011-2/+2
| | | | | | | | | | * 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-011-2/+9
| | | | | | | | | | | | | * 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-011-2/+3
| | | | | | | | * 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-011-0/+31
| | | | | | | | | * 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-011-18/+26
| | | | | | | | | | | | | | | | | | | | | | 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.
* Bad formatting in version 113 compat notes.Kaz Kylheku2015-09-301-1/+2
| | | | * txr.1: Run-on .code macro fixed.
* Formatting fix in struct passwd and group headings.Kaz Kylheku2015-09-301-2/+2
| | | | * txr.1: * used instead of @.
* struct :init :fini specifiers.Kaz Kylheku2015-09-291-0/+58
| | | | | | | | * share/txr/stdlib/struct.tl (defstruct): New (:init ...) and (:fini ...) syntax can be used in the slot list to specify an initialization function and a gc-finalization function. * txr.1: Documented.
* Implementation of static slots for structures.Kaz Kylheku2015-09-291-50/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * share/txr/stdlib/struct.tl (sys:bad-slot-syntax): New helper function. (defstruct): Macro revamped with new slot specifier syntax for writing static slots as well as methods. * struct.c (STATIC_SLOT_BASE): New preprocessor symbol. (struct struct_type): New members, nstslots, stinitfun, stslot. (make_struct_type_compat): New static function. (struct_init): Register make-struct-type to make_struct_type_compat if compatibility is 117 or lower. Register new intrinsics static-slot, static-slot-set, call-super-method, call-super-fun, slot-p and static-slot-p. (call_stinitfun_chain): New static function. (make_struct_type): Two new arguments for specifying static slots and an initialization function for them. Logic added for setting up static slots and handling inheritance. (struct_type_destroy): New static function. (struct_type_mark): Mark the new stinitfun member of struct type. Also iterate over the static slots in the new stslot array and mark them. (lookup_slot): Altered to return a loc instead of a raw pointer, and also to accept the instance object as a member. Now resolves static slots: it can return a loc which references a static slot in the structure type, or an instance slot in the structure. (lookup_static_slot): New static function. (slot, slotset): Implementation adjusted due to new lookup_slot interface. (static_slot, static_slot_set, slot_p, static_slot_p): New functions. (call_super_method, call_super_fun): New static functions. (struct_inst_print): This function can no longer assume that the slots list lines up with the array of slots, since it contains a mixture of static and instance slots. Earnest slot lookup has to be performed. (struct_type_ops): Point the destroy function to struct_type_destroy instead of cobj_destroy_free_op. A structure type now has an array of static slots to free. * struct.h (make_struct_type): Declaration updated. (static_slot, static_slot_set, slot_p, static_slot_p): Declared. * lib.c (time_init): Update call to make_struct_type with new arguments. * sysif.c (sysif_init): Likewise. * tests/012/struct.tl: Update defstruct macro expansion test. * txr.1: Documented static slots and new functions.
* linenoise: backspace also causes parenthesis jump.Kaz Kylheku2015-09-271-0/+4
| | | | | | | * linenoise/linenoise.c (edit): Do paren_jump after backspace * txr.1: Documented.
* linenoise: paren matching jump finds closes paren.Kaz Kylheku2015-09-271-2/+15
| | | | | | | | | | * linenoise/linenoise.c (find_nearest_paren): New static function. (edit_move_matching_paren): Use find_matching_paren to usefully handle situations when the cursor is not on a parenthesis, bracket or brace. * txr.1: Documented.
* linemode: multi-line behavior for Ctrl-A/Ctrl-E.Kaz Kylheku2015-09-251-0/+4
| | | | | | | | * linemode/linemode.c (edit_move_home, edit_move_end): Check for multi-line mode and implement movement within the physical line. * txr.1: Documented.
* Version 117.txr-117Kaz Kylheku2015-09-231-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* doc: note another race in path-private-to-me-pKaz Kylheku2015-09-231-1/+13
| | | | | | * txr.1: document a TOCTTOU race condition in uses of path-private-to-me-p and how to get around it.
* doc: stat functions return structure.Kaz Kylheku2015-09-231-1/+1
| | | | | | * txr.1: Under Unix Filesystem Object Existence, Type and Access Tests, fix text which implies that the stat functions return a list.
* linenoise: forward paren jump too.Kaz Kylheku2015-09-221-2/+10
| | | | | | | | * linenoise/linenoise.c (paren_jump): Scan forward also, if reverse scan turns up nothing, thereby jumping to a closing parenthesis in the forward direction. * txr.1: Documentation updated.
* linenoise: selection endpoint toggle with Ctrl-^.Kaz Kylheku2015-09-221-0/+8
| | | | | | * linenoise/linenoise.c (edit): Implemented. * txr.1: Documented.
* linenoise: jump to matching parenthesisKaz Kylheku2015-09-221-0/+12
| | | | | | | | | * linenoise/linenoise.c (scan_match_fwd, scan_fwd, edit_move_matching_paren): New functions. (edit): New Ctrl-] command implemented using edit_move_matching_paren. * txr.1: Documented.
* linenoise: new Ctrl-X Ctrl-K command to delete line.Kaz Kylheku2015-09-211-0/+7
| | | | | | | | | * linenoise/linenoise.c (edit_delete_line): New static function. (edit): New Ctrl-K extended command case implemented using edit_delete_line. * txr.1: Documented.
* linenoise: multi-line behavior for del to bol/eol.Kaz Kylheku2015-09-211-3/+6
| | | | | | | | | | | | | * linenoise/linenoise.c (edit_delete_prev_all): In multi-line mode, delete only to beginning of physical line, not the entire logical line. Also, detect noop cases and don't do record undo or produce any effect. (edit_delete_to_eol): New function. (edit): Use edit_delete_to_eol function for Ctrl-K instead of inline code. * txr.1: Documented.
* linenoise: much more sane, per-history-item undo.Kaz Kylheku2015-09-211-19/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Undo now works intuitively. It does not perform invisible jumps among history items, restoring instead just the history for the given line being edited. * linenoise/linenoise.c (LINENOISE_MAX_UNDO): Raised from 32 to a more generous 200. Since edits are per-history line, it makes sense to allow a lot more. (delete_undo): New static function. (free_undo): Static function removed to free_undo_stack. Trivial loop around delete_undo. (record_undo): Do not record the current history index; all edits are assigned the index INT_MAX. INT_MAX is an indicator that the edits do not have an assigned history line. The decision of where to assign them depends on whether history navigation is used to move to another history line or Enter is used to submit an edited line. A stinky part of the history trimming code is rewritten simply in terms of delete_undo. (record_triv_undo): Suppress a trivial item only if the top item belongs to the same history line, or is nonspecific (INT_MAX). (undo_pop): Static function removed. (restore_undo): Rewritten to look for the topmost item specific to the current history line or an INT_MAX nonspecific item. Removes undo items for expired lines as it goes. (undo_subst_hist_idx): New static function. (renumber_undo_hist): Renamed to undo_renumber_hist_idx. (edit_history_next): Do not record an undo; history navigation is no longer considered an edit. Rewrite all the INT_MAX entries in the undo stack with the current history index, permanently associating the undo items with the history line away from which we are navigating. (edit): Do not record an undo for a line terminating with Enter. It is not an edit action. When leaving the funtion, renumber any INT_MAX entries in the undo history to history index zero. Thus edits to any line which is submitted via Enter will (correctly) not be associated with that line, which was not in fact edited, but with the new line that was submitted. (lino_cleanup): Follow rename of free_undo. (lino_hist_add): Follow rename of undo_renumber_hist_idx. * txr.1: Documented.
* linenoise: undo feature.Kaz Kylheku2015-09-201-0/+26
| | | | | | | | | | | | | | | | | | | | | * linenoise/linenoise.c (LINENOISE_MAX_UNDO): New preprocessor symbol. (struct lino_state): New member, undo_stack. (struct lino_undo): New struct type. (free_undo, record_undo, record_triv_undo, restore_undo): New static functions. (edit_insert): Record trivial undo item with record_triv_undo. (edit_insert_str, edit_history_next, edit_delete, edit_backspace, edit_delete_prev_all, edit_delete_prev_word, edit_in_editor): Record undo item. (edit): Record undo item before Ctrl-R history recall and Ctrl-T twiddle. Also record one final undo item upon Enter, as well as Ctrl-C. New Ctrl-O command to undo. (lino_copy): Do not copy undo_stack, to prevent double freeing. (lino_free): Free the undo history. * txr.1: Documented.
* linenoise: visual select and clipboard copy/paste.Kaz Kylheku2015-09-201-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * linenoise/linenoise.c (struc lino_state): New member, clip, sel, end, dsel, dend, need_refresh, selmode. (sync_data_to_buf): Update the sel and end members of the structure based on dsel and dend, the way pos is being updated from dpos. (refresh_singleline, refresh_multiline): If visual selection mode is in effect, show the selected region in inverse video. (update_sel, clear_sel, yank_sel, delete_sel): New static function. (edit_insert): Delete the selection before inserting, so that the character appears to replace the selection. Set need_refresh flag instead of calling refresh_line. (edit_insert_str): New static function. Inserts string, replacing existing selection, if any. (paren_jump, edit_move_left, edit_move_right, edit_move_home, edit_move_end, edit_history_next): Set new need_refresh flag instead of calling refresh_line directly. (edit_delete): If selection is in effect, just delete the selection and return. Set need_refresh flag instead of calling refresh_line. (edit_backspace): If selection is in effect, and selection is not inverted (cursor is to the right of selection) then just delete the selection. Otherwise delete the selection, and perform the backspace. Set need_refresh flag instead of calling refresh_line. (edit_delete_prev_word): Delete the selection and the word before the selection. Set need_refresh flag instead of calling refresh_line. (edit_in_editor): Set need_refresh_flag instead of calling refresh_line, and cancel visual selection mode. (edit): Clear selection mode on entry. Update the selection variables on each loop iteration. Honor the need_refresh flag. New commands implemented: Ctrl-S, Ctrl-Q, Ctrl-X Ctrl-Q. Some commands need to set need_refresh flag. Some need to cancel selection mode. (lino_copy): Set the clip member of the cloned structure to null, otherwise there will be a double free of the clipboard buffer. (lino_cleanup): Free the clipboard and null out the pointer. * txr.1: Documented visual select.
* Adding flatcar* function.Kaz Kylheku2015-09-191-9/+13
| | | | | | | | | | | | * eval.c (eval_init): Registered flatcar* intrinsic. * lib.c (lazy_flatcar_scan, lazy_flatcar_func): New static functions. (lazy_flatcar): New function. * lib.h (lazy_flatcar): Declared. * txr.1: Documented, also touching flatten documentation.
* Atom insert feature.Kaz Kylheku2015-09-181-0/+19
| | | | | | | | * parser.c (provide_atom): New static function. (repl): Register provide_atom with linenoise as atom callback. * txr.1: Documented.