summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Useful feature: object post-initialization.Kaz Kylheku2015-12-168-18/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Structs can now have code which executes after an object is initialized, which is useful for doing work like registering objects in global lists and whatever, when those actions need access to the initialized slots of the object. * share/txr/stdlib/struct.tl (defstruct): Handle :posinit syntax, by generating lambda as eighth argument of sys:make-struct call. * struct.c (struct struct_type): New member, postinitfun. (struct_init): Adjust registrations of make_struct_type to account for new parameter. The user visible make-struct-type is registered as having one optional argument, for backward compat. (make_struct_type): New argument, postinitfun. Store this in the structure. For backward compatibility, the argument is defaulted. (struct_type_mark): Mark the new postinitfun member. (call_postinitfun_chain): New static function. (make_struct, lazy_struct_init): Call call_postinitfun_chain after slots are initialized, and after the boa function is called. * struct.h (make_struct_type): Declaration updated. * lib.c (time_init): Pass eighth argument to make_struct type. * sysif.c (sysif_init): Likewise. * unwind.c (uw_late_init): Likewise. * tests/012/struct.tl: Update defstruct expansion test case. * txr.1: Document new argument of make-struct-type, and clarify ordering of initfun with regard to other actions. Likewise, document :postinit, and clarify ordering of :init actions with regard to other actions.
* Support eight-argument intrinsic functions.Kaz Kylheku2015-12-162-1/+53
| | | | | | | | | | * lib.h (enum functype): New member, N8. (struct func): New members n8 and n8v in embedded f struct. (func_n8, func_n8v, func_n70, func_n8o): Declared. * lib.c (equal): Handle N8 in switch. (func_n8, func_n8v, func_n70, func_n8o): New functions. (generic_funcall): Handle N8 in two switches.
* bugfix: dwim_set not handling hash correctly.Kaz Kylheku2015-12-161-0/+4
| | | | | | | | * lib.c (dwim_set): When the range argument is a vector or list, it is wrongly hangled through replace, even if seq is a hash. replace throws since it doesn't handle hashes. We must treat the vector or list as a hash key and handle through sethash.
* bugfix: nil from in replace wrongly treated as 0.Kaz Kylheku2015-12-161-6/+6
| | | | | | | * lib.c (replace_list, replace_str, replace_vec): The from argument must be checked to be a list using listp not consp. The legacy convention that nil is treated as missing does not work in this function as it does in sub.
* HTML doc: markup in lower case.Kaz Kylheku2015-12-152-46/+46
| | | | | | | | Requires updated man2html which puts out lower case. * genman.txr: All matched and generated HTML is lower case. * txr.1 (NP*): Use lower case h4 tag in M2SS macro.
* HTML doc: fix back jumping flaw.Kaz Kylheku2015-12-141-5/+13
| | | | | | | | | | | | | Issue: wrong [+] changes to [-], leading to inconsistent state. * genman.txr: In TOC extraction and transformation, we fix the stupid broken <DT>....<DD> that man2html puts out and turn it into <DT>...</DT>. This way a DL now has a DT element as its previous sibling. (tocjump): When we see a DL now, we get the correct element which has the expand/collapse: the previous sibling which is a DT containing the anchor.
* Improved documentation of macro parameter lists.Kaz Kylheku2015-12-141-18/+64
| | | | | | * txr.1: Improved wording, better explanation, explanation that nested macro lists support all features, and specified meaning of :whole inside nested lists.
* Allow :whole and :form to do destructuring.Kaz Kylheku2015-12-141-7/+15
| | | | | | | | | * eval.c (bind_macro_params): Remove the restriction that the :whole and :form do not allow a destructuring pattern, requring strictly a symbol. Common Lisp's &whole also does destructuring. As a side effect of this change, the :env parameter also supports destructuring, thought this isn't going to be meaningful since macro environments aren't lists.
* Pluralization under Equality Substitution.Kaz Kylheku2015-12-131-1/+1
| | | | * txr.1: "unless they are the same object."
* Clean up formatting in conventions section.Kaz Kylheku2015-12-131-26/+5
| | | | | | | | txr.1: Lose the useless use of conditional evaluation. Everything is doable with the meIP macro. Only one piece of conditional evaluation is needed for different wording: textual man page says "angle brackets" whereas formatted page refers to italic font.
* Handle browsers with JS disabled.Kaz Kylheku2015-12-131-0/+3
| | | | | * genvim.txr: Below Contents, place a note for users who have disabled Javascript.
* Remove redundant title tag.Kaz Kylheku2015-12-131-1/+1
| | | | | * genvim.txr: For some reason, we were generating a second <title> tag, with different contents.
* HTML doc: expand TOC section on jumpback.Kaz Kylheku2015-12-121-2/+21
| | | | | | | | | | | | When a section number is clicked, if the table of contents section which contains it is collapsed, open it, and its parents. * genman.txr: (tocjump): New JS function. add onclick action to jump-back links, which calls tocjump JS function which does the expansion. The name anchor entries in the TOC are tagged with a "tocanchor: class so they can be more specifically selected by the tocjump function.
* HTML doc: jump back to TOC feature.Kaz Kylheku2015-12-121-2/+5
| | | | | | | | | Section numbers are now hyperlinks which jump back to their respective table of contents entry. * genman.txr (toc-tag): New function. Generate link anchors into section titles. Generate name anchors in TOC.
* Fix example under conda.Kaz Kylheku2015-12-121-1/+1
| | | | * txr.1: Remove spurious z in example.
* Improvement in type tree diagram.Kaz Kylheku2015-12-121-4/+8
| | | | | * txr.1: Structures move under cobj types, which are indicated with angle brackets to show they are not programmer-visible.
* Update typeof documentationKaz Kylheku2015-12-121-3/+19
| | | | * txr.1: more types are listed under typeof.
* Formatting under func-get-name.Kaz Kylheku2015-12-111-1/+1
| | | | * txr.1: Misuse of << in syntax block.
* symbol-function semantics change; new symbol-macro.Kaz Kylheku2015-12-103-45/+180
| | | | | | | | | | | | | | | | | | | | | | | * eval.c (symbol_function): Only retrieve function binding, and not macro or operator bindings, unless compatibility <= 127 is in effect. (symbol_macro): New function. (fboundp): Only test for existence of function, not macro or operator, unless <= 127 compatibility is in effect. (fmakunbound): Do not remove macro binding, unless compatibility <= 127 is in effect. (eval_init): Register sys:top-mb variable for use in place.tl library module. Register symbol-macro intrinsic function. * share/txr/stdlib/place.tl (sys:get-mb): New function (symbol-macro): New syntactic place. * txr.1: Updated incorrect documentation about environments from the perspective that macros and functions coexist. Documented symbol-macro. Updated symbol-function, fboundp and fmakunbound documentation. Added missing documentation for mmakunbound. Reference to fboundp under define-place-macro revised to mboundp. Added compatibility notes.
* Change representation of top-level macro bindings.Kaz Kylheku2015-12-101-6/+8
| | | | | | | | | | * eval.c (expand_macro): The expander argument is now a macro binding, which is a cons cell for built-in macros written in C also, not only for Lisp-defined macros. (symbol_function): Dereference macro binding. (reg_mac): Construct cons cell binding for built-in macro instead of sticking it into the table directly.
* Version 127.txr-127Kaz Kylheku2015-12-096-284/+330
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Solaris issue detecting ftello/fseeko.Kaz Kylheku2015-12-091-0/+4
| | | | | * configure: re-test for ftello with _LARGEFILE_SOURCE and add to lang_flags if that works.
* Solaris issue: ftruncate not detected.Kaz Kylheku2015-12-091-1/+1
| | | | * configure (lang_flags): Add POSIX_C_SOURCE set to 200112.
* Bugfix: crash in get_line.Kaz Kylheku2015-12-091-8/+6
| | | | | | | | | | | Incorrect, irrelevant handle test inside stdio_get_line virtual function fails to detect closed stream, leading to a null pointer passed to the stdio library. * stream.c (snarf_line): Rewrite according to pattern followed by the other functions. We must test h->f for null, not stream->co.handle, which never goes null until the object is being reclaimed by gc.
* Bugfix: incorrect less comparison for ranges.Kaz Kylheku2015-12-091-3/+12
| | | | | * lib.c (less): Missing test for equality before comparing to fields.
* defmeth returns compound method name.Kaz Kylheku2015-12-091-1/+1
| | | | | * share/txr/stdlib/struct.tl (sys:defmeth): Return compound method name as return value: (meth <type> <name>).
* Bugfix: ifa must allow dwim expressions.Kaz Kylheku2015-12-092-8/+25
| | | | | | | | * share/txr/stdlib/ifa.tl (ifa): Accept dwim expressions as the condition. Moreover, treat [f x] as a one-argument call, even though it is the two-argument form (dwim f x). * txr.1: Documented.
* Spacing around major headings early in doc.Kaz Kylheku2015-12-091-1/+2
| | | | * txr.1: Blank line before SYNOPSIS and DESCRIPTION.
* ifa documentation improvementKaz Kylheku2015-12-091-29/+82
| | | | | | | | * txr.1: The ifa rules are organized as numbered clauses. The definition of it-candidate is given up front. Rule 4 is corrected: the it variable is bound to the argument expression, not merely its value. Examples refer to rules and new ones added.
* Fix under ifa.Kaz Kylheku2015-12-081-9/+9
| | | | | * txr.1: Remove text fragment, and clarify treatment of not, null and false.
* Allow defmacros and defuns to co-exist.Kaz Kylheku2015-12-082-3/+14
| | | | | | | | | | | | | | | Already we have the situation that there is an if function and an if macro, and same for and and or. This change allows such situations to be programmer-defined. * eval.c (op_defun): Don't remhash the name from the toplevel macro bindings. (op-defmacro): Don't remhash the name from the toplevel function bindings. * txr.1: Document the permissive behavior as dialect notes under defmacro and defun.
* Adding mboundp and mmakunbound.Kaz Kylheku2015-12-082-3/+25
| | | | | | | | | * eval.c (mboundp, mmakunbound): New static functions. (eval_init): Registering mboundp and mmakunbound intrinsics. * txr.1: Documenting new functions. Also clarifying that fboundp checks for an operator macro binding (not a symbol macro binding).
* New function macro-ancestor.Kaz Kylheku2015-12-082-0/+19
| | | | | | | * eval.c (eval_init): Register lookup_origin as macro-ancestor intrinsic. * txr.1: Documented.
* Update under source-loc-str.Kaz Kylheku2015-12-081-8/+24
| | | | | * txr.1: formatting fix in syntax section. Added explanation that macro expansions inherit source loc info from expander.
* Documentation section restructuring.Kaz Kylheku2015-12-081-43/+47
| | | | | * txr.1: TXR pattern language condensed into fewer sections with deeper nesting. Some sections renamed.
* Clarifications under dwim operator.Kaz Kylheku2015-12-081-24/+46
|
* Remove opinion point of view.Kaz Kylheku2015-12-081-5/+2
| | | | | * txr.1: Under dwim operator, describe [...] notation without asserting that it is preferred.
* Fixes under Consecutive VariablesKaz Kylheku2015-12-081-7/+9
| | | | * txr.1: Tense agreement, clarification. Italicize de facto.
* Replace "discussed" with "described".Kaz Kylheku2015-12-081-13/+13
|
* Wording under sys:abscond-from.Kaz Kylheku2015-12-081-1/+1
| | | | * txr.1: replace colloquial word choice.
* Fix outdated references to .. denoting cons.Kaz Kylheku2015-12-081-14/+12
| | | | | * txr.1: Upgrade text under Callable Objects and Operator dwim.
* remove nonexistent function from synopsis.Kaz Kylheku2015-12-071-1/+1
| | | | | * txr.1: There is no such function as range-regst. This should be search-regst.
* range-regex returns range, not cons.Kaz Kylheku2015-12-073-7/+7
| | | | | | | | | | | * regex.c (range_regex): Return range. (search_regst): Use appropriate accessors on range returned by range_regex. * lib.c (tok_where): Destructure range returned by range_regex, using range_bind. * txr.1: Documented changed behavior.
* HTML doc: add doctype header and content-type.Kaz Kylheku2015-12-071-0/+2
|
* HTML doc: table of contents improvements.Kaz Kylheku2015-12-071-2/+54
| | | | | | * genman.txr: TOC extraction code renames Index to Contents, and adds expand/collapse links. Javascript added to handle expand/collapse.
* Large file support.Kaz Kylheku2015-12-044-11/+116
| | | | | | | | | | | | | | | | | | | | * stream.h (struct strm_ops): seek operation's second argument is now just a val. * stream.c (unimpl_seek, null_seek): Second argument is a val, not cnum, to conform with function pointer in stream structure. (stdio_seek): Accept offset as val, which could be a fixnum or bignum. Use new stdio_ftell and stdio_fseek functions so large values work. (seek_stream): No need to convert offset argument to cnum; pass the val directly to seek virtual function. * sysif.c (off_t_num, num_off_t, stdio_ftell, stdio_fseek): New functions. * sysif.h (OFF_T_MAX, OFF_T_MIN): New preprocessor symbols. (off_t_num, num_off_t, stdio_ftell, stdio_fseek): Declared.
* Configure for large file support.Kaz Kylheku2015-12-031-1/+70
| | | | | | | | | * configure (lang_flags): _XOPEN_SOURCE is bumped from 600 to 700 so that fseeko and ftello are revealed in <stdio.h> by glibc, and off_t is defined there too. New configure tests for fseeko/ftello and for detecting which macro, if any, do we add to lang_flags to enable large file support (64 bit off_t).
* Whitespace issue in configure.Kaz Kylheku2015-12-031-9/+9
| | | | * configure (read_syms): Fix bad indentation.
* static-slot-ensure always processes subtypes.Kaz Kylheku2015-12-012-49/+51
| | | | | | | | | | | * struct.c (static_slot_ensure): Restructured function so that the subtypes of stype are processed even if stype already has the static slot. This way static-slot-ensure can be used to overwrite a static slot value, not only establish one. And thus defmeth can redefine methods. * txr.1: Revamped static-slot-ensure doc, and added notes about redefining to defmeth.
* Bugfix: structs not inheriting late static slot values.Kaz Kylheku2015-12-012-6/+27
| | | | | | | | | | | | | | | | | | | | | | This bug doesn't affect static slots that are defined in defstruct, because those get initialized in the new type by the static init function. The bug is that the values of static slots added later with static_slot_ensure are not inherited by subtypes that are created later still. (Since static_slot_ensure propagates a slot to subtypes which already exist, those types get the slot value.) * struct.c (make_struct_type): Copy the contents of the static slot array of the supertype into the new type, so that static slot values are inherited. We can just use memcpy because the ordering of static slots is the same in the new type, and the inherited ones precede the new ones, due to the way the all_slots list is combined. * txr.1: Clarify inheritance of static slots.