summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
...
* doc: bad formatting in make-struct-typeKaz Kylheku2017-07-091-1/+1
| | | | | * txr.1: Remove spurious parenthesis in syntax synopsis of make-struct-type.
* doc: fixes under window-map.Kaz Kylheku2017-07-081-2/+2
| | | | | * txr.1: grammar fix: S-V number agreement. Add missing number 2.
* doc: fix spurious trailing comma in heading.Kaz Kylheku2017-07-081-1/+1
| | | | | * txr.1: Fix "FFI types short ... long, ulong," to "FFI types short ... long and ulong".
* doc: fix inappropriate code/codn in FFI types.Kaz Kylheku2017-07-081-6/+6
| | | | | * txr.1: In some parametrized type descriptions, a parameter is typeset using .code or .codn rather than .meta or metn.
* doc: C and POSIX types, sections with heading.Kaz Kylheku2017-07-081-31/+9
| | | | | | * txr.1: the additional types are given proper headings so the identifiers are cross referenced and appear in the TOC.
* doc: change Buffers heading.Kaz Kylheku2017-07-081-4/+9
| | | | | | * txr.1: This change to the buffers heading causes the buf identifier to be cross-referenced, which is useful to people browsing the FFI section. Fixing some wording too.
* doc: merge redundant sections on cptr.Kaz Kylheku2017-07-081-33/+28
| | | | | * txr.1: The FFI cptr type is described in two separate sections. These are merged and duplication removed.
* doc: subdivide FFI-related functionsKaz Kylheku2017-07-081-1/+33
| | | | | * txr.1: The functions and macros in FFI are divided into logical groups with own section headings.
* doc: FFI restructured.Kaz Kylheku2017-07-071-57/+140
| | | | | | | | PDF page count hits 600! * txr.1: FFI becomes a major SH section. The FFI types become separate numbered paragraphs with headings. Parametrized types look function-like with Syntax headings.
* doc: fun operator has way to see macros.Kaz Kylheku2017-07-071-1/+11
| | | | | | * txr.1: Clarify an otherwise misleading text. It's true that the fun operator doesn't resolve macros via straight symbol names, but it does do so via (macro <name>) syntax.
* doc: document function names in compound forms.Kaz Kylheku2017-07-071-0/+4
| | | | | * txr.1: Under Compound Forms, specify what is a function name.
* Lisp: lambda expressions are function names now.Kaz Kylheku2017-07-071-8/+23
| | | | | | | | | | | | | | | | | | | * eval.c (lookup_fun): With this two-liner change, the forms ((lambda (x) x) 42) and (fun (lambda ())) just work. This is not just compatibility with other dialects; it is necessary for consistency with func-get-name, which already returns lambda expressions, effectively asserting that they are function names. * txr.1: Fix documentation for fun operator. The Dialect Note saying that a lambda expression is not a function name in TXR Lisp is removed. Document that function names may be any of those produced by func-get-name. This has already been true for macros and methods, just not for lambda expressions. Under fun-get-name, document that lambda expressions are produced for interpreted functions not found in any binding by the previous searches.
* doc: mention syntax for calling methods.Kaz Kylheku2017-07-071-2/+21
| | | | | | * txr.1: The recommendation to use call-super-fun is rounded out by mentioning that the (meth ...) syntax can achieve the same thing. An example of it is added under call-super-fun.
* doc: fix call-super-fun error and add example.Kaz Kylheku2017-07-071-1/+23
| | | | | | * txr.1: call-super-fun method intro paragraph wrongly refers to call-super-method. Adding example about how to call a base class method.
* doc: deprecate call-super-method.Kaz Kylheku2017-07-071-1/+16
| | | | | | | * txr.1: Recommend call-super-fun for calling a base class method. Mark call-super-method deprecated, and add a Note about why it's not correct to use it for the purpose of calling a base method.
* ffi: relaxation in cptr put semantics.Kaz Kylheku2017-07-021-0/+8
| | | | | | | | | | | | For convenience, we allow a cptr to be converted to foreign representation even if its tag doesn't match the FFI type being used for the conversion. This is allowed only in the case that the cptr is a null pointer, and its tag is nil. * lib.c (cptr_handle): Defeat the type check if the pointer is null, and its tag is nil. Thus, the FFI variable cptr-null will conveniently convert to any cptr type in the ffi_cptr_put operation and others.
* ffi: new make-zstruct function and znew macro.Kaz Kylheku2017-07-021-0/+128
| | | | | | | | | | | | | * ffi.c (make_zstruct): New function. (ffi_init): Register make-zstruct instrinsic. * ffi.h (make_zstruct): Declared. * lisplib.c (ffi_set_entries): Add znew to autload list. * share/txr/stdlib/ffi.tl (znew): New macro. * txr.1: Documented make-zstruct and znew.
* Version 181.txr-181Kaz Kylheku2017-07-011-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim, protsym.c: Regenerated.
* ffi: new ffi-type-operator-p and ffi-type-p.Kaz Kylheku2017-06-301-0/+35
| | | | | | | | | | * ffi.c (ffi_type_operator_p, ffi_type_p): New functions. (ffi_init): Register ffi-type-operator-p and ffi-type-p intrinsics. * ffi.h (ffi_type_operator_p, ffi_type_p): Declared. * txr.1: Documented.
* doc: formatting of table in awk section.Kaz Kylheku2017-06-301-20/+19
| | | | | | | * txr.1: The table showing fixed-width delimiting examples doesn't use the right font and doesn't look good in HTML or PDF. Let's replace it with just a plain verbatim block, and clarify the leading text also.
* doc: suspend and refresh in editing help.Kaz Kylheku2017-06-301-1/+3
| | | | * txr.1: Document Ctrl-Z and Ctrl-L working in editing help.
* doc: describe cheatsheet command.Kaz Kylheku2017-06-301-0/+11
| | | | | * txr.1: New section "Editing Help" under "Interactive Listener" describing Ctrl-X ?
* ffi: make-union can initialize.Kaz Kylheku2017-06-291-1/+20
| | | | | | | | | | | * ffi.c (make_union): Two arguments added. These are optional. (ffi_init): Update registration of make-union as three-parameter function, with one required arg. * ffi.h (make_union): Declaration updated. * txr.1: Documented.
* doc: fix zipper example under mapcarKaz Kylheku2017-06-291-1/+2
| | | | | * txr.1: Split mapcar "zipper" example into two lines to prevent wrapping and add missing -> between form and output.
* New Cartesian product mapping functions.Kaz Kylheku2017-06-281-0/+112
| | | | | | | | | | * eval.c (prod_common): New static function. (maprodv, maprendv): New functions. (eval_init): Registered maprod and maprend intrinsics. * eval.h (maprodv, maprendv): Declared. * txr.1: Documented.
* ffi: new enumed type operator: enums with base type.Kaz Kylheku2017-06-271-0/+26
| | | | | | | | | | * ffi.c (enumed_s): New symbol variable. (ffi_type_compile): New case for enumed type op. (ffi_init): Initialize enumed_s. * ffi.h (enumed_s): Declared. * txr.1: enumed documented.
* ffi: new macro, deffi-sym.Kaz Kylheku2017-06-261-0/+42
| | | | | | | | * lisplib.c (ffi_set_entries): Add deffi-sym to autload list. * share/txr/stdlib/ffi.tl (deffi-sym): New macro. * txr.1: Documented.
* doc: fix deffi-varKaz Kylheku2017-06-261-5/+44
| | | | | | * txr.1: Provide the correct description of the syntax allowed for var-expr; i.e. that deffi-var can be put into a with-dyn-lib form and all that.
* New cptr functions cptr-cast and int-cptr.Kaz Kylheku2017-06-261-0/+44
| | | | | | | | | | | * eval.c (eval_init): Register new intrinsics cptr-cast and int-cptr. * lib.c (cptr_cast, int_cptr): New functions. * lib.h (cptr_cast, int_cptr): Declared. * txr.1: Documented.
* doc: wrong function name under cptr-obj.Kaz Kylheku2017-06-261-1/+1
| | | | | * txr.1: Fix syntax block under cptr-obj giving function name as cptr-int.
* doc: wrong date for Version 180.Kaz Kylheku2017-06-251-1/+1
| | | | * txr.1: Fix date to 2017-06-25.
* Version 180.txr-180Kaz Kylheku2017-06-251-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim, protsym.c: Regenerated.
* doc: mistake in describing in semantics.Kaz Kylheku2017-06-241-1/+1
| | | | * txr.1: Fix "out operation" that should be "in operation.
* doc: tcsetattr actions arg optiona.Kaz Kylheku2017-06-241-1/+1
| | | | | | | * txr.1: the actions argument of tcsetattr is optional and its defaulting is correctly described. Fix the syntax synopsis which wrongly indicates that it is required.
* doc: glue paragraphs under Symbols and Packages.Kaz Kylheku2017-06-241-1/+0
| | | | | * txr.1: In the Dialect Notes, one of the notes is confusingly split into two paragraphs.
* doc: wording about symbol interning.Kaz Kylheku2017-06-241-6/+6
| | | | | * txr.1: A symbol is not "returned" by the reader; drop that text. Use the terminology that a token is interned.
* ffi: provide longlong and ulonglong types.Kaz Kylheku2017-06-241-0/+8
|
* ffi: provide support for unions.Kaz Kylheku2017-06-231-0/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | * ffi.c (union_s): New symbol variable. (ffi_find_memb, ffi_memb_not_found): New static functions. (ffi_union_in, ffi_union_put, ffi_union_get): New static functions. (make_ffi_type_union): New static function. (ffi_struct_compile): Handle union syntax using ffi_struct_compile to compile the member definitions to types, and make_ffi_type_union to produce the type node. (struct uni): New struct type. (uni_struct, uni_struct_checked): New static functions. (union_destroy_op, union_mark_op): New static functions. (union_ops): New static struct. (make_union_common, make_union_tft): New static functions. (union_get_ptr, make_union, union_members, union_get, union_put, union_in, union_out): New functions. (ffi_init): Initialize union_s. Register intrinsics make-union, union-members, union-get, union-put, union-in, union-out. * ffi.h (union_s, union_get_ptr, make_union, union_members, union_get, union_put, union_in, union_out): Declared. * txr.1: Documented unions.
* ffi: bool type.Kaz Kylheku2017-06-201-0/+60
| | | | | | | | | | | | * ffi.c (bool_s): New symbol variable. (ffi_bool_put, ffi_bool_get): New static functions. (ffi_type_compile): Handle (bool <type>) parametrized type. (ffi_init_types): Register bool typedef for (bool uchar). (ffi_init): Initialize bool_s. * ffi.h (bool_s): Declared. * txr.1: Documented.
* cptr-int and cptr-obj can make typed cptr objects.Kaz Kylheku2017-06-191-3/+113
| | | | | | | | | | | | | | | | | * eval.c (eval_init): Update registration of cptr-int and cptr-obj with one optional argument. * lib.c (cptr_int): New type symbol argument, defaulting to nil. Also, don't bother defaulting the integer argument; the function isn't registered for that being optional. (cptr_obj): New type symbol argument, defaulting to nil. * lib.h (cptr_int, cptr_obj): Declarations updated. * txr.1: Documented cptr-int and cptr-obj function changes. Added discussion of type tag to introductory paragraph. Also added neglected documentation of the FFI cptr type, both unparametrized and parametrized.
* awk macro: bugfix: :output file stream not closed.Kaz Kylheku2017-06-191-0/+32
| | | | | | | | | | | | | | | | | | In the case when the :output clause of the awk macro opens a stream, it isn't closing it. Why don't we treat such a stream uniformly with redirections. * share/txr/stdlib/awk.tl (sys:awk-state :postinit): If a file is opened for output, then don't just install this file as self.output. Also place it into the self.streams hash, identified by using the key (:outf <name>), just like a (-> "name") redirection. This ensures that it will be closed when the awk macro terminates. It's also potentially useful in that output redirections referring to the name will use the same stream. * txr.1: Documented that streams opened by :output are closed, and that they are treated uniformly with redirections.
* Version 179.txr-179Kaz Kylheku2017-06-181-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim, protsym.c: Regenerated.
* listener: inform linenoise of incomplete syntax.Kaz Kylheku2017-06-161-6/+19
| | | | | | | | | | | | | | Multi-line expressions can now be entered just using Enter for line breaks without Ctrl-V. Multi-line mode becomes default. * parser.c (is_balanced_line): New static function. (repl): Install is_balanced_line as enter callback in linenoise object. (parse_init): Default *listener-multi-line-p* variable to t. * txr.1: Documentation about multi-line mode updated.
* New length method on structures.Kaz Kylheku2017-06-161-2/+48
| | | | | | | | | | | | | | | | With this change, nreverse is possible on a struct, if it has lambda, lambda-set and length methods. * lib.c (length_s): New symbol variable. (length): Check for length method and call it, in preference to checking for car method and falling back on cdr-based length. (empty): If object has a length method, call it and compare result to zero. (obj_init): Initialize length_s. * txr.1: Documented. We now have the concepts of structs being vector-like sequences or list-like sequences.
* Support ref, refset on structs via lambda, lambda-set.Kaz Kylheku2017-06-161-0/+18
| | | | | | | | | | | * lib.c (ref, refset): Check for lambda and lambda-set, respectively, and use it. * txr.1: Documented. * tests/012/aseq.tl (add lambda): Fix previously unused broken method which now causes test to go into infinite recursion.
* ffi: copy-carray, hooked into copy.Kaz Kylheku2017-06-151-0/+25
| | | | | | | | | | | | * ffi.c (copy_carray): New function (ffi_init): Register copy-carray intrinsic. * ffi.h (copy_carray): Declared. * lib.c (copy): Call copy_array for carray objects. * txr.1: Documented copy-carray and updated copy description.
* ffi: new put-carray and fill-carray functions.Kaz Kylheku2017-06-151-0/+39
| | | | | | | | | | * ffi.c (put_carray, fill_carray): New functions. (ffi_init): put-carray and fill-carray intrinsics registered. * ffi.h (put_carray, fill_carray): Declared. * txr.1: Documented.
* ffi: new integer-carray conversion functions.Kaz Kylheku2017-06-141-0/+97
| | | | | | | | | | | | * ffi.c (carray_unum, carray_num, unum_carray, num_carray): New functions. (ffi_init): New intrinsics registered: carray-unum, carray-num, unum-carray, num-carray. * ffi.h (carray_unum, carray_num, unum_carray, num_carray): Declared. * txr.1: Documented.
* ffi: turn carray-sub into accessor.Kaz Kylheku2017-06-131-1/+8
| | | | | | | | | | | | | | | | * lisplib.c (ffi_set_entries): Register carray-sub for autoload. * share/txr/stdlib/ffi.tl (carray-sub): New place macro, aliases to sub. This is not 100% correct since that means it will admit non-carray objects, but the alternative is to clone the entire sub expander with a few changes, or else factor out sub expansion into a shared routine. Bleh ... * txr.1: Documented. We don't cover up the ruse we perpetrated, and reveal that it's just a place macro targetting sub.
* Version 178.txr-178Kaz Kylheku2017-06-121-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim, protsym.c: Regenerated.