summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* buf: new bufp function.Kaz Kylheku2017-06-121-0/+16
| | | | | | | | | * buf.c (bufp): New function. (buf_init): Registered bufp intrisic. * buf.h (bufp): Declared. * txr.1: Documented.
* awk macro: new fconv conversions c and cz.Kaz Kylheku2017-06-121-3/+18
| | | | | | | | | | * share/txr/stdlib/conv.tl (sys:conv-let): New local functions c and cz, using the new #\c radix conversion. * txr.1: Documented new extension under the fconv awk macro. Also fixed a typo here; the b conversion was exemplified as (c str).
* int-str: allow radix to be #\c for C conventions.Kaz Kylheku2017-06-121-4/+28
| | | | | | | | | * lib.c (int_str): Support #\c base, recognizing 0x as hex and leading 0 as octal. We don't rely on the wcstol function's ability to do this conversion, but scan it ourselves. * txr.1: Documented.
* doc: document bracket notation for carray and buf.Kaz Kylheku2017-06-121-1/+25
| | | | | * txr.1: Put carray and buf cases into the description of the indexing notation under the dwim operator.
* ffi: add carrayp function.Kaz Kylheku2017-06-121-0/+16
| | | | | | | | | * ffi.c (carrayp): New function. (ffi_init): Register carrayp intrinsic. * ffi.h (carrayp): Declared. * txr.1: Documented.
* ffi: new carray-replace function.Kaz Kylheku2017-06-111-0/+77
| | | | | | | | | | | | | | Thanks to this (set [ca from..to] list) works. * ffi.c (carray_replace): New function. (ffi_init): Register carray-replace intrinsic. * ffi.h (carray_replace): Declared. * ffi.c (replace): Hook in carray_replace. * txr.1: Mention carray under replace, and document carray-replace.
* ffi: new function, carray-pun.Kaz Kylheku2017-06-111-0/+38
| | | | | | | | | * ffi.c (carray_pun): New function. (ffi_init): Registered carray-pun intrinsic. * ffi.h (carray_pun): Declared. * txr.1: Documented.
* ffi: handle sub operation in carray.Kaz Kylheku2017-06-111-1/+90
| | | | | | | | | | | | | | | | Thus, [ca 3..5] syntax works for slice extraction. However, this works referentially, not by making a copy. The extracted subarray points to the original memory, until carray-dup is invoked on it. * ffi.c (carray_sub): New function. (ffi_init): carray-sub intrinsic registered. * ffi.h (carray_sub): Declared. * lib.c (sub): Handle carray via carray_sub. * txr.1: Documented changes in sub.
* ffi: support sel operation on carray.Kaz Kylheku2017-06-111-7/+18
| | | | | | | | | | | | | | | | | | | | Thus (select ca '(0 3 4 ...)) works and so does the sytnax [ca '(0 3 4 ...)]. This is inefficiently implemented. The selected elements are extracted to a list which is then converted to a carray of the same kind agan. * ffi.c (carray_list): New function. (ffi_init): Register carray-list intrinsic. * ffi.h (carray_list): Declared. * lib.c (make_like): Add carray case, so we can turn a list into a carray based on an example carray. This uses carray_list, with the type pulled from the original carray. The target isn't null terminated. (sel): Handle carray via vector case. * txr.1: Document changes in select and make-like.
* length function supports carray.Kaz Kylheku2017-06-111-0/+6
| | | | | | * lib.c (length): Handle COBJ of carray type. * txr.1: Documented.
* doc: document length for buf.Kaz Kylheku2017-06-111-10/+13
| | | | | * txr.1: Restructure the length documentation to use definition-style paragraphs, and add buf.
* ffi: new carray-get and carray-put functions.Kaz Kylheku2017-06-101-0/+62
| | | | | | | | | | | | | | | | | * ffi.c (struct carray): New member, artype. (carray_mark_op): Mark artype member. (make_carray): Initialize artype to nil. (carray_ensure_artype, carray_get_common, carray_put_common): New static functions. (carray_get, carray_getz, carray_put, carray_putz): New functions. (ffi_init): Register intrinsics carray-get, carray-getz, carray-put, carray-putz. * ffi.h (carray_get, carray_getz, carray_put, carray_putz): Declared. * txr.1: Documented new functions.
* doc: carray corrections.Kaz Kylheku2017-06-091-7/+12
| | | | | * txr.1: forgotten documentation added: the carray-own function can't be used on a carray which references a buf.
* awk macro: fix broken rng.Kaz Kylheku2017-06-071-0/+7
| | | | | | | | | | | | | | | Bug: rng fails to activate when the to and from condition are true for the same record. * share/txr/stdlib/awk.tl (sys:awk-mac-let): Rename the flag-new gensym holder to flag-act, since it indicates whether the range is active, either from before or due to being activated by the current record. A new gensym is added to indicate whether the range is being deactivated in this record. The inclusive rng range refers to this variable rather than flag-old. But a bug emulation is provided to refer to the wrong variable. * txr.1: Added compatibility note.
* Version 177.txr-177Kaz Kylheku2017-06-071-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim, protsym.c: Regenerated.