summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* doc: make-struct-type postinitfun: outdated text.Kaz Kylheku2017-07-091-9/+11
| | | | | | | | * txr.1: Replace description of make-struct-type's postinitfun argument which was still claiming that the calls are in opposite order relative to initfun calls. That changed after TXR 148 but was documented only for defstruct. Also updating the compat note for 148.
* 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: put [+]/[-] open/collapse markers on right.Kaz Kylheku2017-07-081-3/+3
| | | | | | | * genman.txr (closedtxt, opentxt): Add leading space. In TOC filtering code, insert the toggle elements just before the closing </dt> rather than before opening <a>.
* 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.
* expander: fix neglect to expand lambda and fun.Kaz Kylheku2017-07-071-4/+15
| | | | | | | | | | | | | Now that lambda expressions are supported as function names in the first position of a compound expression and as an argument to the fun operator, it will greatly behoove us if we expand them properly. Then tests/012/quine.tl will pass. * eval.c (do_expand): Handle fun specially. If the argument is a lambda expression, then expand that and generate an expanded fun form, otherwise just yield form. When expanding function calls, check whether the first argument is a lambda and expand it.
* tests: add lambda quine tests.Kaz Kylheku2017-07-072-0/+17
| | | | | | | | The tests fail as of this commit. * tests/012/quine.expected: New file. * tests/012/quine.tl: New file.
* 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-072-8/+25
| | | | | | | | | | | | | | | | | | | * 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.
* structs: tighten call-super-fun behavior.Kaz Kylheku2017-07-071-3/+5
| | | | | | | | * struct.c (call_super_fun): Do not allow type to be a struct instance, which is a consequence of the super function being used. The documentation says that the argument is a type and mentions no possibility of it being an instance. Allowing a struct invites mistakes.
* structs: get tests/012/stslot.tl to pass.Kaz Kylheku2017-07-051-10/+7
| | | | | | | | | | | | | | | * struct.c (static_slot_rewrite_rec): A simple rearrangement: switch to postorder traversal, doing the derived structs first, then this struct. Why does this fix a bug? Because when the assignment *s = *to occurs for the node at the root of the recursion, s and from point to the same object. And so the assignment alters from, which is the search key. When the children are then processed, the search key doesn't match anything: it now looks like the to slot that the children are supposed to get, and so they don't have it, of course. So in other words the slot being rewritten is not found in the derived types and not rewritten there as it should be.
* structs: new tests for static-slot-ensure.Kaz Kylheku2017-07-052-0/+23
| | | | | | * tests/012/stslot.expected: New file. * tests/012/stslot.tl: New file. b/tests/012/stslot.tl
* structs: bugfix in static-slot-ensure.Kaz Kylheku2017-07-051-1/+1
| | | | | | | | | | | | | | | | * struct.c (static_sot_ens_rec): This change is in the case when a static slot is being ensured in a struct type which already has that static slot by inheritance. In that situation, the inheritance is severed and the struct gets its own non-inherited slot of that name. Then all of the derived structs are scanned. If any contain the original inherited slot, it is updated to the new, non-inherited one. The bug here is that we were copying the home_offs field of the original inherited slot to the new one! This is wrong; the new slot is not related to the original inherited one. The new slot is a home slot and its own offset must be home_offs. We can calculate that simply as its delta from the static slot table base.
* configure: libffi test fixes.Kaz Kylheku2017-07-051-3/+2
| | | | | | | | | Fixes from review by Joe Eib. * configure: switch polarity of main return value, so it doesn't appear confusing, even though the test program is never run. Remove stray "set -x" command. Fix wrong use of nonexistent EXTRA_CFLAGS which should be EXTRA_FLAGS.
* configure: deal with non-standard libffi installations.Kaz Kylheku2017-07-042-0/+29
| | | | | | | | | | | | | | | | | This addresses a failure to build with libffi on Arch Linux, reported by Joe Eib. * Makefile (opt/ffi.o, dbg/ffi.o): Pull LIBFFI_CFLAGS into TXR_CFLAGS for just these object files. * configure (have_pkgconfig, libffi_cflags): New variables. (gen_config_make): Create new Makefile variable, LIBFFI_CFLAGS, from libffi_cflags. New configure test to detect pkg-config. Libffi test falls back on using pkg-config to test for existence of the library and to get the cflags and ldflags. Any needed cflags end up in LIBFFI_CFLAGS and are used only when compiling ffi.c.
* ffi: relaxation in cptr put semantics.Kaz Kylheku2017-07-022-5/+18
| | | | | | | | | | | | 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-025-0/+182
| | | | | | | | | | | | | * 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-017-838/+919
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim, protsym.c: Regenerated.
* genvim: include ffi type symbols.Kaz Kylheku2017-06-301-2/+4
| | | | | | * genvim.txr: do syntax coloring for symbols that are defined as FFI types or are FFI type operators. Also, include type operators in the Vim lispwords list.
* genvim: remove useless code.Kaz Kylheku2017-06-301-4/+0
| | | | | | | | | * genvim.txr: remove code which probes a few symbols with boundp. The point of this is to stimulate some autoloading, but it is based on a misunderstanding. The symbols in the lisplib.c autoload module are all interned. When the usr package is walked, they all get checked with boundp, and all all library autoloads are triggered.
* ffi: new ffi-type-operator-p and ffi-type-p.Kaz Kylheku2017-06-303-0/+55
| | | | | | | | | | * 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.
* linenoise: support suspend and refresh in help.Kaz Kylheku2017-06-301-0/+11
| | | | | | * linenoise/linenoise.c (show_help): Handle Ctrl-Z and Ctrl-L commands, ensuring that the display stays on the same page when these are processed.
* doc: describe cheatsheet command.Kaz Kylheku2017-06-301-0/+11
| | | | | * txr.1: New section "Editing Help" under "Interactive Listener" describing Ctrl-X ?
* ffi: fix more bugginess in struct bitfield allocation.Kaz Kylheku2017-06-291-2/+2
| | | | | | | | | * ffi.c (make_ffi_type_struct): Fix incorrect shift calculations, which are still being done from the unit_offs byte rather than the correct offs byte where the bitfield is actually placed. It is bit_offs which has the correct bit offset of the bitfield relative to offs.
* ffi: make-union can initialize.Kaz Kylheku2017-06-293-5/+33
| | | | | | | | | | | * 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.
* ffi: fix union printing as struct.Kaz Kylheku2017-06-291-1/+1
| | | | | * ffi.c (ffi_type_compile): Syntax for union type wrongly using struct symbol rather than union.
* 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.
* ffi: fix bool printing as integer type.Kaz Kylheku2017-06-291-1/+1
| | | | | | * ffi.c (ffi_type_compile): Assign full bool syntax to cloned type, rather than just the argument syntax denoting the base type.
* ffi: reject bitfields as arguments or return values.Kaz Kylheku2017-06-291-0/+6
| | | | | * ffi.c (ffi_make_call_desc): Throw error if argument or return value is a bitfield.
* ffi: tighten syntax validation in type compiler.Kaz Kylheku2017-06-291-2/+46
| | | | | * ffi.c (ffi_type_compile): Check for too few or too many arguments in a compound form.
* New Cartesian product mapping functions.Kaz Kylheku2017-06-283-0/+173
| | | | | | | | | | * 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-273-2/+40
| | | | | | | | | | * 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: prepare for variably sized enum implementation.Kaz Kylheku2017-06-271-17/+26
| | | | | | | | | | | | | | | | | | | This lays the groundwork for enumerations based off types other than int. All we need to do is implement the syntax for this. * ffi.c (ffi_enum_put, ffi_enum_get, ffi_enum_rput, ffi_enum_rget): Retrieve the element type descriptor and recurse into its put, get, rput and rget operation, respectively, instead of hard-coded calls to the int operations. (make_ffi_type_enum): New argument, base_type. Numerous properties of the enum type are taken from base_type: the FFI type, the alignment, size, and alloc, free and clone operations. The base type is installed as eltype. (ffi_type_lookup): Static function relocated. (ffi_type_compile): In the enum case, resolve the int type and pass to make_ffi_type_enum.
* ffi: bugfix: diagnostic problems in enum put.Kaz Kylheku2017-06-271-6/+8
| | | | | | * ffi.c (ffi_enum_put, ffi_enum_rput): Fix function name appearing in quotes in error diagnostic. Fix nonexistent member being wrongly reported as nil.
* ffi: add missing rput/rget ops for big endian.Kaz Kylheku2017-06-271-0/+35
| | | | | | | | | | | | We either mishandle return values, or crash due to a null rput/rget function pointers on aggregate types and bools. * ffi.c (ffi_bool_rput, ffi_bool_rget): New static functions. (make_ffi_type_pointer, make_ffi_type_struct, make_ffi_type_union, make_ffi_type_array): Fill in rput and rget. (ffi_type_compile): Fill in rget and rput for bool with new functions.
* ffi: fix incorrect null-terminated array in op.Kaz Kylheku2017-06-271-3/+4
| | | | | | | | | * ffi.c (ffi_varray_null_term_in): Rewrite nonsensical code that refers to the newly created empty output array as input. We must perform the in semantics on all the original elements. Then get semantics on any new elements if the array was extended, and the copy flag is true (by-ref nuance).
* ffi: new macro, deffi-sym.Kaz Kylheku2017-06-263-3/+57
| | | | | | | | * 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.