| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The general count function, with keyfun and testfun,
is noticeably absent. Let's implement it.
* lib.[ch] (count): New function.
* eval.c (eval_init): Register count intrinsic.
* tests/012/seq.tl: Some tests for count.
* txr.1: Add count to count-if section. Revise documentation
based on pos/pos-if.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* protsym.c: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/getput.tl (command-get, command-put, command-get-string,
command-put-string, command-get-lines, command-put-lines,
command-put-buf, command-get-json, command-put-json,
command-get-jsons, command-put-jsons): Add mopt parameter,
which is interpolated into appropriate mode string.
This allows "z" to be used for gzip compression.
* txr.1: Updated Syntax synopses.
|
|
|
|
|
| |
* stdlib/getput.tl (file-get-lines): A mode-opt parameter is
documented for this function; it is now actually implemented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (me_for): Require at least one argument.
However, we let the init-forms continue to be optional
and document it.
* txr.1: Refer to for and for* as macros, since they have been
since 2016. The omission of the inc-form list is shown
as a second variant of the syntax. This is to avoid misleading
the reader into thinking that the the inc-form list can be
omitted while body forms are present. A spurious paragraph
reiterating that the macros establish an anonymous block is
removed. That extra text was present in the first draft written
in 2011, and maintained since.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The str function is like mkstring but allows a fill pattern
to be specified.
* eval.c (eval_init): str intrinsic registered.
* lib.[ch[ (str): New function.
* tests/015/str.tl: New file.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following test case throws an exception:
(compile-toplevel '(when-match @(or
@b @c)
nil nil))
the reason is that in the optimizer, the local-liveness method
resets the bl.live set of live registers to nil. The expectation
is that it will be recalculated. However, what happens is that
* stdlib/optimize.tl (basic-block): Initialize live slot to zero.
(basic-blocks local-liveness): Reset bl.live to 0, rather than nil.
The problem is that sometimes the block in question is not reached
in the graph traversal (down in the same function) which is
supposed to assign it a live value. This happens in the above
test case, and it's not due to any bug: the block is not reached
by the forward traversal because the block has become unreachable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The root slot is just supposed to be (car bl.list): the
first basic block. Unfortunately, it's not maintained
when bl.list is edited, which could cause bugs.
This change makes no difference in the stdlib compiled files,
other than of course the changes in optimize.tlo from this
code change itself; so that is evidence suggesting
this change is least not making anything worse.
* stdlib/optimize.tl (basic-blocks): Remove root slot.
(basic-blocks (link-graph, calc-liveness, elim-dead-code):
Refer to (car bl.list) instead of bl.root.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of trying to work the new count parameter into the spl and
tok functions, it's better to make new ones.
* eval.c (eval_init): spln and tokn intrinsics registered.
* lib.[ch] (spln, tokn): New functions.
* tests/015/split.tl: New test cases.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
| |
* buf.c (buf_compress, buf_decompress): New static functions.
(buf_init): buf-compress and buf-decompress intrinsics registered.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is motivated by the desired to be able to
specify gzip compression: e.g.
(file-put-string "file.gz" "abc" "z")
However, it has other uses. For instance with "x",
we can exclusively create a file with content in one
call.
* stdlib/getput.tl (file-get, file-put, file-append,
file-get-string, file-put-string, file-append-string,
file-put-lines, file-append-lines, file-get-buf,
file-put-buf, file-place-buf, file-append-buf, file-get-json,
file-put-json, file-append-json, file-get-jsons,
file-put-jsons, file-append-jsons): New option argument
which combines with the open-file mode.
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (trim_path_seps): New function.
(stream_init): trim-path-seps intrinsic registered.
* stream.c (trim_path_seps): Declared.
* tests/018/path.tl: New tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ffi.c (pack_s): New symbol variable.
(ffi_type_compile): Handle new pack type operator together with
align. Allow a one-argument form of align and pack in which
the value is defaulted. The behavior of align changes: align
can only increase alignment now, never decrease, so for
instance (align 1 ...) does nothing. pack must be used to
decrease alignment. Furthermore, for certain argument types,
pack performs transformations of the type syntax, rather than
compiling the argument type and producing a variant of it with
altered alignment.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
| |
* stdlib/copy-file.tl (copy-path-rec): When from-path has
a trailing slash, the starts-with test fails, and the operation
fails without doing anything. Let's just get rid of that test.
It's probably only there because of the ad-hoc path munging
that is calculating rel-path. Why don't we just use the rel-path
function for that.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/match.tl (expand-lambda-match): A pattern that
is shorter than the maximum number of arguments is
augmented with a check ensuring that no fixed arguments
are present beyond those that the pattern requires.
However, this check must be omitted if the pattern is
variadic, because those excess arguments match its tail
pattern.
* tests/011/patmatch.tl: Cases added.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (load_search_dirs_s): New symbol variable.
(load): Initialize the name variable whose address is passed
as the third argument of open_txr_file, which is now
an in-out parameter. Pass t for the new search_dirs parameter,
so that load benefits from the searching.
(eval_init): Initialize load_search_dirs_s and register the
*load-search-dirs* special variable.
* eval.h (load_search_dirs_s): Declared.
(load_search_dirs): New macro.
* match.c (v_load): Initialize the variable passed as third argument
of open_txr_file.
* parser.c (open_txr_file): Take a new argument, search_dirs.
If this is t, it tells the function "if the path is not found,
then recurse on the *load-search-dirs* variable. Otherwise,
if the value is not t, it is a list of the remaining directories
to try. The existing parameter orig_in_resolved_out must now
point to a location which is initialized. It is assumed to hold
the original target that was passed to the load function.
The first_try_path is a the path to actually try, derived from
that one. Thus, the caller of open_txr_file gets to determine
the initial try path using its own algorithm. Then any recursive
calls that go through *load-search-dirs* will pass a first argument
which is made of the original name, combined with a search dir.
(load_rcfile): Pass pointer to initialized location as third
argument of open-txr_file, and pass a nil value for search_dirs:
no search takes place when looking for that file, which is at a
single, fixed location.
* parser.h (open_txr_file): Declaration updated.
* txr.c (sysroot_init): Initialize *load-search-dirs*.
(txr_main): Ensure third argument in all calls to open_txr_file
points to initialized variable, with the correct value,
and pass t for the search_dirs argument.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
New: load can search multiple directories.
* eval.c (load_search_dirs_s): New symbol variable.
(load): Initialize the name variable whose address is passed as
the third argument of open_txr_file, which is now an in-out
parameter. Pass t for the new search_dirs parameter, so that
load benefits from the searching.
(eval_init): Initialize load_search_dirs_s and register the
*load-search-dirs* special variable.
* eval.h (load_search_dirs_s): Declared.
(load_search_dirs): New macro.
* match.c (v_load): Initialize the variable passed as third
* argument
of open_txr_file.
* parser.c (open_txr_file): Take a new argument, search_dirs.
If this is t, it tells the function "if the path is not found,
then recurse on the *load-search-dirs* variable. Otherwise, if
the value is not t, it is a list of the remaining directories
to try. The existing parameter orig_in_resolved_out must now
point to a location which is initialized. It is assumed to hold
the original target that was passed to the load function. The
first_try_path is a the path to actually try, derived from that
one. Thus, the caller of open_txr_file gets to determine the
initial try path using its own algorithm. Then any recursive
calls that go through *load-search-dirs* will pass a first
argument which is made of the original name, combined with a
search dir.
(load_rcfile): Pass pointer to initialized location as third
argument of open-txr_file, and pass a nil value for
search_dirs: no search takes place when looking for that file,
which is at a single, fixed location.
* parser.h (open_txr_file): Declaration updated.
* txr.c (sysroot_init): Initialize *load-search-dirs*.
(txr_main): Ensure third argument in all calls to open_txr_file
points to initialized variable, with the correct value, and
pass t for the search_dirs argument.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/compiler.tl (compile-file-conditionally): Recognize a
potential package-manipulating form not checking whether its
main operator is in %pakage-manip% list, but whether any
global functions that its compiled image references are in
that list. This is the same approach that is used in
dump-compiled-objects. This fix is needed for correctly
recognizing defpackage as a package-manipulating form.
defpackage macro-expands to a let form which contains a call
to make-package. Testing whether let is in %package-manip% is
useless; of course it isn't, and the test overlooks
make-package.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register isecp intrinsic.
* lib.c (isecp): New function.
* lib.h (isecp): Declared.
* stdlib/compiler.tl (lambda-apply-transform,
dump-compiled-objects): Use isecp instead of isec, since the
actual intersection of symbols isn't needed, only whether it
exists.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These types actually make it possible to receive a string by
pointer from a C function, without trying to free it.
It is now possible to write a FFI wrapper for strtol or
wcstol, which is done in the new test case.
* ffi.c (str_s_s, bstr_s_s, wstr_s_s): New symbol variables.
(ffi_init_types): Register the types str-s, bstr-s and wstr-s.
(ffi_init): Intern the new symbols.
* tests/017/str-s.tl: New file.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: detect intmax_t and place HAVE_INTMAX_T into
config.h.
* ffi.c (ffi_init_extra_types): register intmax-t and
uintmax-t types. If HAVE_INTMAX_T is missing, then make them
aliases for longlong and ulonglong.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
| |
* stdlib/quips.tl (%quips%): Samsung spelled backwards is
gnusmaS. In December, don't wish Merry GNUsmas in a GNU
mailing list.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* hash.c (group_map): New function.
(hash_init): group-map intrinsic registered.
* hash.h (group_map): Declared.
* tests/010/hash.tl: New test case.
* txr.1: Documented together with group-by.
Extra paren removed from group-by example.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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: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.
|