| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (yield_set_entries): Add obtain* and obtain*-block
to autoload list.
* share/txr/stdlib/yield.tl (obtain*, obtain*-block):
New macros.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is really a gratuitous incompatibility with Common Lisp
and other dialects. Let's fix it internally also, but keep the
proper-listp function binding for backwards compatibility.
* eval.c (dot_to_apply, me_op): Update proper_listp
call to proper_list_p.
(eval_init): Register proper-list-p to the same C function as
proper-listp, and that C function is now called proper_list_p.
* lib.c (proper_listp): Renamed to proper_list_p.
* lib.h (proper_listp): Declaration updated.
* parser.y (define_transform): Update proper_listp call.
* txr.1: Replace all occurrences of proper-listp with
proper-list-p. Add note explaining the rename situation.
|
|
|
|
| |
* txr.1: example for delay and gen doesn't need @(do).
|
|
|
|
|
| |
* txr.1: Functions bound to variables must be
invoked using DWIM brackets or call function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (sock_set_entries): Add auto-load entry
for open-socket.
* socket.c (open_socket): Change to static.
(sock_load_init): Register open-socket intrinsic
here rather than in stream.c.
* stream.c (stream_init): Remove registration of
open-socket intrinsic.
* stream.h (open_socket): Declaration removed.
|
|
|
|
|
|
|
|
|
| |
The open_sockfd function is only called within socket.c
* socket.c (open_sockfd): More function up and
change to static.
* stream.h (open_sockfd): Declaration removed.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (sock_set_entries): Add open-socket-pair to
autoload list.
* socket.c (sock_mark_connected, socketpair_wrap): New static
functions.
(sock_load_init): Register open-socket-pair intrinsic.
* txr.1: Documented.
|
|
|
|
|
|
| |
* socket.c (sockaddr_unpack): New static function.
(sock_accept): Use sockaddr_unpack instead of two
copies of if/else code.
|
|
|
|
|
|
|
| |
* socket.c (sock_accept): Reduce scope of unwind catch around
recvfrom call. Add missing check nbytes == -1. Branch to
failed label in dup failed case, instead of throwing
exception with truncated "unable to" message.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (do_parse_mode): New static function.
(parse_mode): Logic moved into do_parse_mode, leaving this
function as a wrapper for do_parse_mode. Check added
for malformed mode, so functions which call parse_mode
now have the check. Added defaulting for mode_str
argument, inside do_parse_mode.
(normalize_mode): Call do_parse_mode instead of parse_mode.
Don't default mode_str argument, since do_parse_mode
does that.
|
|
|
|
|
|
|
|
| |
* stream.c (fmt): New function.
* stream.h (fmt): Declared.
* txr.1: Documented.
|
|
|
|
|
|
| |
* eval.c (error_trace): If an error occurs during the
expansion of a form, that form may be the result of
expansions. Dump those expansions.
|
|
|
|
|
|
|
|
|
|
|
| |
This fix is no longer that important, since due to the
previous commit, expand now tracks expansion origins
thoroughly, which hides this bug. However, expand_macro is
directly called from a few other functions, like macroexpand,
which don't benefit from that fix.
* eval.c (expand_macro): Add forgotten set_origin call
in the case when the native C expander is called.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This promotes better diagnostics. Simple test
case: [(ret @5) 1].
* eval.c (do_expand): Manual tail recursion via backwards goto
is removed; the function recurses now, and it recurses through
the expand wrapper rather than by calling itself. That is
needed in order to properly install the origin tracking for
each expansion.
(expand): Record origin for each expansion that already
doesn't have one.
|
|
|
|
| |
* txr.1: Better wording introducing the semantics.
|
|
|
|
|
| |
* txr.1: window-map doesn't require the function to return
sequences, and doesn't append.
|
|
|
|
|
|
| |
* struct.c (umethod_fun): Use proper args interfaces
to check whether there is an object argument, and
to extract it.
|
|
|
|
|
| |
* lisplib.c (ver_set_entries): Add lib-version to
autoload list.
|
|
|
|
|
|
| |
* txr.1: remove spurious blank lines before .meIP blocks.
After the indented section end, return to the correct
indentation with .IP rather than .PP.
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_symacrolet, do_expand): Don't expand the
replacement form of a global or lexical symbol macro at the
time it is bound to its symbol. This is almost certainly
wrong in situations where it makes a difference.
* txr.1: Noted in compatibility section.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* glob.c (s_exit_point): New static variable.
(errfunc_thunk): Set up a continuation guard frame, so
the error function cannot capture a continuation across
glob's stack frames. Intercept all unwinding with
a simple unwind block, save the exit point in the
global variable and then stop the unwinding by
setting the unwind frame's exit point to null.
(glob_wrap): Check for glob being re-entered and
throw error if so. If the glob callback bailed due
to unwinding (as seen by a non-null value in the
exit point global variable), clean up the glob memory
with globfree and continue the unwinding to the
exit point.
unwind.h (uw_curr_exit_point): New macro for accessing
saved exit point in pure unwind frame.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (uw_continue): Don't take the current frame as an
argument and consequently don't pop the current frame. This
function currently has only one use, the uw_catch_end macro.
* unwind.h (uw_continue): Declaration
updated.
(uw_catch_end): Slight code rearrangement: pop the frame
unconditionally before the test for whether uw_continue must
be called.
|
|
|
|
|
| |
* unwind.c (uw_unwind_to_exit_point): Misspelled
"execute".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The expander now actually produces apply forms for dot
position function call and dwim forms. This allows symbol
macros to work naturally.
* eval.c (sys_apply_s): New symbol variable.
(imp_list_to_list, dot_to_apply): New static functions.
(expand_forms, expand_forms_lisp1): We now throw an error if a
non-nil atom terminates a form, Except in compatibility mode
with TXR 137 or less, whereby we emulate the old behavior of
not expanding this atom.
(do_expand): Perform the dot_to_apply transformation
on the arguments of the dwim form.
Perform the dot_to_apply transformation on an
entire function call form.
(eval_init): Initialize sys_apply_s and register
sys:apply function (using the same function object that
is registered under apply).
* txr.1: Documented that both DWIM forms and regular
function call forms work as if by a transformation to apply form,
removing verbiage which separately described the DWIM
handling. Documented that symbol macros work properly in
dot position.
|
|
|
|
|
| |
* txr.1: A few occurrences of .codn misspelled .cond
are are fixed and one .cod fixed to .code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If some external function is invoked which can call back
into TXR Lisp, we should guard against the called-back
code from capturing a continuation across the external
stack frames, and also from unwinding across those
frames. This patch prepares a mechanism for this.
* unwind.c (uw_unwind_to_exit_point): Abort with message on
standard error if attempt is made to unwind across UW_GUARD
frame.
(uw_push_guard): New function.
(uw_capture_cont): If the frame search
encounters a UW_GUARD block, an exception is thrown.
* unwind.h (enum uw_frtype): New enum constant, UW_GUARD.
(uw_push_guard): Declared.
|
|
|
|
|
|
| |
* configure (apply_patches): Unused function removed.
This was used for applying patches when MPI was a tarball,
not expanded in the code tree.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_forms): If the forms list is an atom, then
don't just return it. Try to expand it as a macro.
If the macro produces a compound form, diagnose with
an exception, otherwise return the expansion.
* txr.1: Document the treatment of symbol macros in
function call dot position.
|
|
|
|
|
|
|
|
| |
* txr.1: New section: Improper Lists as Macro Calls.
This is necessary because the section on Dot Position
in Function Calls doesn't cover macros. Macros
are simpler, because it's just destructuring of
syntax.
|
|
|
|
| |
* txr.1: Just some whitespace for alignment of comments.
|
|
|
|
|
|
|
|
| |
* txr.1: Reduce and simplify the description text under
the Dot Position in Function Calls section, giving the
semantics via equivalence to apply. The handling of values
which are atoms or improper lists is described under
apply in a more effective way.
|
|
|
|
| |
* txr.1: Example produces (1 2 3 4), not (1 2 3).
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defstruct): Errors about
duplicate :init, :postinit or :fini were incorrectly
thrown using throw rather than throwf.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defstruct): If super isn't nil,
it must name an existing struct type, or an exception is
thrown. Previously, a nonexistent struct was silently treated
as if nil had been specified.
|
|
|
|
|
|
| |
* txr.1: Documentation for the tc macro falsely claims
that it is based on tree-bind, in the description and
example expansion.
|
|
|
|
|
| |
* txr.1: Fix strange formatting mistake, causing parenthesis
to follow a meta symbol with no whitespace.
|
|
|
|
| |
* txr.1: obtain-block introduced as the obtain-from macro.
|
|
|
|
|
|
|
|
| |
* parser.l (grammar): Drop colon from unrecognized escape
message. "bad character in directive" handles various cases to
avoid printing junk to the terminal. Basic message harmonizes
with the one in the yybadtoken function in the parser.
Non-UTF-8 byte printed as TXR hex integer literal.
|
|
|
|
|
|
| |
* stream.c (delegate_get_sock_family, delegate_get_sock_type,
delegate_get_sock_peer, delegate_set_sock_peer): These functions should
only be defined if HAVE_SOCKETS is true.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Making it work as already documented.
* socket.c (MIN): New macro.
(sockaddr_pack): Use utf8_dup_to_buf to convert
Unix socket path to a buffer of UTF-8 bytes, possibly with one
or more embedded null bytes. Copy as much of this as fits into
the sun_path member of struct sockaddr_un.
* txr.1: Improve documentation about the abstract names
on Linux.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main aim here is to pave the way for conversion between
arbitrary buffers of bytes (that may include embedded NUL
characters) and a wide string.
Also, a potential security hole is closed. When we convert a
TXR string to UTF-8 for use with some C library API, any
embedded pnul characters (U+DC00) turn into NUL
bytes which effectively cut the UTF-8 string short, and
silently so. The C library function receives a shortened
string. This could be exploitable in some situations.
* lib.c (int_str): Use utf8_dup_to_buf instead of
utf8_dup_to_uc. Pass 1 to have the buffer null-terminated,
since mp_read_radix depends on it.
* stream.c (make_string_byte_input_stream): Use
utf8_dup_to_buf. This gives us the size, soo we don't have to
call strlen. The buffer is no longer null terminated, but the
byte input stream implementation never relied on this.
* utf8.c (utf8_from_buf): Replacement fors utf8_from_uc
which doesn't assume that the buffer of bytes is
null-terminated. It can produce a wide string containing
U+DC00 characters corresponding to embedded nulls in the
original buffer.
(utf8_from): Calculate length of null-terminated string and use
utf8_from_buf.
(utf8_to_buf): Replacement for utf8_to_uc. Can produce
a buffer which is or is not null-terminated, based on new
argument.
(utf8_to): Use utf8_to_buf, and ask it to null-terminate,
thus preserving behavior.
(utf8_dup_from_uc): This function was not used anywhere
and is removed.
(utf8_dup_to_buf): Replacement for utf8_dup_to_uc which
takes an extra agrgument, whether to null-terminate
or not.
(utf8_dup_to): Apply security check here: is the resulting
string as long as utf8_to says it should be? If not,
it contains embedded nulls. Throw an exception.
* utf.h (utf8_from_uc, utf8_to_uc, utf8_dup_from_uc,
utf8_dup_to_uc): Declarations removed.
(utf8_from_buf, utf8_to_buf, utf8_dup_to_buf): Declared.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/socket.tl (sock-peer): Syntactic
place defined, allowing (set (sock-peer sock) addr).
* txr.1: Documented sock-peer as accessor and sock-set-peer.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Merely setting a peer doesn't actually connect the socket,
so it must not be marked connected. If it is wrongly
marked connected, then dgram_flush will wrongly use
send rather than sendto.
* socket.c (dgram_set_sock_peer): Don't set sock_connected
flag.
(sock_connect): Set the sock_connected flag here, for dgram
sockets.
|
|
|
|
| |
* stream.c (stream_init): Register sock-set-peer intrinsic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also rename its related functions for consistency.
* socket.c (sockaddr_in_out): Renamed to sockaddr_in_unpack.
The "in" stands for internet, and is juxtaposed to "out".
(sockaddr_in6_out): Renamed to sockaddr_in6_unpack.
(unix_sockaddr_out): Renamed to sockaddr_un_unpack.
(getaddrinfo_wrap): Calls to *_out functions renamed
to *_unpack.
(sockaddr_in): Renamed to sockaddr_pack. Original name is
confusing against the struct tag name in struct sockaddr_in.
(dgram_set_sock_peer, sock_bind, sock_connect, sock_accept):
Calls updated to sockaddr_pack.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (struct lino_state): Members
plen, pos, sel, end, dlen, dpos, dsel, dend, cols,
oldrow and maxrows change from size_t to int.
(struct lino_undo): Member dpos changes likewise.
(restore_undo, free_completions, complete_line,
next_hist_match, history_search, sync_data_to_buf,
copy_display_params, refresh_singleline, screen_rows,
col_offset_in_str, refresh_multiline, scan_match_rev,
scan_rev, scan_match_fwd, scan_fwd, find_nearest_paren,
paren_jump, update_sel, yank_sel, delete_sel, edit_insert,
edit_insert_str, edit_move_eol, edit_move_matching_paren,
edit_delete_prev_all, edit_delete_to_eol,
edit_delete_prev_word, edit_delete_line, edit): Replace
various size_t's in function arguments, return values
and local variables with int. Drop what would now be
useless casts of constants to type int.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gc.c (gc_report_copies): C style casts found in this
function.
* linenoise.c (strip_qual, convert, coerce): Copy and paste
the macros here.
(record_undo, compare_completions, lino_add_completion,
history_search, ab_append, sync_data_to_buf,
refresh_singleline, screen_rows, refresh_multiline,
find_nearest_paren, paren_jump, yank_sel,
edit_move_matching_paren, edit, lino_make, lino_copy,
lino_hist_add, lino_hist_set_max_len): C style casts
replaced.
* mpi/mpi-types.h (MP_DIGIT_BIT, MP_DIGIT_MAX, MP_WORD_BIT,
MP_WORD_MAX, RADIX): C style casts replaced.
* mpi/mpi.c (convert, coerce): Copy and paste the macros here.
(mp_init_size, mp_init_copy, mp_copy, mp_set_int, mp_div_d,
mp_bit, mp_to_double, mp_to_signed_bin, mp_to_unsigned_bin,
mp_to_unsigned_buf, mp_toradix_case, mp_grow, s_mp_set_bit,
s_mp_mod_2d, s_mp_mul_2d, s_mp_div_2d, s_mp_mul_d, s_mp_mul,
s_mp_sqr, s_mp_div, s_mp_2expt, s_mp_todigit): C style
casts replaced.
* mpi/mplogic (convert): Macro copy and pasted here.
(mpl_num_set, mpl_num_clear): C style casts replaced.
* parser.c (provide_completions): Likewise.
* signal.c (small_sigfillset): Likewise.
* stream.c (stdio_truncate, test_set_indent_mode,
set_indent_mode): Likewise.
|
|
|
|
| |
* txr.1: Concrete example is given, with a detailed walk-through.
|
|
|
|
|
| |
* txr.1: Wrong troff macro used for syntax of suspend macro,
rendering it invisible.
|