summaryrefslogtreecommitdiffstats
path: root/share
Commit message (Collapse)AuthorAgeFilesLines
* Adding termios support.Kaz Kylheku2016-05-181-0/+78
| | | | | | | | | | | | | | | | * Makefile (termios.o): New object file. * lib.c (init): Call termios_init. * lisplib.c (termios_set_entries, termios_instantiate): New functions. (lisplib_init): Register new functions in autoload table. * share/txr/stdlib/termios.tl: New file. * termios.c, termios.h: New files. * txr.1: Documented termios.
* Version 140.txr-140Kaz Kylheku2016-05-071-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Somew new path access testing functions.Kaz Kylheku2016-05-041-3/+26
| | | | | | | | | | | | | | * lisplib.c (path_test_set_entries): New elements in the list for path-readable-to-me-p, path-read-writable-to-me-p, and path-strictly-private-to-me-p. * share/txr/stdlib/path-test.pl (sys:path-access): Test bitwise combinations of permissions, so read+write can be tested in one call. (path-readable-to-me-p, path-read-writable-to-me-p, path-strictly-private-to-me-p): New functions. * txr.1: Documented.
* Fix: path-writable-to-me bug, for root.Kaz Kylheku2016-05-041-1/+2
| | | | | | | | * share/txr/stdlib/path-test.tl (sys:path-access): Comment added to note use restriction to identical permissions for all three scopes. Fixed incorrect use of logior instead of logand which causes strict permission test to be applied to user even when testing for non-execute permisisons.
* Version 139.txr-139Kaz Kylheku2016-04-221-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Optimization in path-private-to-me-p.Kaz Kylheku2016-04-221-8/+8
| | | | | | | | | * share/txr/stdlib/path-test.tl (path-private-to-me-p): Use mlet to initialize the g variable lazily, so that getgrgid is only called when g is used. getgrid is a fairly heavy-weight function, and it's only used to resolve the case when a file is writable to the group owner (is the user the only member of that group?)
* Put notes into cadr sources that they are generated.Kaz Kylheku2016-04-161-0/+2
| | | | | | * gencadr.txr: Insert notice about generation. * cadr.c, cadr.h, share/txr/stdlib/cadr.tl: Regenerated.
* Version 138.txr-138Kaz Kylheku2016-04-161-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Macros obtain* and obtain*-block.Kaz Kylheku2016-04-151-0/+12
| | | | | | | | | | * lisplib.c (yield_set_entries): Add obtain* and obtain*-block to autoload list. * share/txr/stdlib/yield.tl (obtain*, obtain*-block): New macros. * txr.1: Documented.
* Don't expand replacements of symbol macros.Kaz Kylheku2016-04-121-2/+2
| | | | | | | | | * eval.c (expand_symacrolet, do_expand): Don't expand the replacement form of a global or lexical symbol macro at the time it is bound to its symbol. This is almost certainly wrong in situations where it makes a difference. * txr.1: Noted in compatibility section.
* Fix throw used instead of throwf in defstruct.Kaz Kylheku2016-04-061-9/+9
| | | | | | * share/txr/stdlib/struct.tl (defstruct): Errors about duplicate :init, :postinit or :fini were incorrectly thrown using throw rather than throwf.
* Diagnose bad supertype in defstruct.Kaz Kylheku2016-04-061-1/+6
| | | | | | | * share/txr/stdlib/struct.tl (defstruct): If super isn't nil, it must name an existing struct type, or an exception is thrown. Previously, a nonexistent struct was silently treated as if nil had been specified.
* Define a sock-peer syntactic place.Kaz Kylheku2016-03-311-0/+6
| | | | | | | * share/txr/stdlib/socket.tl (sock-peer): Syntactic place defined, allowing (set (sock-peer sock) addr). * txr.1: Documented sock-peer as accessor and sock-set-peer.
* Version 137.txr-137Kaz Kylheku2016-03-301-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* New macro: lset.Kaz Kylheku2016-03-281-0/+13
| | | | | | | | | * lisplib.c (place_set_entries): Added "lset" to autoload list. * share/txr/stdlib/place.tl (lset): New macro. * txr.1: Documented lset.
* Version 136.txr-136Kaz Kylheku2016-03-201-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Version 135.txr-135Kaz Kylheku2016-03-101-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Version 134.txr-134Kaz Kylheku2016-03-011-1/+1
| | | | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated. * inst.nsi: include .tl files in installer
* Prefix override in IP prefix functions.Kaz Kylheku2016-03-011-12/+13
| | | | | | | | | | | * share/txr/stdlib/socket.tl (sys:str-inaddr-net-impl): New argument weff. Overrides prefix. Bugfix here: we must base the number of octets on the calculated width before wextra is added to it. (str-inaddr-net, str-inaddr6-net): New optional width argument. * txr.1: Documented.
* Fix triple-colon in ipv6 text representation.Kaz Kylheku2016-03-011-18/+17
| | | | | | | | | * share/txr/stdlib/socket.tl (sys:in6addr-condensed-text): New function containing common code. Uses window-mappend to selectively convert a compressed range of zeros to either colon or empty string based on whether it is in the middle or end. (str-in6addr, str-in6addr-net): Use new function.
* Functions for address prefixes to slash notation.Kaz Kylheku2016-02-291-0/+60
| | | | | | | | | | | * lisplib.c (sock_set_entries): Autload entries for str-inaddr-net and str-in6addr-net. * share/txr/stdlib/socket.tl (str-inaddr-net, str-in6addr-net): New functions. * txr.1: Documented str-inaddr, str-in6-addr, str-inaddr-net and str-in6addr-net.
* IP address to string functions.Kaz Kylheku2016-02-291-0/+38
| | | | | | | | * lisplib.c (sock_set_entries): Add str-inaddr and str-in6addr to list of autoload identifiers. * share/txr/stdlib/socket.tl (str-inaddr, str-in6addr): New functions.
* Adding socket support: unix, ipv4, ipv6.Kaz Kylheku2016-02-261-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * socket.c, socket.h: New files. * Makefile: include new socket.o among objects if have_objects variable is defined to 'y'. * configure (have_sockets): New variable. New configure test for socket-related functionality. (HAVE_SOCKETS, HAVE_GETADDRINFO): New configuration preprocessor symbols. Also, reordering the shell probing so that /usr/xpg4/bin/sh is the last fallback. On Solaris, it chokes on some code that is needed for Solaris. * lisplib.c (sock_set_entries, sock_instantiate): New static functions. (lisplib_init): Register new functions as autoload hooks. * share/txr/stdlib/socket.tl: New file. * stream.c (socket_error_s): New symbol variable. (struct stdio_handle): New members, family and type, helping stdio streams represent sockets too. (stdio_stream_mark): Mark new members of struct stdio_handle. (make_stdio_stream_common): Initialize new members. (make_sock_stream, stream_fd, sock_family, sock_type, open_socket, open_sockfd): New functions. (stream_init): Initialize socket_error_s variable. Register sock-family, sock-type and open-socket intrinsic functions. Register socket-error subtype. * stream.h (socket_error_s, make_sock_stream, stream_fd, sock_family, sock_type, open_socket, open_sockfd): Declared.
* Version 133.txr-133Kaz Kylheku2016-01-211-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Version 132.txr-132Kaz Kylheku2016-01-151-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Version 131.txr-131Kaz Kylheku2016-01-121-1/+1
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.
* Version 130.txr-130Kaz Kylheku2016-01-051-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* defstruct: order function slots before other static slots.Kaz Kylheku2016-01-031-15/+17
| | | | | | | | | | | | | | | | | This allows the initializer expressions for static slots to instantiate objects, and those instances can rely on methods being set up. * share/txr/stdlib/struct.tl (sys:prune-nil-inits): Recognize :function keyword as denoting a static slot. (defstruct): Represent methods and functions as (:function ...) items rather than (:static ...) so they can be distinguished. Function slots appear before other static slots in the static slot list, and their initializing code is placed into the the static-initfun lambda of the sys:make-struct-type call in this order. * txr.1: Documented.
* Better bad slot syntax diagnostic in defstruct.Kaz Kylheku2016-01-031-1/+4
| | | | | | * share/txr/stdlib/struct.tl (defstruct): Issue different error message for a slot specifier which isn't a symbol, and wasn't recognized as a special syntax.
* Copyright year bump.Kaz Kylheku2015-12-3112-12/+12
| | | | | | | | | | | | | | | | | | | | | | | * LICENSE, METALICENSE, Makefile, args.c, args.h, arith.c, arith.h, cadr.c, cadr.h, combi.c, combi.h, configure, debug.c, debug.h, eval.c, eval.h, filter.c, filter.h, gc.c, gc.h, glob.c, glob.h, hash.c, hash.h, jmp.S, lib.c, lib.h, lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h, parser.l, parser.y, rand.c, rand.h, regex.c, regex.h, share/txr/stdlib/cadr.tl, share/txr/stdlib/except.tl, share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl, share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl, share/txr/stdlib/struct.tl, share/txr/stdlib/txr-case.tl, share/txr/stdlib/type.tl, share/txr/stdlib/with-resources.tl, share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl, signal.c, signal.h, stream.c, stream.h, struct.c, struct.h, sysif.c, sysif.h, syslog.c, syslog.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h: Add 2016 copyright. * linenoise/LICENSE, linenoise/linenoise.c, linenoise/linenoise.h: Bump one principal author's copyright from 2014 to 2015. The code is based on a snapshot of 2015 upstream work.
* Version 129.txr-129Kaz Kylheku2015-12-291-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Adding with-slots macro.Kaz Kylheku2015-12-271-0/+9
| | | | | | | | | * lisplib.c (place_set_entries): Add with-slots to autoload name list. * share/txr/stdlib/struct.tl (with-slots): New macro. * txr.1: Documented.
* Version 128.txr-128Kaz Kylheku2015-12-191-1/+1
| | | | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. Bumped copyright year in configure. (Could be last chance this year). * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* New condlet macro; small change to iflet/whenlet.Kaz Kylheku2015-12-181-5/+12
| | | | | | | | | | | | | | | | | | | | | | | * eval.c (me_iflet_whenlet): Allow the test form to be an atomic expression instead of bindings. This allows iflet to be used as the sole target construct of condlet, while allowing condlet to have a fallback clause with t. It also means that an empty list of bindings is allowed (since it is the atom nil). * lisplib.c (ifa_set_entries): Add "condlet" to the autoload names for the ifa module. That's where we are adding condlet. * share/txr/stdlib/ifa.tl (sys:if-to-cond): New macro expander helper function, generalizing the writing cond-like macros based on if-like operators. (conda): Rewritten using sys:if-to-cond. (condlet): New macro. * txr.1: Documented change in iflet/whenlet. Documented condlet.
* Set macro ancestry info in place expansions.Kaz Kylheku2015-12-171-4/+14
| | | | | | | | | | | | | | | * eval.c (set_origin): New static function. (eval_init): Register set_origin as sys:set-macro-ancestor. * share/txr/stdlib/place.tl (sys:pl-expand): Set macro ancestry when expanding a place macro. (sys:cp-origin): New function. (call-update-expander, call-clobber-expander, call-delete-expander): Use sys:cp-origin to walk through expanded code and attach the place form as the macro ancestor of all the getter, setter or deleter calls, effectively to say that those calls are expansions of the place, which is approximately the case.
* Useful feature: object post-initialization.Kaz Kylheku2015-12-161-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* symbol-function semantics change; new symbol-macro.Kaz Kylheku2015-12-101-0/+16
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* Version 127.txr-127Kaz Kylheku2015-12-091-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* 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-091-3/+6
| | | | | | | | * 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.
* Correct return value of defmeth.Kaz Kylheku2015-11-301-3/+4
| | | | | * share/txr/stdlib/struct.tl (defmeth): Return the symbol being defined.
* Version 126.txr-126Kaz Kylheku2015-11-291-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Bugfix: sethash doesn't return stored value.Kaz Kylheku2015-11-251-7/+11
| | | | | | | | | | | | | | | | sethash mistakenly returns a boolean which indicates that the value was newly added, rather than the documented behavior of returning the new value. * hash.c (sethash): return value rather than new_p. * share/txr/stdlib/place.tl (defplace): The defplace form now seturn the main symbol of the place being defined, rather than returning whatever the last sethash call returns. (define-place-macro): Likewise. (sys:register-simple-accessor): Likewise, so that defaccessor returns the getter function's name.
* Better no such type diagnostic in defmeth.Kaz Kylheku2015-11-251-5/+8
| | | | | | * share/txr/stdlib/struct.tl (sys:defmeth): New function. Reacts to find-struct-type returning nil. (defmeth): Logic moved into function.
* New macro define-accessor.Kaz Kylheku2015-11-251-0/+19
| | | | | | | | | | | * lisplib.c (place_set_entries): New entry to trigger autoloading for define-accessor. * share/txr/stdlib/place.tl (sys:register-simple-accessor): New function. (define-accessor): New macro. * txr.1: Documented define-accessor.
* Version 125.txr-125Kaz Kylheku2015-11-201-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Introducing lazy structs.Kaz Kylheku2015-11-201-0/+12
| | | | | | | | | | | | | | | | | | | | | | | * share/txr/stdlib/struct.tl (lnew): New macro. * struct.c (struct_type): Turn id into a bitfield one bit smaller than cnum. New Boolean bitfield lazy. (struct_init): Register make-lazy-struct intrinsic. (make_struct): Initialize lazy bitfield to zero. (lazy_struct_init, check_init_lazy_struct): New static functions. (make_lazy_struct): New function. (copy_struct, clear_struct, replace_struct, reset_struct, lookup_slot, struct_inst_equal, struct_inst_hash): Call check_init_lazy_struct on all structures involved. (lookup_slot): Call check_init_lazy_struct. (struct_inst_mark): If the struct is lazy, it has one instance slot which must be marked, holding the argfun function passed into make_lazy_struct. * struct.h (make_lazy_struct): Declared. * txr.1: Documented lnew and make-lazy-struct.
* New uslot function and usl macro.Kaz Kylheku2015-11-201-0/+3
| | | | | | | | | | | | | | * struct.c (struct_init): Register uslot intrinsic function. (uslot_fun): New static function. (uslot): New function. * struct.h (uslot): Declared. * share/txr/stdlib/struct.tl (usl): New macro. * lisplib.c (struct_set_entries): Add usl macro. * txr.1: Documented uslot and usl.
* Version 124.txr-124Kaz Kylheku2015-11-141-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Version 123.txr-123Kaz Kylheku2015-11-061-1/+1
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.