| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I realized this issue while implementing Ctrl-Z for the pw
(Pipe Watch) program. Sending the SIGTSTP signal just to the
calling process is not enough. Only that process gets
suspended, which results in a weird behavior. It can be
tested like this, for instance:
txr | tee file
Ctrl-Z must be issued twice: once to sort of suspend txr, and
then again to send it to the tee program. Then the job
actually suspends and the shell prompt appears. With this fix,
the above situation requires only one Ctrl-Z, as expected.
* linenoise/linenoise.c (history_search, show_help, edit):
Don't raise(SIGTSTP), but kill(0, SIGTSTP) to send the suspend
signal to all processes in the process group.
|
|
|
|
|
|
| |
* txr.1: Document the existing behavior that the various
FFI string types map between the null pointer and the nil
object.
|
|
|
|
|
| |
* txr.1: Document the (ptr (array 1 <type>)) trick needed for
out or in-out parameters.
|
|
|
|
|
|
|
| |
* eval.c (load): Use path_cat and dir_name instead of ad hoc
path munging.
* match.c (v_load): Likewise.
|
|
|
|
|
| |
* tests/019/load-search.tl: Add some cases that explore
the load search path.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* parser.[ch] (open_txr_file): spec_file is now called first_try_path.
The name parameter is called orig_in_resolved_out. Currently it has
just the resolved_out semantics, but that is about to change.
|
|
|
|
|
|
| |
* stream.c (open_subprocess, open_commad): Only flush standard
output for non-input pipes. If we are capturing the output of
the process, then it is unrelated to our standard output.
|
|
|
|
|
|
| |
* stream.c (open-subprocess, open_command, run): Flush the standard
output stream before forking or spawning the child process.
This gets tests/018/forkflush.tl to pass.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test case exemplifies code that will work as expected
when *stdout* is a TTY device, such that line buffering is
in effect, but then break when standard output is redirected
to a file.
The issue is that the controlling process is not flushing its
standard output when calling the external script, so the
script's output gets placed ahead of the process' own earlier
output.
* tests/018/forkflush.tl: New file.
* tests/018/forkflush.expected: New file.
|
|
|
|
|
|
|
| |
* txr.1: The Top-Level Forms and File Compilation Model
sections now reference back to eval, noting its similar
treatment of top-level forms. Without this, it looks like
top-level forms are just a compilation concept.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a partial revert of the May 1, 2019 commit
065dde19dfbe50e91e313e5b3ccc033cfbe47f74,
titled "loading: try unsuffixed files directly last".
Test cases added in prior commit now pass.
* parser.c (open_txr_file); Like before the 2019 commit, we
try the exact path that is specified first. Only if that is
not found do we try adding suffixes to a file which has no
recognizable suffix. This does mean that (load "foo") will
probe the filesystem twice in order to find "foo.tl" or
"foo.tlo" there is no obvious way around that that doesn't
cause a problem.
* txr.1: Update documentation that is outdated, incomplete,
incorrect, or that is has become incorrect because of this
fix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test currently fails because when we execute an
unsuffixed file like test/019/a, which exists,
another file is executed instead, like test/019/a.txr.
* tests/019/data/a,
* tests/019/data/a.tl,
* tests/019/data/a.tlo,
* tests/019/data/a.txr
* tests/019/data/b.tl
* tests/019/data/b.tlo
* tests/019/data/b.txr
* tests/019/data/c.tl
* tests/019/data/c.txr
* tests/019/load-search.tl: New files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test currently fails. This problem was reported
by Paul Patience, with a repro test case.
The issue is that when compile-file is processing a
(defpackage x ...) form, and the package x already exists, it
fails to recognize the form as a package-manipulating form,
and therefore fails to introduce a "fence" in the output
so that subsequent material is placed into a new top-level
object.
The compiled image fo the (defun foo:fun ()) form in
program.tl causes an error: the foo package does not
exist. This is because the symbol foo:fun is being read
as part of the same object which holds the compiled image of
the defpackage form which defines the package.
It's essentially the same problem as this
(let ()
(defpackage :foo)
foo:bar)
The (defpackage ...) cannot execute until the entire form is
read, but that form contains foo:bar which requires the foo
package to exist.
* tests/019/compile-package.tl: New file.
* tests/019/data/program.tl: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* ffi.c (ffi_init_types): Move initialization of str-d type
from just before wstr to after, for consistency.
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: in the case when the argument contains
single quotes, we try to identify the subcase that cannot use
double quotes instead. That subcase is not correctly
identified: it occurs when there are double quotes, dollar
signs **or backslashes**. For instance the data '\ cannot
be put into double quotes as "'\" on account of the backslash,
which is an active character in double quotes. We also
simplify the pattern by using a character class.
|
|
|
|
|
|
| |
* configure: a certain ' ' (four spaces between
single quotes is actually supposed to be a tab;
it must have been expanded by the editor.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In FFI foreign function and closure calls, it behooves us to
iterate over the arguments in the opposite order after the
call is done. By doing that, any freeing of memory that will
be done will be in the opposite order. And that is necessary
if some left argument allocates a pointer that is shared with
a right argument. An example of this occurs in the strtol
function:
long int strtol(const char *nptr, char **endptr, int base);
Here, the function sets *endptr to a value derived by
displacing ptr. If we call this function via FFI, then FFI
will allocate memory for nptr. When the function returns,
if we destroy that memory before processing *endptr
then *endptr contains an invalid pointer.
* ffi.c (ffi_call_wrap): In the in pass, iterate arguments
in reverse.
(ffi_closure_dispatch, ffi_closure_dispatch_safe):
Stack-allocate an array for the argument types, so we don't
have to pop the list twice, and to allow access in reverse
order. In the out pass, iterate arguments in reverse.
|
|
|
|
|
| |
* txr.1: Remove copy operation partition-by expression; this
was needed when sort was destructive.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* tests/010/hash.tl: New tests.
|
|
|
|
|
|
|
| |
* hash.c (group_reduce): Replace loop with call to hash_update
which is exactly the same logic, and even more efficient
because it avoids calling us_rplacd.
(hash_update): Fix incorrect self name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* txr.1: Add introductory paragraph, and fine-tune the rest of
the documentation.
|
|
|
|
|
|
| |
* txr.1: A December 2021 change that went into TXR 273 allows
iterators from iter-begin to be the object argument to the
make-like function. This is now 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (find_max): Simplify into a single loop rather than
handling various sequence types specially. This means it
works for all iterable objects now.
* txr.1: find-max documentation updated; discussion of
hash tables removed, since the described behavior is the
one expected for hash tables as iterables.
* tests/012/seq.tl: Add some test coverage.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gc.c (sweep_one): The recent fix to address the clang
diagnostic from -fsanitize=implicit-conversion broke C++
compatibility, due to enums being type safe. We revert the
expression to the original, before that fix, and address the
clang diagnostic differently.
* gc.h (REACHABLE, FREE): Add a U suffix to the constants to
make them unsigned. The implicit conversion issue in the
expression convert(type_t, block->t.type & ~REACHABLE)
is that ~REACHABLE is -257, and is being converted to
unsigned.
|
|
|
|
|
|
|
| |
* termios.c (termios_init): The CMSPAR and CRTSCTS constants
cannot be passed to num_fast; they are out of range, and so
the corresponding cmspar and crtscts variables will end up
with garbage values.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The recent autoload changes have degraded method completion,
which didn't work well in the first place.
Test case: with this change you can type term.(go[Tab] to
complete to term.(go-raw or term.(go-cbreak.
* parser.c (find_matching_syms): Do not use the get_slot_syms
function for finding method and slot symbols. Just use
get_visible_syms, like for other bindings. Instead, in the switch
statement in the loop, for the 'M' (method) and 'S' (slot)
completion types, we use the static_slot_types and slot_types
functions to inquire whether a symbol has a binding. And these
two functions do something important: unlike get_slot_syms,
they trigger autoload.
* struct.c (get_slot_syms): Function removed.
* struct.h (get_slot_syms): Declaration removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* autoload.c (sock_set_entries, sock_instantiate): Functions
removed from here.
(autoload_init): autoload_reg call for above functions removed
from here.
(autoload_intern): New function, wrapper for intern_only.
sock_set_entries uses intern_only which is static, so we need
to expose this.
* autoload.h (autoload_intern): Declared.
* socket.c (sock_set_entries, sock_instantiate): Functions
moved here. intern_only call replaced with autoload_intern.
(sock_load_init): Function removed: body moved into
sock_instantiate, which no longer calls sock_load_init.
|
|
|
|
|
|
|
|
|
|
|
| |
* autoload.c (termios_set_entries, termios_instantiate):
Static functions removed from here.
(autoload_init): autoload_reg call for above functions removed
from here.
* termios.c (termios_set_entries, termios_instantiate): Static
functions moved here.
(termios_init): autoload_reg call moved here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In autoload the _set_entries functions are being called
twice: the first time with a functional argument to associate
symbols with that function, and then when the module is loaded,
a second time with a nil argument to erase those associations.
This is inefficient; some modules have many symbols to remove
from a hash. What we can do is make the hash weak; associate
the symbols with a function weakly, such that those entries
lapse when the function becomes garbage. Lapsing of weak hash table
entries during GC is more efficient than making numerous calls
to remhash. We can use a separate strong hash table to hang on
to the functions; when a module is instantiated, all we have to
do is remove the instantiation function from the table. Then
that function is reachable only as a weak value from the other
tables.
* autoload.c (autoload_reg_hash): New static variable.
(place_instantiate, ver_instantiate, ifa_instantiate,
txr_case_instantiate, with_resources_instantiate,
path_test_instantiate, struct_instantiate,
with_stream_instantiate, hash_instantiate, except_instantiate,
type_instantiate, yield_instantiate, sock_instantiate,
termios_instantiate, awk_instantiate, build_instantiate,
trace_instantiate, getopts_instantiate, package_instantiate,
getput_instantiate, tagbody_instantiate, pmac_instantiate,
error_instantiate, keyparams_instantiate, ffi_instantiate,
doloop_instantiate, stream_wrap_instantiate, asm_instantiate,
compiler_instantiate, debugger_instantiate, op_instantiate,
save_exe_instantiate, defset_instantiate,
copy_file_instantiate, arith_each_instantiate,
each_prod_instantiate, quips_instantiate, match_instantiate,
doc_instantiate, pic_instantiate, constfun_instantiate):
Remove set_fun argument and call to that function.
(autoload_reg): Remove argument from instantiate function.
Add the function to the autoload_reg_hash table, associated
with the t symbol.
(autoload_init_tables): Initialize autoload_reg_hash.
Turn the existing symbol hashes into weak tables. Let's use
weak or-semantics, so they don't hang onto uninterned symbols.
(autoload_try): If a symbol resolves to a function,
indicating a load might be required, we now must verify
whether that is really the case by seeing whether the function
exists in the autolod_reg_hash table. If so, we remove it from
that table and do the load.
* autoload.h (autoload_reg): Declaration updated.
* gencadr.txr (cadr_register): Remove set_fun argument and
call to that function.
* cadr.c: Regenerated.
|
|
|
|
|
| |
* txr.1: In description of make-hash, fix bungled typesetting
of "or-semantics".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (OBJS): rename lisplib.o to autoload.o.
* lisplib.c: Renamed to autoload.c.
(lisplib_init_tables): Renamed to autoload_init_tables.
(lisplib_init): Renamed to autoload_init, and calls
autoload_init_tables.
(lisplib_try_load): Renamed to autoload_try.
(autoload_try_fun, autoload_try_var, autloload_try_slot,
autoload_try_struct, autoload_try_keyword): Follow rename.
* lisplib.h: Renamed to autoload.h.
(lisplib_init): Renamed to autoload_init.
* eval.c: Include autoload.h.
(eval_init): Follow rename of lisplib_init.
* gencadr.txr: include "autoload.h"
* cadr.c: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 (sock_set_entries): Add autoload entries for a
number of socket-relatd variables that were recently moved out
of the FFI module (no part of which auto-loads) into socket.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Autoloads are now keyed to spearate namespaces for
functions/macros, variables, structures, slots and a keyword
namespace for autoloading miscellaneous things tied to
keywords like parameter macros.
There is some renaming going on as part of this. The "dlt"
acronym is replaced by "autload". Some functions in lisplib.c
were in an inconsistent order, and were reordered.
Motivation: the one namespace autoload causes hidden problems
in the standard library, due to inappropriate loads. This
shows up particularly when then uncompiled library is used.
Tests no longer execute as they should.
Story time: when struct.tl is autloaded, it loads param.tl
for parameter parsing, param.tl defines a structure that has
an opt slot, and accesses it with an expression like me.opt.
When this expression is expanded, the qref macro checks
whether opt is a valid slot, and for that, autoload is
triggered. But, oops, opt is a function in getopts.tl,
Thus param.tl autoloads getopt.tl. Paul A. Patience recently
introduced changes into getopt.tl that make use of pattern
matching. So getopt.tl auto-loads match.tl. But match.tl uses
structures. But, oops, that material is defined in struct.tl,
which is in progress of being auto-loaded. Thus, a false
circular dependency exists, caused by a check of the opt slot
triggering the loading of the irrelevant getopts.tl module.
These irrelevant loads will also slow down the compiling of
the library also, as well as test cases when the library is
not compiled: especially tests run under the GC torture test.
* lisplib.c (dl_table): Global variable removed.
(autoload_hash): New static array.
(set_dlt_entries_impl): Renamed to autoload_set_impl.
(autoload_set_impl): Takes al_ns_t namespace enum argument.
Operates on the hash table indicated by that argument.
(set_dlt_entries): Renamed to autoload_set.
(set_dlt_entries_sys): Renamed to autoload_sys_set.
(autoload_key_set): New static function.
(place_set_entries, ver_set_entries, ifa_set_entries,
txr_case_set_entries, with_resources_set_entries,
path_test_set_entries, struct_set_entries,
with_stream_set_entries, hash_set_entries, except_set_entries,
type_set_entries, yield_set_entries, sock_set_entries,
termios_set_entries, awk_set_entries, build_set_entries,
trace_set_entries, getopts_set_entries, package_set_entries,
getput_set_entries, tagbody_set_entries, pmac_set_entries,
error_set_entries, keyparams_set_entries, ffi_set_entries,
doloop_set_entries, stream_wrap_set_entries, asm_set_entries,
compiler_set_entries, debugger_set_entries, op_set_entries,
save_exe_set_entries, defset_set_entries,
copy_file_set_entries, arith_each_set_entries,
each_prod_set_entries, quips_set_entries, match_set_entries,
doc_set_entries, pic_set_entries, constfun_set_entries):
Separate name arrays into multipel namespaces as appropriate
and register using approprate namespace enums.
(dlt_register): Renamed to autoload_reg.
(autoload_reg): dlt parameter removed.
(lisplib_try_load): Take namespace enum argument, and check
against the corresponding hash.
(lisplib_try_load_fun, lisplib_try_load_var,
lisplib_try_load_slot, lisblib_try_load_struct,
lisplib_try_load_keyword): Pass appropriate enum value to
lisplib_try_load to request the right namespace.
(lisplib_try_load_fun_var): Call lisplib_try_load_fun,
and if that does nothing, lisplib_try_load_var.
(lisplib_init_tables): New function.
(lisplib_init): References to dl_table removed. Call to
dlt_register replaced with autoload_reg.
* lisplib.h (dl_table): Declaration removed.
(enum autoload_ns, al_ns_t): New enum.
(set_dlt_entries, dlt_register): Declarations removed.
(autoload_set, autoload_reg): Declared.
* gencadr.txr (cadr_set_entries): Drop dlt parameter, call
autoload_set instead of set_dlt_entries.
(cadr_init): Call autoload_reg instead of dlt_register.
* cadr.c: regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compiler module contains the with-compilation-unit macro;
if that macro is used, it is auto-loaded. However, when a file
that uses with-compilation-unit is compiled, the macro is
gone; its expansion refers to the sys:*in-compilation-unit*
which is defined in the compiler module also. However, there
is no autoload set up for it.
* lisplib.c (compiler_set_entries): Add
sys:*in-compilation-unit* to the list of symbols that trigger
autoloading.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* alloca.h (zalloca): Macro moved here from ffi.c; it's useful
to any code that wants to do a zero-filled alloca, and
socket.c needs it now.
* ffi.c (HAVE_SOCKETS): All includes conditional on HAVE_SOCKETS
removed.
(zalloca): Macro removed; moved to alloca.h.
(ffi_type_struct_checked, ffi_type_lookup): Static functions
changed to external linkage.
(ffi_type_size, ffi_type_put, ffi_type_get): New functions,
used by external module that has incomplete definition of
struct txr_ffi_type.
(type_by_size): New static array, moved out of
ffi_init_extra_types function.
(ffi_type_by_size): New function.
(ffi_init_extra_types): type_by_size array relocated to
file scope.
(sock_opt, sock_set_opt): Moved to socket.c, and adjusted to
use newly developed external access to needed ffi mechanisms.
(ffi_init): Numerous definitions related to sockets removed;
these go to socket.c.
* ffi.h (struct txr_ffi_type): Declared here now as
incomplete type.
(ffi_type_struct_checked, ffi_type_size, ffi_type_put,
ffi_type_get, ffi_type_lookup, ffi_type_by_size): Declared.
* lib.c (init): Call new function sock_init.
* socket.c (sock_opt, sock_set_opt): New functions, moved
from ffi.c, and slightly adapted to work with external
interfaces exposed by ffi.c.
(sock_init): New function. This performs unconditional
initializations not keyed to the lazy loading lisplib.c
mechanism. Here we create the socklen-t FFI type.
FFI types lookup doesn't trigger lazy loading, so we do it
this way; the alternative would be to introduce lazy load
triggering to FFI type lookup, just for this one type.
(sock_load_init): All the socket function and variable
registrations move here from ffi_init.
|
|
|
|
|
|
| |
* txr.1: Mention that ANSI CL's fboundp doesn't yield true for
lambda expressions, and how that affects the example
expression's fidelity.
|