| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Paul A. Patience noted that the canonname_s variable is not
used in the C code. This indicates that the AI_CANONNAME
functionality of getaddrinfo isn't implemented. Let's do that.
* stdlib/socket.tl (sockaddr): New slot, canonname.
(addrinfo): Default canonname to nil, not 0, since it is
a string that may be absent.
* socket.c (getaddrinfo_wrap): If the first address object has
a non-null ai_canonname and it was requested via the flags,
then stick that name into every returned structure.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Fix various minor issues and stylistic issues.
* configure: Remove repeated word and add missing word.
* txr.1: Fix various minor, not-so-minor and stylistic issues.
In particular, struct-from-args was misspelled in the .mets line and
open-subprocess was missing from the .coNP line.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (match_set_entries): Intern the match-error symbol.
Register autoloads for must-match and must-match-case.
* stdlib/match.tl (match-error): Register exception symbol, as subtype
of match-error.
(must-match, must-match-case): New macros.
* tests/011/patmatch.tl: Test cases.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We extend the matching context structures to keep track of the
underlying stream from which lines are being taken via the lazy list.
Then the implementation of the @(eof) directive, when it hits the eof
condition, can use this stream to gain access to the termination status.
* match.c (match_line_ctx, match_files_ctx): New member, stream.
(ml_all): Take stream argument and initialize new member.
(h_call, do_match_line): Pass stream argument to h_call.
(mf_all, mf_file_data): Take stream argument and initialize new member.
(mf_from_ml): Propagate stream from line context to file context.
(freeform_prepare, v_next_impl, match_filter, match_fun, extract): Pass
stream argument where now needed.
(v_eof): Implement termination status binding via the stream stored
in the context.
(open_data_source): Store stream in match files context.
* tests/010/eof-status.txr: New file.
* tests/010/eof-status.expected: New file.
* Makefile (tst/tests/010/eof-status.ok): -B option for new test.
* txr.1: Documented eof directive, argument and all.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/struct.tl (sys:new-expander): If the argument of
new* or lnew* is dwim, then treat that as an expression,
rather than as a boa-style construction.
* tests/012/oop.tl: Tests for new* focusing on this issue.
* txr.1: Documented.
|
|
|
|
|
|
| |
* txr.1: Fix code -> codn.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
| |
* stdlib/quips.tl (sys:%quips%): New entry.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/op.tl (sys:op-meta-p): Return an extended Boolean value: a true
result is an integer indicating the depth of the variable.
For instance @1 is depth 0, @@1 is depth 1 and so on.
(sys:find-parent): New function.
(sys:op-alpha-rename): When processing a nested meta, do not
set the nested flag in the immediate parent. Use find-parent to go up to
the correct level to which the meta belongs and set the flag there.
* tests/012/op.tl: New test cases which depend on this.
|
|
|
|
|
|
| |
* stdlib/op.tl (sys:op-meta-p): Rename expr argument to exp. The symbol
is not causing an issue here, but it's good to rename it for consistency
with sys:op-rec-p and to thwart future problems.
|
|
|
|
|
|
|
|
|
| |
* stdlib/op.tl (sys:op-rec-p): Test for both the variable @rec
and the expresson @(rec ...). Also, the expr argument of the function is
renamed to exp because it causes a problem, due to that symbol,
sys:expr, being the meta indicator.
(sys:op-ensure-rec): Remove one test for (sys:var usr:rec), since
sys:op-rec-p does it. Convert one equal-test to a call to sys:op-rec-p.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The June 30 09e70c914ca83b5c7405aa633864db49f27efa05,
subject "op: refactor do handling", introduced a regression
breaking the tags.tl program. An implicit argument
gets inserted twice:
[[(do op list @1)] 'x] -> (x x) ;; incorrect/weird
This was spotted by Paul A. Patience while working on
extending tags.tl for Emacs.
It's not exactly a regression because the original
behavior is not documented or tested, and has issues;
we simply cannot roll back the commit; a proper
fix is required.
How the above call is now supposed to work is that:
- the @1 parameter belongs to the op, not to the do.
- the do therefore has no explicitly given parameters
of its own.
- therefore the do inserts its parameter.
In other words (do op list @1) is formally equivalent
to (do op list @1 @@1).
Both levels of function indirection require an
argument:
[[(do op list @1) 'x] 'y] -> (y x)
[[(do op list @1 @@1) 'x] 'y] -> (y x)
* stdlib/op.tl (sys:op-ctx): The structure gets a new slot,
nested, which is a flag indicating whether unprocessed nested
metas occur. This is critically needed because the
sys:op-alpha-rename passes which are called with
do-nested-metas being false do not insert nested metas into
the gens list; they transform them and leave them in the
syntax. Yet we must make decisions based on their presence.
Conretely, we must be able to tell that (do op list @@1)
has a meta against the outer (do ...), while we are just
processing the do.
(sys:op-alpha-rename): When replacing a nested meta syntax
with the macro invocation, we set the nested flag of the
parent context true.
(sys:op-expand): Bring back the do-gen; we need it. We cannot
simply insert @1 into the syntax, because that is not
lexically transparent. If we add @1 to (do op ...) then that
@1 is interpreted as belonging to the op, not to the do.
We must also check the new Boolean flag nested to properly
detect whether we have metas, including unexpanded nested
metas.
* tests/012/op.tl: New test cases combining (do op ...).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/doc-syms.tl: Updated.
* sysif.c (rlim_s, cur_s, max_s): New symbol variables.
(rlim_st): New variable.
(getrlimit_wrap, setrlimit_wrap): New functions.
(sysif_init): gc-protect rlim-st. Initialize symbol
vsariables. Create rlim struct type. Register getrlimit and
setrlimit intrinsics. Register variables rlim-saved-max,
rlim-saved-cur, rlim-infinity, rlimit-core, rlimit-cpu,
rlimit-data, rlimit-fsize, rlimit-nofile, rlimit-stack and
rlimit-as.
* txr.1: Documented under new Unix Resource Limits section.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
| |
* stdlib/compiler.tl (open-compile-streams): If in-path end in
a path separator character, throw an error.
|
|
|
|
|
|
|
|
|
| |
* stdlib/doc-lookup.tl (open-url): Treat empty BROWSER variable
as if it were unset (i.e., ignore it). Otherwise the doc
function silently fails rather than falling back to alternative
URL-opening methods.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c, stream.h (add_suffix): New function.
(stream_init): add-suffix intrinsic registered.
* tests/018/path.tl: Tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c, lib.h (chk_substrdup): New function.
* stream.c, stream.h (trim_short_suffix, trim_long_suffix):
New functions.
(stream_init): trim-short-suffix and trim-long-suffix
intrinsics registered.
* tests/018/path.tl: New tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (separate): New function.
* lib.h (separate): Declared.
* eval.c (eval_init): Register separate intrinsic.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
| |
* compiler.tl (open-compile-streams): Use path-cat instead of
quasiliteral.
|
|
|
|
|
|
|
|
|
| |
* stdlib/compiler.tl (open-compile-streams): Replace usage of
%file-suff-rx% with a call to short-suffix.
Streamline (subjectively) the obtention of ip-nosuff. Replace
calls to ends-with with a casequal on the suffix. Actually make
use of ip-nosuff.
(%file-suff-rx%): Delete (now unused) variable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register built-in-type-p intrinsic.
* lib.c (buitin_type_p): Rename to built_in_type_p since the
word built-in is hyphenated. The function also tests
whether the argument is a COBJ class.
(cobj_class_exists): Function removed.
* stdlib/doc-syms.tl: Updated.
* stdlib/struct.tl (defstruct): Add built-in-type-p check.
* struct.c (make_struct_type): Call only built_in_type_p;
cobj_class_exists is gone.
* txr.1: Document built-in-type-p.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Paul A. Patience discovered the hidden "feature" of
with-resourcers, that the three-argument form of the binding
(var init cleanup) causes the with-resources form to terminate
if init returns nil. The (var init) syntax doesn't generate
this logic.
* stdlib/with-resources.tl (with-resources): Do not emit the
when form unless <= 265 compatibility is in effect.
* tests/012/oop-mac.tl: New file.
* txr.1: Compat note added.
|
|
|
|
|
| |
* stdlib/doc-lookup.tl (os-symbol): Add case for OpenBSD.
(open-url): Same.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* genman.txr (dupes, tagnum): Replace defvar with defvarl.
* stdlib/doc-lookup.tl (os-symbol): Same.
* tests/011/macros-3.tl (x): Same.
* tests/011/mandel.txr (x-centre, y-centre, width, i-max, j-max, n)
(r-max, pixel-size, x-offset, y-offset): Same.
(file, colour-max): Delete (unused) variables.
* tests/012/circ.tl (x): Replace defvar with defvarl.
* tests/012/stack.tl (stack-limited): Same.
* tests/012/struct.tl (s): Same.
* tests/013/maze.tl (vi, pa, sc): Delete variables. Use
function arguments instead.
(usage): Fix typo.
* tests/014/dgram-stream.tl (family): Rename to...
(*family*): ...this.
* tests/014/socket-basic.tl (socktype): Rename to...
(*socktype*): ...this.
(%iters%): Replace defvar with defvarl.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
| |
* stdlib/compiler.tl (lambda-apply-transform): When processing
optional argument from apply-list, push an entry into
check-opts, so the fixup code is generated for it.
New test cases pass now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compiler test case fails on cases which pass a : value to
an optional argument, which is supposed to trigger defaulting.
* stdlib/compiler.tl (lambda-apply-transform): When processing
an optional argument, if the argument is other than a constant
expression evaluating to the : symbol, add an entry into a
new check-opts list. This is later traversed to add code
before the lambda body to check the optional parmeters for :
values and do the init-form processing. The test cases pass
with this, but it needs to be done in the case when optional
values come from the apply list also; this is not being
tested.
|
|
|
|
|
| |
* stdlib/compiler.tl (lambda-apply-transform): In one case,
the add call is missing to actually emit the rest parameter.
|
|
|
|
| |
* stdlib/error.tl (lambda-too-few-args): Fix "inufficient".
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: There is no cptr-put function; it is called cptr-out.
The last paragraph refers to cptr-out and it is referenced
elsewhere. It has to be cptr-out because it implements the
"out semantics" in FFI conversion which pairs with "put";
cptr-put would be a different function, which is not currently
implemented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
| |
* genman.txr: Before generating stdlib/doc-syms.tl, check that the
symbols going into that file (i.e., into the doc-syms variable) are
actually contained in the TXR image (allowing for some exceptions).
Also, reindent some lines.
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: Make consistent the style for ellipses in .coNP lines (i.e.,
without the word "and"). Emend some incorrectly named symbols. Fix
various typos and other inconsistencies in .coNP lines.
* checkman.txr (check-func): Add exception for caar. Add missing
patterns for "Pattern macro", "Operator/function" and "Macro/function".
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
| |
* stdlib/compiler.tl (lambda-apply-transform): There is a bug
in the case when all required and optional parameters have
been satisfied. In the sub-case when there are no fixed
parameters, we need to handle the run-time situation of there
being a non-empty apply list, but no rest variable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/op.tl (op-expand): The logic involving the multiple
expansions of do is consolidated into one step, so that
everything is taken care of by the time syntax-1 is produced.
Immediately when the initial unsuffixed arguments expand
successfully, we check or the presence of metas and add the @1
if metas are absent. In the case of expanding with the gensym,
we immediately replace that with @1 without using symacrolet.
The do-gen variable is gone. Later, when calculating
lambda-interior, there are no hacky additional passes to deal
with; that block of code just refers to syntax-2. The do case
is folded together with the have-metas case. Also adding
copious comments to this hard-to-follow logic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the case when the do syntax has no metavariables, and it
expands as-is without the addition of symbol in the tail
position, we are doing something wrong: we are adding the
@1 into the expanded version of the form, rather than
the original. For instance:
1> (expand '(do pop a))
(lambda (#:arg-1-0017 . #:arg-rest-0016)
(prog1 (car a)
(sys:setq a (cdr a))
#:arg-1-0017))
Here, the @1 was inserted into the (prog1 ...) form
which is the expansion of pop. This is incorrect;
it must be inserted into the original (pop a)
syntax as (pop a @1).
* op.tl (op-expand): In this case when there are no
metas and no do-gen that can be replaced by @1 via
symacrolet, go back to the original args syntax,
add the arg1 meta into that syntax, and process it
from the beginning through parallel expansions
steps.
* tests/012/op.tl: Couple of tests added.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we compile an immediately applied lambda like
(apply (lambda (a b c) ...) list), we are not emitting code to
handle the run-time situation when there are too many elements
in the list. This shows up in exception handling, for
instance; the compiled version of this executes silently and
returns 42:
(catch (throw 'foo 5) (foo () 42)))
foo is must have a parameter to capture the 5; interpreted
code enforces this.
* stdlib/compiler.tl (lambda-apply-transform): In the
apply-list case, at the end of binding all the optional
arguments, if the parameter list doesn't have a rest
parameter to take any remaining items, we emit code to check
that there aren't any; that everything has been popped out of
the apply list, leaving it nil. If not, we call the
run-time support function lambda-excess-apply-list.
* stdlib/error.tl (lambda-excess-apply-list): New function.
|
|
|
|
|
|
|
|
|
| |
* stdlib/doc-lookup.tl (open-url): On non-Windows platforms,
search for a program specified by the BROWSER variable,
then by the URL-opening utility, and finally thorugh a
fallback list of browsers.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is like find-if, but returns the value of the predicate
function rather than the item.
* eval.c (eval_init): Register find-true instrinsic.
* lib.c (find_true): New function.
* lib.c (find_true): Declared.
* stdlib/doc-syms.tl: Updated.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (path_test_set_entries): Autoload on path-search.
* stdlib/path-test.tl (path-search): New function.
* tests/018/path-test.tl: New file.
* txr.1: Documented.
* stdlib/doc-lookup.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is common for web browsers like firefox not to fork
themselves into the background when initially run from the
command line. Only when an additional instance is executed
does that instance terminate immediately, passing the URL to
the existing instance. (Which also does not constitute forking
into the background, but does have the effect of an immediate
exit.)
User Paul A. Patience reports that some installations of
xdg-open have the isssue of not handling this situation; these
versions of xdg-open wait for the browser to terminate, which
causes xdg-open to hang until the browser is closed if it is
the initial instance.
* stdlib/doc-lookup.tl (detached-run): New function. Like run,
but forks into the background, running the process in a
detached grandchild whose parent terminates, so that it
becomes an orphan parented to the init daemon. We redirect
*stdout* to *stdnull* because the first instance of the
browser can spit ugly, meaningless diagnostics when it
terminates.
(open-url): Use detached-run instad of run. Don't check the
return value for zero; there is no integer exit status.
|
|
|
|
|
| |
* stdlib/doc-lookup.tl (*doc-url*): Define with defvar,
not defvarl. Problem reported by Paul A. Patience.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch improves the constantp function dramatically. It
now performs a full expansion of its argument, and recognizes
all of the constant foldable functions that the compiler
recognizes.
* eval.c (const_foldable_s): New symbol variable.
(const_foldable_hash): New static variable.
(constantp_noex): Look up function in the hash table of const
foldable functions, including in the case when it appears in a
dwim form as in [+ 2 2] which is (dwim + 2 2). In this case,
recursively check the arguments for constantp_noex.
We get the hash table of foldable functions from the
sys:%const-foldable% variable, which comes from an autoloaded
module.
(constantp): Fully expand the input form, not just m
macroexpand.
(eval_init): Register the const_foldable_s variable.
* lisplib.c (constfun_instantiate, constfun_set_entries): New
static functions.
(lisplib_init): Register auto-loading of constfun module
via new static functions.
* stdlib/compiler.tl; Load the constfun module if
%const-foldable% is not defined.
(%const-foldable-funs%, %const-foldable%): Removed from here.
* stdlib/constfun.tl: New file.
(%const-foldable-funs%, %const-foldable%): Moved here.
* txr.1: Documented changes to constantp.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (regex_optimize): New static function, capturing the
three optimization passes.
(regex_compile): Code moved into regex_optimize.
(regex_init): Remove sys:reg-optimize function. Register
regex-optimize.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* stdlib/ver.tl: Bumped.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
This affects run-time also. Txr installations where the
executable is not in directory ending in ${bindir}
will look for stdlib rather than share/txr/stdlib,
relative to the determined installation directory.
* txr.c (sysroot_init): If we detect relative to the short
name, or fall back on the program directory, use stdlib
rather than share/txr/stdlib as the stdlib_path.
* INSTALL: Update some installation notes not to refer to
share/txr/stdlib but stdlib.
* Makefile (STDLIB_SRCS): Refer to stdlib, not
share/txr/stdlib.
(clean): In unconfigured mode, remove the old share/txr/stdlib
entirely. Remove .tlo files from stdlib.
(install): Install lib materials from stdlib.
* txr.1: Updated documentation under Deployment Directory Structure.
* share/txr/stdlib/{asm,awk,build,cadr}.tl:
Renamed to stdlib/{asm,awk,build,cadr}.tl.
* share/txr/stdlib/{compiler,conv,copy-file,debugger}.tl:
Renamed to stdlib/{compiler,conv,copy-file,debugger}.tl.
* share/txr/stdlib/{defset,doc-lookup,doc-syms,doloop}.tl:
Renamed to stdlib/{defset,doc-lookup,doc-syms,doloop}.tl.
* share/txr/stdlib/{each-prod,error,except,ffi}.tl:
Renamed to stdlib/{each-prod,error,except,ffi}.tl.
* share/txr/stdlib/{getopts,getput,hash,ifa}.tl:
Renamed to stdlib/{getopts,getput,hash,ifa}.tl.
* share/txr/stdlib/{keyparams,match,op,optimize}.tl:
Renamed to stdlib/{keyparams,match,op,optimize}.tl.
* share/txr/stdlib/{package,param,path-test,pic}.tl:
Renamed to stdlib/{package,param,path-test,pic}.tl.
* share/txr/stdlib/{place,pmac,quips,save-exe}.tl:
Renamed to stdlib/{place,pmac,quips,save-exe}.tl.
* share/txr/stdlib/{socket,stream-wrap,struct,tagbody}.tl:
Renamed to stdlib/{socket,stream-wrap,struct,tagbody}.tl.
* share/txr/stdlib/{termios,trace,txr-case,type}.tl:
Renamed to stdlib/{termios,trace,txr-case,type}.tl.
* share/txr/stdlib/{ver,vm-param,with-resources,with-stream}.tl:
Renamed to stdlib/{ver,vm-param,with-resources,with-stream}.tl.
* share/txr/stdlib/yield.tl: Renamed to stdlib/yield.tl.
* share/txr/stdlib/{txr-case,ver}.txr:
Renamed to stdlib/{txr-case,ver}.txr.
* gencadr.txr: Update to stdlib/place.tl.
* genman.txr: Update to stdlib/cadr.tl.
|