| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
no effect if the variable already exists.
* txr.1: Documented defvar and lisp-parse.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New catenated streams make the Yacc hack possible.
* eval.c (eval_init): Register lisp_parse as intrinsic.
* parser.h (lisp_parse): Declared.
* parser.l: New lexical hack to produce SECRET_ESCAPE_E token.
(regex_parse): Move declaration before statements.
(lisp_parse): New function.
* parser.y (SECRET_ESCAPE_E): New token type.
(spec): New production rule for single expression.
* stream.c (cat_stream_print, cat_get_line, cat_get_char,
cat_get_byte, cat_get_prop): New static functions.
(cat_stream_ops): New static function.
(make_catenated_stream): New function.
* stream.h (make_catenated_stream): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* signal.c (sig_hup, sig_int, sig_quit, sig_ill, sig_trap, sig_abrt,
sig_bus, val sig_fpe, sig_kill, sig_usr1, sig_segv, sig_usr2, sig_pipe,
sig_alrm, val sig_term, sig_chld, sig_cont, sig_stop, sig_tstp,
sig_ttin, val sig_ttou, sig_urg, sig_xcpu, sig_xfsz, sigtalrm,
sig_prof, val sig_poll, sig_sys, sig_winch, sig_iot, sig_stkflt,
sig_io, sig_lost, sig_pwr): New variables.
(sig_init): New variables initialized.
* signal.h: New variables declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (OBJS-y): Include signal.o if have_posix_sigs is "y".
* configure (have_posix_sigs): New variable, set by detecting POSIX
signal stuff.
* dep.mk: Regenerated.
* arith.c, debug.c, eval.c, filter.c, hash.c, match.c, parser.y,
parser.l, rand.c, regex.c, syslog.c, txr.c, utf8.c: Include new
signal.h header, now required by unwind, and the <signal.h> system
header.
* eval.c (exit_wrap): New function.
(eval_init): New functions registered as intrinsics: exit_wrap,
set_sig_handler, get_sig_handler, sig_check.
* gc.c (release): Unused functions removed.
* gc.h (release): Declaration removed.
* lib.c (init): Call sig_init.
* stream.c (set_putc, se_getc, se_fflush): New static functions.
(stdio_put_char_callback, stdio_get_char_callback, stdio_put_byte,
stdio_flush, stdio_get_byte): Use new functions to enable
signals when blocked on I/O.
(tail_strategy): Allow signals across sleep.
(pipev_close): Allow signals across waitpid.
(se_pclose): New static function.
(pipe_close): Use new function to enable signals across pclose.
* unwind.c (uw_unwind_to_exit_point): use extended_longjmp instead of
longjmp.
* unwind.h (struct uw_block, struct uw_catch): jb member changes from
jmp_buf to extended_jmp_buf.
(uw_block_begin, uw_simple_catch_begin, uw_catch_begin): Use
extended_setjmp instead of setjmp.
* signal.c: New file.
* signal.h: New file.
|
|
|
|
|
|
| |
and HAVE_DAEMON.
* eval.c: daemon support must be wrapped in #if HAVE_DAEMON
|
|
|
|
|
|
|
|
|
|
| |
* syslog.c (log_authpriv_v): New variable.
(syslog_init): New variable initialized.
* syslog.h (log_authpriv_v): Declared.
* txr.1: Documented log-authpriv, and put in notes about testing
for variables that may not be present, including log-perror.
|
|
|
|
|
|
| |
(eval_init): New functions registred as intrinsics.
* txr.1: Documented.
|
|
|
|
| |
Fixing some errors in copyright comments.
|
|
|
|
|
|
|
|
| |
* syslog.c (closelog_wrap): New function.
* syslog.h (closelog_wrap): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
stream_get_prop and stream_set_prop as intrinsics.
* stream.c (stream_get_prop): New function.
* stream.h (stream_get_prop): Declared.
* syslog.c (syslog_get_prop): Bugfix: check for prio_k not real_time_k.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile: Use -iquote to restrict our #include search paths from
being processed for #include <...>. Add syslog.o to OBJS-y if
have_syslog is y.
* configure (have_syslog): New variable, set by detecting syslog API.
* eval.c (eval_init): logand and logior registrations changed to
go to variadic versions. New syslog variables and functions registered.
* lib.c (logandv, logiorv): New functions.
* lib.h (logandv, logiorv): Declared.
* txr.c (main): Call syslog_init.
* syslog.c: New file.
* syslog.h: New file.
* txr.1: Updated.
* txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile: Use -iquote to restrict our #include search paths from being
processed for #include <...>. Add syslog.o to OBJS-y if have_syslog is y.
* configure (have_syslog): New variable, set by detecting syslog API.
* eval.c (eval_init): logand and logior registrations changed to
go to variadic versions. New syslog variables and functions registered.
* lib.c (logandv, logiorv): New functions.
* lib.h (logandv, logiorv): Declared.
* txr.c (main): Call syslog_init.
* syslog.c: New file.
* syslog.h: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to reflect that it has two arguments now.
* parser.y (grammar): Update calls to regex_compile to
pass two arguments. Since we don't expect regex_compile to
parse, we specify the error stream as nil.
(spec): The "secret syntax" for a regex is simplified
not to include the slashes. This provides better diagnostics for
unterminated syntax and requires less string processing to generate.
Also, the form returned doesn't have the regex symbol
consed onto it, which parse_regex just throws away.
* regex.c (regex_compile): Now takes a stream argument.
* regex.h (regex_compile): Declaration updated.
* txr.1: Updated
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
intrinsic function and std_null as new variable.
* parser.h (yylex_destroy): Existing function declared.
* parser.l (regex_parse): New function.
New lexical syntax added which returns SECRET_ESCAPE_R.
* parser.y (SECRET_ESCAPE_R): New token.
(spec): Added syntactic variant which lets us
smuggle a regex into the parser easily.
* stream.c:x (std_null): New global variable.
(null_stream_print): New static function.
(null_ops): New static structure.
(make_null_stream): New function.
(stream_init): Protect and initialize std_null.
* stream.h (std_null, make_null_stream): Declared.
* txr.1: New features documented: regex-parse, *stdnull*.
* txr.c (txr_main): Call yylex_destroy after parsing the program now
that I know about this function; this can free up some memory.
|
|
|
|
|
|
|
|
|
|
| |
and count_if registered as intrinsics.
* lib.c (countqual, countql, countq, count_if): New functions.
* lib.h (countqual, countql, countq, count_if): Declared.
* txr.1: New functions documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
have stricter diagnosis for configure tests.
(have_timegm, need_svid_source, need_bsd_source): New
variables. sys/stat.h test only declares static data and
compiles an object file. Adding tests for timegm, tzset,
setenv and unsetenv.
* eval.c (eval_init): Register new intrinsic, make_time_utc.
* lib.c (make_time_impl): New static function.
(make_time): Reimplemented as call to make_time_impl.
(timegm_hack): New conditionally-defined static function.
(make_time_utc): New function.
* lib.h (make_time_utc): Declared.
* txr.1: make-time-utc documented.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c: Include <unistd.h> conditionally.
(errno_wrap, daemon_wrap): New functions.
(eval_init): Registered errno_wrap and daemon_wrap as intrinsics
under the names daemon and errno.
* txr.1: Documented errno and daemon in new UNIX PROGRAMMING
section.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding wrapper for mktime.
* eval.c (apply): Handle function codes N5 through N7.
(eval_init): Register make_time as intrinsic.
* lib.c (auto_k): New keyword symbol variable.
(equal, generic_funcall): Handle N5-N7.
(func_n5, func_n6, func_n7, func_n5v, func_n6v, func_n7v): New
functions.
(obj_init): Initialize auto_k.
(make_time): New function.
* lib.h (functype_t): New enum members: N5, N6, N7.
(struct func): New members: n5, n6, n7, n5v, n6v, n7v.
(auto_k, func_n5, func_n6, func_n7, func_n5v, func_n6v, func_n7v,
make_time): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register new open_tail function as intrinsic.
* match.c (complex_snarf, complex_stream): Update calls to
make_stdio_stream and make_pipe_stream to take fewer arguments.
(match_files): Support a stream object as a data source specification
in place of a string.
* parser.l (parse_reset): Update call to make_stdio_stream to take
fewer arguments.
* stream.c: Inclusion of <unistd.h> made properly conditional.
(struct stdio_handle): pid member defined as pid_t only if we have fork
functionality, otherwise defined as int.
(tail_get_line, tail_get_char, tail_get_byte): New static functions.
(tail_ops): New static structure.
(make_stdio_stream_common): New static structure.
(make_stdio_stream, make_pipe_stream): These functions lose the input
and output parameters, which ended up never used. Reimplemented
in terms of new common function.
(make_tail_stream): New function.
(make_pipevp_stream): Reimplemented in terms of new common function.
(open_file, open_command): Simplified by removal of useless local
variables and their computation, which used to be extra arguments to
make_stdio_stream and make_pipe_stream.
(open_tail): New function.
(stream_init): Calls to make_stdio_stream updated.
* stream.h (make_stdio_stream, make_pipe_stream): Declarations updated.
(make_tail_stream, open_tail): Declared.
* txr.c (txr_main): Calls to make_stdio_stream updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bugfix in stdio_flush: check FILE * handle for null.
Minor cleanups.
* eval.c (eval_init): Register seek_stream as intrinsic.
* stream.c (from_start_k, from_current_k, from_end_k): New symbol
variables.
(strm_whence): New enum.
(strm_ops): New member, seek.
(stdio_maybe_write_error): Renamed to stdio_maybe_error; takes
new string argument to describe action.
(stdio_put_string, stdio_put_char, stdio_put_byte): Updated call to
stdio_maybe_error.
(stdio_flush): Updated call to stdio_maybe_error. Check
handle for null.
(stdio_seek): New static function.
(stdio_ops): Added stdio_seek.
(pipe_ops, string_in_ops, byte_in_ops, string_out_ops,
strlist_out_ops, dir_ops): Added explicit zero entries and comments for
unimplemented functions.
(seek_stream): New function.
(stream_init): New keyword symbols interned.
* stream.h (from_start_k, from_current_k, from_end_k): New
variables declared.
(dev_k, ino_k, mode_k, nlink_k, uid_k, gid_k, rdev_k, size_k,
blksize_k, blocks_k, atime_k, mtime_k, ctime_k, s_ifmt, s_iflnk,
s_ifreg, s_ifblk, s_ifdir, s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx,
s_irwxu, s_irusr, s_iwusr, s_ixusr, s_irwxg, s_irgrp,
s_iwgrp): Existing extern variables declared.
(seek_stream): New function declared.
* txr.1: Documented seek-stream.
|
|
|
|
|
|
|
|
|
|
| |
syntax appears in an op form, crashing the expander with infinite
recursion at program load time, before the code is run.
* eval.c (transform_op): The fi == var check to handle a
trailing op variable in the dot position of a form
needs to ensure that it really is @<num> type var, and
not the @<sym> type for instance.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Explicitly specifying @rest using (op ... . @rest)
did not work at all.
The then-func agument of iff and iffi may now be nil.
* eval.c (format_op_arg): New static function.
(transform_op): Handle dotted lists ending in @rest
or @<num>.
(supplement_op_syms): New static function.
(expand_op): Add missing numeric arguments,
so that all 1 through n are in the list.
Trailing rest is now added under different
conditions.
* lib.c (do_iff): Give thenfun the same
behavior on nil that elsefun enjoys.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version, set date and documented string-cmp.
* configure (txr_ver): Bumped.
* eval.c (eval_init): Forgotten string-cmp registered as intrinsic.
* txr.vim: Highlighting for string-cmp.
* RELNOTES: Updated.
|
|
|
|
|
|
|
|
| |
* lib.c (tok_str): New parameter, keep_sep.
* lib.h (tok_str): Declaration updated.
* txr.1: Documentation for tok-str updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added lazy-stringp. Changing names of length-str-{gt,ge,lt,le}
to be consistent with the >, >=, < and <= functions.
* lib.c (lazy_stream_func): Greatly simplified implementation.
The lazy list now continues by means of recursing via
an optimized version of lazy_stream_cons called lazy_stream_cont.
The environment structure is simplified to just hold the next item,
rather than a pointless list. The pointless setting of lcons->lc.func
to nil is also removed; this is always done by the caller.
(lazy_stream_cont): New static function, similar to lazy_stream_cons,
but optimized by not consing up a new function and new environment
cell.
(lazy_stream_cons): The environment for the update function
is simplified to just a single cons.
* txr.1: Documented lazy string functions and lazy-stream-cons.
|
|
|
|
|
|
|
| |
* lib.c (string_cmp): New function.
* lib.h (TYPE_SHIFT, TYPE_PAIR): New macros.
(string_cmp): Declared.
|
|
|
|
|
|
|
|
| |
* lib.c (tok_str): New function.
* lib.h (tok_str): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
time-string-utc.
* lib.c (string_time): New static function.
(time_string_local, time_string_utc): New functions.
* lib.h (time_string_local, time_string_utc): Declared.
* txr.1: Documented.
* RELNOTES: Updated.
|
|
|
|
|
|
| |
optional.
* txr.1: Documented random functions as well as range and range*
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Expose delete-package, rehome-sym
and packagep.
* lib.c (make_package, intern): use ~s formatting for package name in
error message.
(packagep, delete_package, rehome_sym): New functions.
* lib.h (packagep, delete_package, rehome_sym): Declared.
* txr.1: Documented process functions and packages.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (iff): Reversed argument names corrected. No functional
change.
(iffi): New function.
* lib.h (iffi): Declared.
* txr.1: Documented iffi.
|
|
|
|
|
|
|
| |
defaulting to a true test, allowing an infinite loop to
be expressed as (for () () () ...).
* txr.1: Documented.
|
|
|
|
| |
of using ctx_form.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Registered logtest.
Registered s-ifmt, s-iflnk, s-ifreg, s-ifblk, s-ifdir,
s-ifchr, s-ififo, s-isuid, s-isgid, s-isvtx, s-irwxu,
s-irusr, s-iwusr, s-ixusr, s-irwxg, s-irgrp, s-iwgrp,
s-ixgrp, s-irwxo, s-iroth, s-iwoth, s-ixoth variables.
* lib.h (logtest): Declared.
* stream.c (s_ifmt, s_ifsock, s_iflnk, s_ifreg, s_ifblk,
s_ifdir, s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx, s_irwxu, s_irusr,
s_iwusr, s_ixusr, s_irwxg, s_irgrp, s_iwgrp, s_ixgrp, s_irwxo, s_iroth,
s_iwoth, s_ixoth): New global variables.
* stream.h (s_ifmt, s_ifsock, s_iflnk, s_ifreg, s_ifblk,
s_ifdir, s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx, s_irwxu, s_irusr,
s_iwusr, s_ixusr, s_irwxg, s_irgrp, s_iwgrp, s_ixgrp, s_irwxo, s_iroth,
s_iwoth, s_ixoth): Declared.
* txr.1: Documented logtest and s-* variables for stat,
as well as open-file and open-directory.
|
|
|
|
|
|
|
|
| |
consistent with Common Lisp.
* eval.c (eval_init): logcomp to lognot.
* lib.h (logcomp): Declaration updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(comp_clamp): Bugfix: avoid shifting left into sign bit. Function
renamed to comp_trunc.
(logtrunc, ash): New functions.
* eval.c (eval_init): Registered logtrunc and ash intrinsics.
* lib.h (logtrunc, ash): Declared.
* mpi-patches/add-bitops (s_highest_bit_mp): Forward declaration for
added.
(mp_clamp_comp): Bugfix in handling remainder bits. Function
renamed to mp_trunc_comp.
(mp_trunc, mp_shift): New functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
normalized, otherwise we end up with fixnum-range bignums.
(comp_clamp): New function.
(logcomp): Changed to two argument form. If second argument
is present (not nil) then call comp_clamp.
* eval.c (eval_init): Change registration of logcomp to allow
optional argument.
* lib.h (logcomp): Declaration updated.
* mpi-patches/add-bitops: New mp_clamp_comp function implemented.
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (logcomp): New function.
* eval.c (eval_init): logcomp registered as intrinsic.
* lib.h (logcomp) declared.
* mpi-patches/add-bitops: Fixed bugs in mp_xor. Implemented mp_comp.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
negative integers behave as an "infinite bit two's complement".
* arith.c (logand, logor, logxor): New functions.
* eval.c (eval_init): New intrinsic functions logand, logior, logxor.
* lib.h (logand, logor, logxor): Declared.
* mpi-patches/series: New patch, add-bitops.
* mpi-patches/add-bitops: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
hash-uni, hash-diff, hash-isec.
* hash.c (make_similar_hash, copy_hash, hash_uni, hash_diff,
hash_isec): New functions.
* hash.h (make_similar_hash, copy_hash, hash_uni, hash_diff,
hash_isec): Declared.
* txr.1: Updated.
* txr.vim: Highlighting for these new functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c: New intrinsic functions "stat" and "prop".
* stream.c: Include <sys/stat.h> if we have it.
(w_stat, statf): New functions.
(val dev_k, ino_k, mode_k, nlink_k, uid_k,
val gid_k, rdev_k, size_k, blksize_k, blocks_k;
val atime_k, mtime_k, ctime_k): New sybol variables.
(stream_init): Intern new keywords symbols.
* stream.h (statf): Declared.
* txr.1: prop documented. Stub for stat created.
|
|
|
|
|
|
|
|
| |
* lib.c (numneqv): New function.
* lib.h (numneqv): Declared.
* txr.1: New function documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* hash.c (make_hash): Likewise.
* lib.c (assq): Renamed to assql for consistency.
(aconsq_new): Renamed to aconsql_new.
(aconsq_new_l): Renamed to aconsql_new_l.
(alist_remove_test): Use equal rather than eq. Association lists
use equal equality by default.
(alist_nremove): Use memqual rather than memq.
(alist_nremove1): Use equal rather than eq.
(merge): Bugfix: unnecessary consing caused by using append
instead of nconc on list pieces that are already destructively
chopped up. This has implications for the efficiency of sort
over lists!
(multi_sort_less): Implement key functions.
(multi_sort): Interface change: arguments rearranged, and new
argument to specify key functions.
* lib.h (assoc, assq, assql, aconsq_new, aconsq_new_l): Declarations
renamed.
(multi_sort): Declaration updated.
* txr.1: Documented alist library, list sorting and completed
documenting lazy library.
* txr.vim: multi-sort highlighted.
|
|
|
|
| |
the whole binding.
|
|
|
|
|
| |
expression syntax, resulting in (set ...) syntax being regarded as
assignment (due to another recent change).
|
|
|
|
|
|
|
| |
of throwing it away.
(expand): Recurse into expand_place for (set ...) forms.
* txr.1: Documented eval.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.h (mapcarv): Declaration added.
(eval_init): New intrinsic multi-sort registered.
* lib.c (multi_sort_less): New static function.
(multi_sort): New function.
* lib.h (multi_sort): Declared.
* txr.1: stub section added.
|
|
|
|
|
|
|
|
|
|
|
|
| |
intrinsics. open-pipe is now deprecated but stays for backward
compatibility as a synonym for open-command.
* stream.c (open_pipe): Renamed to open_command.
(open_pipevp): Renamed to open_process.
* stream.h (open_pipe, open_pipevp): Declarations updated.
* txr.1: Documentation headings updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
that popen accepts a complete command. We need something which
accepts a program name, and a list of arguments, so that
we don't have to assemble together a correctly quoted string.
popen needs an alternative interface resembling execvp.
* eval.c (eval_init): New intrinsic registered, open-pipe-args.
* stream.c (struct stdio_handle): New member, pid.
(stdio_stream_print): Print the pid, if it is nonzero.
(pipevp_close): New close function.
(pipe_close): If h->pid is nonzero, it's a new-style pipe, which
must be closed with pipev_close.
(make_stdio_stream, make_pipe_stream): Initialize new stdio_handle
member to zero.
(make_pipevp_stream): New static function.
(open_pipevp): New function.
* stream.h (open_pipevp): Declared.
* txr.1: open-pipe-args added to stub section heading.
|