| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/op.tl (sys:opip-expand): Add op, do, lop, ldo, ap,
ip, ado, ido, ret and aret to the operators whose forms are
passed through untransformed. This is important because it
lets us override the implicit (op ...) and (do ...) chosen
by the expander. When a pipeline element produces a list, for
instance, we want to be able to use (ap ...) in the next
element to spread the list into arguments.
* tests/012/op.tl: Add bellied numbers test case.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* autoload.c (build_set_entries): Add oust symbol.
* stdlib/build.tl (list-builder postinit): Call the self
argument self instead of bc, for consistency with other
methods.
(list-builder oust): New method.
(list-builder-flets): Add local function oust.
* tests/012/seq.tl: New tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register partition-if intrinsic.
* lib.c (partition_if_countdown_funv, partition_if_func): New
functions.
(partition_if): New function.
* lib.h (partition_if): Declared.
* tests/012/seq.tl: New test cases.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register find-max-key and find-min-key
intrinsics.
* lib.c (find_max_key, find_min_key): New functions.
* lib.h (find_max_key, find_min_key): Declared.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (lisplib_init): Follow rename, and rename
try-load-fun to autoload-try-fun.
(lisplib_try_load_fun, lisplib_try_load_var,
lisplib_try_load_fun_var, lisplib_try_load_slot,
lisplib_try_load_struct, lisplib_try_load_keyword):
Renamed from `lisplib_try_load_@kind` to `autoload_try_@kind`.
* lisplib.h (lisplib_try_load_fun, lisplib_try_load_var,
lisplib_try_load_fun_var, lisplib_try_load_slot,
lisplib_try_load_struct, lisplib_try_load_keyword):
Declarations renamed.
* eval.c (lookup_global_var, lookup_sym_lisp1, lookup_fun,
lookup_mac, lookup_symac, lookup_symac_lisp1, special_var_p,
expand_param_macro, rt_defvar, rt_defv, op_defsymacro,
rt_defsymacro, rt_defun, rt_defmacro, makunbound, fmakunbound,
mmakunbound): Follow rename.
* struct.c (make_struct_type, find_struct_type,
lookup_slot_load, lookup_static_slot_load,
lookup_static_slot_desc_load, slot_types, static_slot_types):
Follow rename.
* stdlib/place.tl (get-place-macro): Follow rename of
try-load-fun to autoload-try-fun.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (lisplib_init): Change sys:try-load (only used by
place.tl) to sys:try-load-fun, and register it to
(lisplib_try_load): External function becomes static.
(lisplib_try_load_fun, lisplib_try_load_var,
lisplib_try_load_fun_var, lisplib_try_load_slot,
lisplib_try_load_struct, lisplib_try_load_keyword): New
functions.
* lisplib.h (lisplib_try_load): Declaration removed.
(lisplib_try_load): External function becomes static.
(lisplib_try_load_fun, lisplib_try_load_var,
lisplib_try_load_fun_var, lisplib_try_load_slot,
lisplib_try_load_struct, lisplib_try_load_keyword): Declared.
* eval.c (lookup_global_var, lookup_var, lookup_symac,
lookup_symac_lisp1, rt_defvarl, rt_defv, op_defsymacro,
rt_defsymacro, makunbound): Use lisplip_try_load_var.
(lookup_fun, lookup_mac, rt_defun, rt_defmacro, fmakunbound,
mmakunbound): Use lisplib_try_load_fun.
(expand_param_macro): Use lisplib_try_load_keyword, which is
a catch-all namespace for anything tied to keywords.
* struct.c (make_struct_type, find_struct_type): Use
lisplib_try_load_struct.
(lookup_sloat_load, lookup_static_slot_load,
lookup_static_slot_desc_load, slot_types, static_slot_types):
Use lisplib_try_load_slot.
* stdlib/place.tl (get-place-macro): Use try-load-fun,
rather than try-load.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (copy_file_instantiate): Trigger autoload on
cat-files.
* stdlib/copy-file.tl (cat-files): New function.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
| |
* genman.txr: Remove from the name list those names that are not
TXR symbols, so that they don't appear in doc-syms.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
| |
* stdlib/getopts.tl (basic-type-p): Handle the cons case.
(sys:opt-parsed convert-type): Same.
(opthelp): Same.
(opthelp-types): Same, and for each type in the legend, specify
which arguments correspond to it.
|
|
|
|
|
|
|
|
| |
* stdlib/getopts.tl (opthelp-types): Print the entries in a
canonical order rather than in the order of the types' appearance
in opt-desc-list. Also, remove one (superfluous) space before the
hyphen in all entries and fix typos in the description of HEX and
STR.
|
|
|
|
|
| |
* stdlib/getopts.tl (opthelp-types): Consider list and cumul
types when searching for types to include in the legend.
|
|
|
|
|
|
|
| |
* stdlib/getopts.tl (list-type-p): Return nil if subtype is :bool.
(cumul-type-p): Same.
* txr.1: Documented, reworded some sentences, fixed some typos.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (me_macro_time): New static function
(do_expand): Remove handling of macro_time_s.
(eval_init): Remove special operator registration of
macro-time; add macro registration.
* txr.1: Documentation of macro-time updated, revised
and moved from the top the Macros section to be adjacent
to equot.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
| |
* stdlib/match.tl (expand-quasi-match): We cannot call m^$ with
the @nil-bound rest of string when matching `@{nil #/regex/}`.
Handle this case specially.
|
|
|
|
|
| |
* stdlib/getopts.tl (opthelp): Print the options header only if
we have documented options.
|
|
|
|
|
|
| |
* stdlib/getopts.tl (opthelp-conventions): Describe the --no-
prefix only if we have boolean options, and describe the
long-option argument style only if we have long options.
|
|
|
|
|
|
| |
* stdlib/getopts.tl (opthelp): Indent the list of undocumented
options by only two spaces, like the documented options and the
other opthelp sections.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The documented options and type legend both end in a blank line,
unlike the undocumented options and option conventions.
* stdlib/getopts.tl (opthelp): Print a blank line after the
undocumented options.
(opthelp-conventions): Print a blank line after the conventions.
Also, change the header from "Option Conventions" to "Option
conventions" to follow the style of the undocumented options and
type legend.
* txr.1: Remove superfluous (as of now) put-line calls in the
--extra-help example of getopts. While here, correct o.extrahelp
to o.extra-help.
|
|
|
|
|
|
| |
* txr.1: Fix typos and stylistic issues.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
| |
* stdlib/getopts.tl (opthelp, opthelp-conventions,
opthelp-types): Use *stdout* as the optional stream argument,
defaulting to *stdout*. Now we no longer have to explicitly
pass the stream to put-line.
|
|
|
|
|
|
|
|
| |
* stdlib/match.tl (expand-quasi-match): When matching `text`
or `@var`, which are matching in the final position of the
specimen, it is not good enough that match-str returns true;
we must check that the entire string was matched.
Reported by Paul A. Patience.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (getopts_set_entries): Autoload for
opthelp-conventions and opthelp-types.
* stdlib/getopts.tl (opthelp): Remove incnotes parameter.
Entirely trim out the code for notes about conventions and use
of types.
(opthel-conventions, opthelp-types): New functions.
(option-base opthelp-conventions, option-base opthelp-types):
New methods.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/getopts.tl (opthelp): New incnotes parameter.
If specified as false, disables the detailed Notes
and Type legend.
(sys:option-base opthelp): Same new parameter on this method,
passed down to opthelp.
* txr.1: Documented.
|
|
|
|
| |
* quips.tl (%quips%): New one.
|
|
|
|
|
|
|
|
| |
* stdlib/getopts.tl (opthelp): If the long/short part of an
option description is 34 characters long or more, print the help
text starting on the next line, lest it be glued to the
long/short part (i.e., without an intervening space) and extend
too far to the right.
|
|
|
|
|
| |
* stdlib/getopts.tl (opthelp): Actually use the function's stream
parameter in the put-line calls.
|
|
|
|
|
|
|
| |
* cadr.c, cadr.h, stdlib/cadr.tl: Regenerated. All that
changes is the formatting of the copyright block, since now it
is scraped from files that reformatted it to 80 columns half a
year ago.
|
|
|
|
|
| |
* stdlib/conv.tl: Extra blank line after copyright header
removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 93edcde038209335122964432bd35dee0c2ecb04, made in
August 2021, accidentally removed the blank line after the
copyright header in most stdlib files.
stdlib{asm.tl, awk.tl, build.tl, compiler.tl, copy-file.tl,
debugger.tl, doloop.tl, each-prod.tl, error.tl, except.tl,
ffi.tl, getopts.tl, getput.tl, hash.tl, ifa.tl, match.tl,
op.tl, package.tl, param.tl, path-test.tl, pic.tl, place.tl,
pmac.tl, quips.tl, save-exe.tl, socket.tl, stream-wrap.tl,
tagbody.tl, termios.tl, trace.tl, txr-case.tl, type.tl,
vm-param.tl, with-resources.tl, with-stream.tl, yield.tl}:
Ensure there is a blank line after the copyright header.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implements reservoir sampling.
* rand.c (radom_float_impl): New static function, made out of
random_float. Returns double, giving us access to the unboxed
result
(random_float): Now a wrapper around random_float_impl: boxes
the result of random_float.
(elrd, flrd, random_sample): New static functions.
(rand_init): Register random-sample intrinsic.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): copy-cptr intrinsic registered.
* lib.c (copy_cptr): New function.
(copy): Use copy_cptr for CPTR objects.
* lib.h (copy_cptr): Declared.
* tests/017/ffi-misc.tl: New test cases.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
| |
% stdlib/quips.tl (%quips%): New one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (me_nand, me_nor, nor_fun, nand_fun): New functions.
(eval_init): Register new intrinsics.
* lib.c (nandv, norv): New functions.
* lib.h (nandv, norv): Declared.
* txr.1: Documented, along with trivial fixes to the descriptions
of and, or, andf, orf and notf.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
| |
* stdlib/compiler.tl (compiler compile): Handle typep symbol
via comp-typep method.
(compiler comp-typep): New method. This recognizes some
absolute truths: every object is of type t, and no object is
of type nil.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/type.tl (sys:typecase-expander): New function, formed
from body of typecase. Bad clause syntax now handled with
compile-error rather than (throwf 'eval-error). The t symbol
is handled specially: it turns into a t conditon in the
resulting cond rather than a typep test. The compiler will
nicely eliminate dead code after that. Now etypecase is handled
here also: if we are expanding etypecase, we just emit the
extra clause.
(typecase, etypecase): Reduced to sys:typecase-expander calls.
* tests/012/typecase.tl: New file.
* tests/012/compile.tl: Add type.tl to list of compile-tested
files.
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (type_set_entries): Add etypecase to autoload list.
* stdlib/type.tl (etypecase): New macro.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
| |
* optimize.tl (basic-blocks peephole-block): Check for the
reversed arguments case of (ifq (d x) (t 0)), and
also match ifq. Add a case for two different d registers
being compared by ifq or ifql which are not both implicated as
load-time regs; that also converts to an unconditional jmp
to the else label. Add a case for a register being compared
with itself with ifq or ifql, which disappears.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
User vapnik spaknik was asking in the mailing list whether
there is an existence test for TXR pattern functions. Now
there is.
* eval.c (eval_init): Register match-fboundp intrinsic.
* match.c (match_fbound): New function.
* match.h (match_fbound): Declared.
* tests/011/txr-case.txr: New test cases.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issues reported by user vapnik spaknik. The evaluation of init
forms is incorrect. Init forms like '(x) evaluate to
'(x) rather than (x), Also, init forms are evaluated even when
the argument is present, so the entire current approach is
wrong.
* stdlib/keyparams.tl (extract-keys, extract-keys-p,
build-key-list-expr): Functions removed.
(stuff-key-params): New function.
(:key): Rework using simplified approach, with just the
stuff-key-params helper. All variables from the keyword
parameter list are bound with let. Generated code searches
the keyword parameters for values and assigns the variables as
needed, evaluating default init forms in the not-found cases.
* tests/011/keyparams.tl: New file.
|
|
|
|
| |
* stdlib/quips.tl (%quips%): New entry.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The motivating situation is this:
(lambda (: (opt :)) opt)
When the default value of an optional parameter is :
then the net effect is that there is no optional substituion.
The optional argument is signaled by the : symbol, and that
same symbol then replaces the value.
This is not optimized well:
data:
0: :
1: t
syms:
code:
0: 8C000009 close t2 0 3 9 1 0 nil t2
1: 00000002
2: 00000001
3: 00000003
4: 00000002
5: 3C000008 ifq t2 d0 8
6: 00020400
7: 2C020400 movsr t2 d0
8: 10000002 end t2
9: 10000002 end t2
instruction count:
5
entry point:
4
The instruction sequence
5: 3C000008 ifq t2 d0 8
6: 00020400
7: 2C020400 movsr t2 d0
8:
serves no purpose; it's like:
(if (eq x y)
(set x y))
With this commit it looks like:
data:
0: :
1: t
syms:
code:
0: 8C000006 close t2 0 3 6 1 0 nil t2
1: 00000002
2: 00000001
3: 00000003
4: 00000002
5: 10000002 end t2
6: 10000002 end t2
instruction count:
3
entry point:
4
* stdlib/optimize.tl (basic-blocks peephole-block): Here, we
add an optimization for the useless assignment pattern.
If an "ifq tx dy label" instruction falls through to a
"mov tx dy", then we remove that move instruction from
the next block. But only if that next block has nothing
else jumping to it! If there are other jumps there, they could
be relying on that "mov tx dy", so it cannot be removed.
(basic-blocks elim-next-jump): The above optimization may
leave us with a useless ifq instruction, which jumps to
the same destination whether the comparison is true or not.
In elim-next-jmp, we took care only of jmp instructions which
uselessly jump to the next block in instruction order.
We fix this to also eliminate if and ifq instructions whose
destination label is the next block; they are equivalent to
an unconditional jump.
|
|
|
|
|
| |
* stdlib/type.tl (typecase): Return nil (as documented) instead of t
when a matching clause has no clause forms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (arith_each_set_entries): Trigger autoload on
new symbols.
* stdilb/arith-each.tl (sys:arith-each): Generalize macro to
handle short-circuiting logical operations. The op-iv
parameter, which is a cons, is spread into two op and iv
parameter.
One new argument appears, short-circ. This specifies a code
for short-circuiting behavior: t means iteration continues
while the result is true; nil means it continues while it is
nil, and + means iteration continues while the accumulator is
nonzero. A new convention is in effect: the operator has
to be specified as a list in order to request accumulating
behavior, e.g (+) or (*). Otherwise the operator specifies a
predicate that is applied to the forms, without taking into
account the prior value.
(sum-each, sum-each*, mul-each, mul-each*): Spread the op-iv
arguments. Wrap the op argument in a list to request
accumulation. In the case of mul-each and mul-each*, specify +
for the short-circ argument, which means that iteration stops
when the accumulator becomes zerop. sum-each and sum-each*
specify : for the short-circ argument which is unrecognized,
and so ther is no short-circuiting behavior.
(each-true, some-true, each-false, some-false): New macros.
* tests/016/arith.tl: New tests.
* txr.1: Documented new macros and added note about possible
short-circuiting in mul-each and mul-each*.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/arith-each.tl (sys:arith-each): If there are no vars,
then just reduce to the identity element value.
This is alreading happening fine for the each-prod family
of operators.
* tests/016/arith.tl: Test cases covering the no vars
and empty iteration identity element cases for sum-each and
mul-each, as well as the *-prod variants.
* txr.1: Document empty iteration and empty vars behavior
for arithmetic each operators as well as the each-prod
family.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*LICENSE, LICENSE-CYG, METALICENSE, Makefile, alloca.h,
args.c, args.h, arith.c, arith.h, buf.c, buf.h, cadr.c,
cadr.h, chksum.c, chksum.h, chksums/crc32.c, chksums/crc32.h,
combi.c, combi.h, configure, debug.c, debug.h, eval.c, eval.h,
ffi.c, ffi.h, filter.c, filter.h, ftw.c, ftw.h, gc.c, gc.h,
glob.c, glob.h, hash.c, hash.h, itypes.c, itypes.h, jmp.S,
lex.yy.c.shipped, lib.c, lib.h, linenoise/linenoise.c,
linenoise/linenoise.h, lisplib.c, lisplib.h, match.c, match.h,
parser.c, parser.h, parser.l, parser.y, protsym.c, psquare.h,
rand.c, rand.h, regex.c, regex.h, signal.c, signal.h,
socket.c, socket.h, stdlib/arith-each.tl, stdlib/asm.tl,
stdlib/awk.tl, stdlib/build.tl, stdlib/cadr.tl,
stdlib/compiler.tl, stdlib/constfun.tl, stdlib/conv.tl,
stdlib/copy-file.tl, stdlib/debugger.tl, stdlib/defset.tl,
stdlib/doloop.tl, stdlib/each-prod.tl, stdlib/error.tl,
stdlib/except.tl, stdlib/ffi.tl, stdlib/getopts.tl,
stdlib/getput.tl, stdlib/hash.tl, stdlib/ifa.tl,
stdlib/keyparams.tl, stdlib/match.tl, stdlib/op.tl,
stdlib/optimize.tl, stdlib/package.tl, stdlib/param.tl,
stdlib/path-test.tl, stdlib/pic.tl, stdlib/place.tl,
stdlib/pmac.tl, stdlib/quips.tl, stdlib/save-exe.tl,
stdlib/socket.tl, stdlib/stream-wrap.tl, stdlib/struct.tl,
stdlib/tagbody.tl, stdlib/termios.tl, stdlib/trace.tl,
stdlib/txr-case.tl, stdlib/type.tl, stdlib/vm-param.tl,
stdlib/with-resources.tl, stdlib/with-stream.tl,
stdlib/yield.tl, stream.c, stream.h, struct.c, struct.h,
strudel.c, strudel.h, sysif.c, sysif.h, syslog.c, syslog.h,
termios.c, termios.h, time.c, time.h, tree.c, tree.h, txr.1,
txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h, vm.c, vm.h,
vmop.h, win/cleansvg.txr, y.tab.c.shipped: Copyright year
bumped to 2022.
|
|
|
|
| |
* stdlib/quips.tl (%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.
|
|
|
|
|
|
|
| |
* txr.1: New section about special variable
*struct-clause-expander*.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
| |
* stdlib/match.tl (expand-quasi-match): Add regex cases with
bound variable.
* tests/011/patmatch.tl: Test cases for this.
* txr.1: Documented.
|
|
|
|
|
| |
* stdlib/match.tl (expand-quasi-match): Fix too few arguments
to compile-error for format args.
|