| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (pset, push, pushnew): Use rlet
for binding the assigned or pushed value to a temporary,
so the temporary can disappear if the value is a constant.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is used in the awk macro. Breaking test case is
an update modification of f, like (push 3 f);
a broken call to sys:rslotset is generated with a
too few arguments.
* share/txr/stdlib/struct.tl (defplace sys:rslot): Fix name
clash between gensym and parameter. Add the meth-slot-sym
parameter into the sys:rslotset call where it is missing
as a required parameter.
|
|
|
|
|
|
|
|
|
| |
* share/txr/awk.tl (sys:awk-state rec-to-f): Check for empty
record only in the fs case; it's not necessary when tokenizing
with ft. Check (not self.kfs) first, since it's the common
case. Handle default case (no fs or ft) using tok-str
using the regex #/[^ \t\n]+/, which requires no trim-str
and no empty record check.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (build_set_entries, build_instantiate): New static
functions.
(dlt_register): Register dynamic loading of build.tl via
the two new functions.
* share/txr/stdlib/build.tl: New file.
* txr.1: Documented everything.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-let): Add new symbol
macro, fconv.
* share/txr/stdlib/conv.tl: New file.
* txr.1: Documented fconv.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state): New slot, krs.
(sys:awk-state loop): Use record-adapter if krs is true,
even if the default fs is in effect. Pass value of krs to
record-adapter function.
(sys:awk-let): Provide krs "awk variable" symbol macro.
* txr.1: Documented krs. Clarified semantics of rs being
those of both separation and termination.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state): New slots, ft and
kfs.
(sys:awk-state rec-to-f): Implement ft and kfs semantics.
(sys:awk-let): Provide ft and kfs as "awk variable" via
symbol macros.
* txr.1: Documented ft and kfs.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (awk): Bind *stdout* only if
awc.output is not nil; i.e. :output has been specified
(with a non-nil argument).
* txr.1: Revised :output documentation.
|
|
|
|
|
|
|
|
| |
* lisplib.c (place_set_entries): Add upd to the auto-load
list for place.tl.
* share/txr/stdlib/place.tl (upd): New macro.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-expander): Check
that :name designates a symbol, and that it isn't nil.
(awk): Move the implicit block to the outermost scope
so it encloses all of the clauses. Default to the
name awk for the block, rather than nil.
* txr.1: Document that the implicit awk block is
called awk by default, and that nil is not allowed
as a block name.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state prn):
Use loop instead of simple interpolation, so that
we we can individually interpolate each arg into a
quasistring. This way if an arg is nil, it turns
into nothing rather than the word "nil".
* txr.1: Documented this behavior of prn.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state loop): Do not
bind *stdout* around the call to the main record-processing
function.
(awk): Re-bind *stdout* around all of the user code,
just after the run-time awk state object is constructed.
* txr.1: Correct the lies written about :output.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-let): New
local macros.
* txr.1: Documented.
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state f-to-rec):
Use quasiliteral to combine fields to reconstitute
rec; cat-str works only with characters and strings.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state): Initialize
fs to nil rather than the default regex.
(sys:awk-state rec-to-f): If fs is nil then operate
on a version of rec that is filtered through trim-str.
Thus fs being nil is like the Awk special case when
fs is a space.
* txr.1: Description of fs updated.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (nthcdr): Fix a potentially
wrong order of evaluation by using a temporary symbol for the
list and using alet. If the list form could potentially
modify the index, then we now avoid a bug here.
(vecref, chr-str, ref, gethash, slot): Optimise
the expansion of these two-expression places using alet.
If both expressions are symbols, which is often the case,
temporaries are avoided.
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (place_set_entries): Add alet symbol to autoload
list for place.tl.
* share/txr/stdlib/place.tl (alet): New macro.
* txr.1: Documented alet.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gencadr.txr: Use let instead of useless rlet
that will just reduce to let.
* share/txr/stdlib/cadr.tl: Regenerated.
* share/txr/stdlib/place.tl (sys:var, car, cdr, errno):
Replace rlet with slet where safe.
(nthcdr): Replace useless let* with let.
Replace one safe-looking rlet with slet.
(dwim): Replace useless rlet with let.
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state loop): Take input
stream directly without a record adapter, if the record
separator is the string "\n".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-compile-time): New slots,
begin-file-actions and end-file-actions.
(sys:awk-state loop): Take two additional functional arguments
for the begin file and end file actions, and do the
calls in the right places. unwind-protect triggers the
end file function.
(sys:awk-expander): Parse out :begin-file and :end-file
actions.
(awk): Generate lambdas for begin-file and end-file actions,
if they are defined. Pass these to the loop method.
The code is refactored here to do one big sys:awk-let
around everything.
* txr.1: Documented :begin-file and :end-file, revising
the :begin and :end documentation in the process.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-compile-time): New
slots: inputs, output, name, lets, begin-actions,
end-actions, cond-actions.
(sys:awk-expander): Use just one local variable,
an awk compile time. Instead of the previous local
variables, use the slots of this structure and
return just that structure. Note that pattern-actions
has been renamed cond-actions. This is per the terminology
used in the newly-written documentation.
(awk): Adjust to sys:awk-expander returning just the
awk compile-time structure. No need to set up numerous
locals; just refer to struct.
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state rec-to-f): Don't use
zap macro when the return value is not used.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-let): The closing
expression of an awk range only applies when
the range is active. Refactor generated code with local flags to
eliminate duplicating the end range expression.
Avoid evaluating the start range expression if the
range is already active.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-let): Use our
wonderful placelet macro instead of symacrolet for binding the
flag alias to the flag place. This removes the duplicate
evaluations of the slot access.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
awk ranges must evaluate out-of-band after the
record is read, before the patterns and actions
are evaluated.
* share/txr/stdlib/awk.tl (sys:awk-compile-time): New slots,
rng-expr-temps and rng-exprs.
(sys:awk-let): Stash the code for evaluating a range into
the compile-time info into the rng-exprs list, and associate
it with a gensym in the parallel rng-expr-temps list.
Then emit that gensym as the expansion for the rng form.
(awk): Process the pattern code in two steps. First, expand
it, to get it to drop the rng-exprs into the awk compile-time
info structure. Then when generating the final lambda,
wrap an let* around the generated code which
binds the rng-temps with the rng-exprs. This resolves the
gensym references that replaced the ranges. let* is is used
and its bindings are reversed into discovery order because
this supports nested rng syntax. Given (rng x (rng y z)), the
(rng y z) is expanded first, and so its code and temp gensym
are pushed onto their respective lists firsts. The outer
rng's code will thus contain a temp referring to the
code of the inner one.
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state): if output is a
string, open file.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state): New slot, ors.
(sys:awk-state prn): Use put-string to output the record
rather than put-line, and stick the ors at the end.
(sys:awk-let): Provide ors local symbol macro.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (qref): Use slet instead of let
in expansion so that in the common case of var.(method ...)
the expansion simply produces a form with var evaluated in two
places.
(sys:rslot): Use slet instead of rlet.
* tests/012/struct.tl: Update qref expansion test-cases
to test for the now simpler expansions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (place_set_entries): Add slet symbol to autoload
list for place.tl.
* share/txr/stdlib/place.tl (sys:r-s-let-expander): New
function.
(rlet): Replace body with call to sys:r-s-let-expander.
(slet): New macro.
* txr.1: Clarification and corrections in rlet description
and example. rlet will in fact handle the three-variable
rotation case because, since a is not a constant expression,
(rlet ((temp a)) ...) reduces to let.
Documented new slet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state): New slot,
rng-vec: holds boolean flags for ranges.
New slot, rng-n, holds size for rng-vec.
New :postinit handler for creating vector for
rng-vec.
(sys:awk-compile-time): New struct.
(sys:awk-expander): Construct an awk compile time,
and return that as one of the values.
(sys:awk-let): Provide (rng) local macro: the two argument
range operator. Generates code and keeps track of
number of ranges and their association to a position
in rng-vec using the compile-time info structure.
(awk): Capture awk compile-time object from expander.
Initialize rng-n slot of awk state with
number of ranges indicated in compile time info.
Pass compile-time info to awk:let macro.
Binding of lambda and of awk state had to be reordered
because macro-expansion of the lambda fills in the compile
time info which is then used in the expansion of the
constructing expression for the awk state.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (pinc, pdec, test-set, test-clear,
compare-swap, test-inc, test-dec): New macros.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (inc, dec): If the delta
is zero, don't generate code which calls getter
and setter; just generate the place form as the
output.
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (awk_set_entries, awk_instantiate): New static
functions.
(lisplib_init): Register auto-loading for awk module
via new functions.
* share/txr/stdlib/awk.tl: New file.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This provides a way to create lexical macros denoting slots,
such that method are invoked when they are updated.
* lisplib.c (struct_set_entries): Add rslot to list of
auto-load symbols for struct.tl module.
* share/txr/stdlib/struct.tl (sys:rslotset): New function.
(rslot, rslot): New macro and place macro.
(sys:rslot): New place kind.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The expansion of a place macro form should not be
subject to a complete macro-expansion (as a
regular macro form). Only one round of expansion
should be performed, and the results should be
re-tried as a place macro. Otherwise an opportunity
to expland a place macro will be missed.
* share/txr/stdlib/place.tl (sys:pl-expand):
Use macroexpand-1 rather than macroexpand.
* txr.1: Documentation updated to make the new behavior
clear. It's unlikely that anything in the world depends
on this, so no backward compatibility switch is being
provded to the old behavior. In situations where this
makes a difference, the old behavior is likely too wrong
to be useful.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (sys:l1-setq): Expand sym, because
it might not be a symbol. If it isn't a symbol, just generate
a set.
(dwim): Unconditionally bind sys:*lisp1* to t, whether
or not the unexpanded place is a symbol. It could expand to
a symbol. The context is lisp-1 if it does that.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (sys:*pl-env*): New special
variable for passing macro-expansion environment to
expanders.
(call-update-expander, call-clobber-expander,
call-delete-expander): bind sys:*pl-env* with
passed-in env argument, so if the expander needs to itself
recursively expand a macro, it has the macro-time env.
(nthcdr): Do not try to capture :env parameter, because
this will always be nil. Refer to sys:*pl-env* instead.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (defplace symbol-value):
Don't splice body into deleter syntax; must use plain unquote.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|