| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The zchar type, when used as an array element, specifies an
optionally null-terminated or padded field, which is subject
to UTF-8 conversion.
* ffi.c (zchar_s): New symbol variable.
(enum char_conv): New member, conv_zchar.
(ffi_zchar_array_get): New static function.
(ffi_array_in, ffi_array_get_common): Handle conv_zchar via
ffi_zchar_array_get.
(ffi_array_put): Handle conv_char together with conv_zchar.
(ffi_type_compile): Handle zchar array element type, mapping
to conv_zchar.
(ffi_init_types): Register zhar type.
(ffi_init): Initialize zchar_s symbol variable.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The three flags controlling character array conversion
semantics are mutually exclusive. Let's turn them into an
enumeration, so we can (1) test that a conversion is in effect
by testing a single value and (2) switch on the conversion
type instead of successively testing the flags and (3) assure
the aforementioned mutual exclusion.
* ffi.c (enum char_conv): New enum.
(struct txr_ffi_type): Members char_conv, wchar_conv and
bchar_conv gone, replaced by ch_conv.
(ffi_array_in, ffi_array_put, ffi_array_out,
ffi_array_get_common, ffi_array_release_common,
ffi_varray_null_term_get, ffi_type_compile,
carray_ensure_artype): Work with ch_conv instead of three
flags.
|
|
|
|
|
|
| |
* parser.c (is_balanced_line): don't initialize an "enum
state" variable with 0, but with the equivalent enum
constant.
|
|
|
|
|
| |
* txr.1: fix "invoked invoked" in compatibility note for
compat value 151.
|
|
|
|
|
| |
* txr.1: documnt that the default value of the optional
alloc-size parameter is taken from the len parameter.
|
|
|
|
|
|
|
| |
* tests/012/oop-mi.tl: Add some coverage for static-slot-home
function.
* tests/012/oop-mi.expected: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (do_super): New function. Now the common
implementation for call_super_method, call_super_fun and
super_method.
(call_super_method, call_super_fun): Reduced to small wrappers
around do_super.
(super_method): Drill into the object to geet the struct_type
handle, and then use do_super to get the method.
* tests/012/oop-mi.tl: New tests for call-super-fun and
call-super-method.
* tests/012/oop-mi.expected: Updated.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/getopts.tl (sys:option-base): New struct
type, holding the boiler-plate methods and slots that were
generated into the user-defined struct by
define-option-struct.
(define-option-struct): Inject the required properties by
inheritance from sys:option-base, greatly reducing code bloat
in the macro. The slot hash and opt-desc-list static slots
have to be redefined in the derived structure so that type has
its own instance of them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Multiple inheritance is too useful to ignore any longer.
* lib.c (subtypep): Perform subtypep calculation between two
struct types via the new struct_subtype_p function.
It's too complicated now to do with ad hoc code outside of
struct.c.
* share/txr/stdlib/struct.tl (defstruct): This macro now needs
to deal with the super argument being possibly a list of base
types instead of a single one.
* strut.c (struct struct_type): Member super and super_handle
are removed. New member nsupers, supers, and sus.
(struct_init): The super function re-registered; it has an
optional argument.
(call_stinitfun_chain): The compat code here must now access
the supertype differently. We don't bother dealing with
multiple inheritance in the compat case; programs requesting
compatibility with TXR 151 shoudn't be trying to use multiple
inheritance.
(get_struct_handles, count_super_stslots, get_super_slots,
find_super_for_slot): New static functions, to off-load some
new complexity from make_struct_type.
(make_struct_type): Handle the increased complexity due to
multiple inheritance.
(super): Takes an additional argument now, to request which
supertype to retrieve. Defaults to zero: the first one.
(struct_type_destroy): Free the sus array.
(struct_type_mark): Mark the supers slot.
(call_initfun_chain): Call init functions of all bases, in
right-to-left order.
(call_postinitfun_chain): Likewise for postinit functions.
(call_super_method, call_super_fun, super_method): Use the
first base as the supertype. This requirement feels bad; it
needs to be revisited.
(do_struct_subtype_p): New static function.
(struct_subtype_p): New function.
(ancestor_with_static_slot): New static function.
(method_name): Revised for multiple inheritance; now relies on
ancestor_with_static_slot to find the original ancestor that
has brought in a method, so we can use that type in the
method name.
* struct.h (super): Declaration updated.
(struct_subtype_p): Declared.
* tests/012/oop-mi.expected: New file.
* tests/012/oop-mi.tl: New test cases.
* txr.1: Revised in order to document multiple inheritance.
|
|
|
|
|
|
|
|
|
| |
* txr.1: In relation of the previous bugfix, a certain
situation is worth clarifying. A static slot does not inherit
the value of a grandparent type's static slot of the same
name, if the supertype has specified that slot as an instance
slot. Inheritance of the static slot value is from the direct
supertype only.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (make_struct_type): When a struct defines a static
slot that exists as an instancee slot in the supertype, there
is a crash. This is because the code assumes that the
supertype's slot is static. The index value m ends up negative
due to subtracting STATIC_SLOT_BASE from an instance slot
index, and so the code tries to copy the value of a negatively
indexed static slot from the supertype into the new static
slot. We can fix this by not doing the copy when a negative
index has been calculated. That way we treat the situation as
if the supertype didn't have that slot at all.
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (path_test_set_entries): Autoload entry for
path-dir-empty.
* share/txr/stdlib/path-test.tl (path-dir-empty): New
function.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (sinh_s, cosh_s, tanh_s, asinh_s, acosh_s, atanh_s):
New symbol variables.
(sinh, cosh, tanh, asinh, acosh, atanh): New static functions.
(sineh, cosih, tangh, asineh, acosih, atangh): New functions.
(arith_init): Register sinh, cosh, tanh, asinh, acosh and
atanh intrinsic functions, and initialize the new symbol
variables.
* configure: Detect availability of hyperbolic functions in
math library and defne HAVE_HYPERBOLICS as 1 in config.h
accordingly.
* lib.h (sineh, cosih, tangh, asineh, acosih, atangh):
Declared.
* txr.1: Documented new hyperbolic functions and their method
counterparts that a numeric struct can implement.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ffi.c (ffi_memb_compile): Don't complain about
three-argument slot specifiers, only about longer ones.
(ffi_struct_init): New static function.
(ffi_type_compile): Deal with third element in the slot
syntax. If there are any non-nil initializing expressions,
then we when we call make_struct_type, we specify an initfun,
which will plant the values into the slots, using logic
similar to that of the initfun generated defstruct,
except that the init-forms are reduced to values up-front.
* txr.1: Specify optional init-form for slots in FFI
struct syntax.
|
|
|
|
|
|
|
|
| |
Convenience function for throwing warnings.
* unwind.c (uw_warningf): New function.
* unwind.h (uw_warningf): Declared.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/asm.tl (operand-to-sym): Use decimal
with no leading zeros for t and d registers. Only the v
registers use hex, because that helps unravel their level
structure. The data table is dumped with decimal numbering, so
the d registers being decimal makes it easier to cross-ref.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Contrary to the belief expressed in the commit message of
June 2018's 46480c25e62f60c761088c561d90b0f2f5a3143f,
source location info is being recorded during the loading
of compiled files. The reason is that the function used for
processing the forms, lisp_parse_impl, overrides it.
* parser.c (read_file_common): Use lisp_parse_impl directly,
rather than lisp_parse. Specify that function's rlcp_p
argument as false when processing compiled code.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/getopts.tl (opthelp): Use a different line
breaking approach for literals: the escaped space is now at
the end of the previous line, rather than at the start of the
next line, which looks nicer. We don't do this for the option
type legend, because that has some instances of leading space
alignment, which requires a leading backslash.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This provides more streamlined option processing.
* lisplib.c (getopts_set_entries): Add auto-load entry for
define-option-struct.
* share/txr/stdlib/getopts.tl (define-option-struct): New
macro.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* txr.1: Document that in the parsed opts object returned by
getopts, an option which has two names (long and short form)
is indexed under both names if it has occurred in the command
line, regardless of whether it has occurred under the short or
long name.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The reason for this rename is that add is a public symbol in
the usr package, thanks to the build macro. This will
interfere with an upcoming feature under which options appear
directly as struct slots, defined by symbols. If a user
defines an --add option using the symbol add, it will clash
with the add method. But add-opt will be sys:add-opt.
* share/txr/stdlib/getopts.tl (opts add): Rename to add-opt.
(sys:opt-processor parse-long, sys:opt-processor
parse-shorts): Follow rename.
|
|
|
|
|
|
|
|
|
| |
* lib.c (intern_fallback_intrinsic): The missing_ok parameter
of get_package must be given a true argument, because
package_in is optional. When it is missing, it is represented
by the colon symbol, and if missing_ok is false, then
get_package treats this colon symbol as the package name ""
(the name of that symbol).
|
|
|
|
|
| |
* lib.c (intern_fallback, intern_fallback_intrinsic): Use
intern-fb name, not intern-fallback.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The methods of sys:opt-processor pass down an argument called
out which is an opts instance that is created in parse-opts.
In this patch, we move that argument into a new slot of the
sys:opt-processor object, named opts. We instantiate the opts
structure in the getopts function instead. The motivation here
is that (meth sys:opt-processor parse-opts) doesn't know which
type of opts object it is working with; its user is now
responsible for instantiating the object and installing it as
the opts slot.
* share/txr/stdlib/getopts.tl (sys:opt-processor): New
slot, opts.
(sys:opt-processor (parse-long, parse-shorts): Drop out
argument; refer to me.opts instead of it.
(sys:opt-processor parse-opts): Don't instantiate opts object
here, and don't pass it to parse-long and parse-shorts which
no longer take that argument. Rather, rely on it already being
installed into the opts slot.
(getopts): Instantiate opts here, and specify it as the opts
slot of the sys:opt-processor object also being instantiated
here.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/getopts.tl (opts): opt-processor slot
removed.
(sys:opt-processor parse-opts): When instantiating opts, do
not initialize the opt-processor slot with a backpointer to
self object. It is not referenced anywhere.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/getopts.tl (opthelp): Use symbol-name to
get the string representation of type keywords instead of
tostringp, so there is no leading colon. In the type legend,
we don't have any colon. For instance --gravity=FLOAT rather
than --gravity=:FLOAT.
|
|
|
|
|
|
| |
share/txr/stdlib/getopts.tl (sys:opt-processor build-hash):
Don't construct (list od.long od.short) twice and iterate
through it twice; make just one and process it in one pass.
|
|
|
|
|
| |
* txr.1: Under deffi-cb, correcting a reference to
nonexistent ff-make-callback to ffi-make-closure.
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (is_balanced_line): When handling the closing
characters, we must look for the state type which matches the
character type, not state[sp]. Of course state[sp] == match,
since we initialized it that way, and so state[sp] != match
is always false. We want match to be derived from the
character ch, not from state[sp]. Also, the polarity in the
match-not-found return case is wrong; we must return 0.
|
|
|
|
|
| |
* lib.c (car, cdr, rplaca, rplacd, make_like): Handle
BUF type.
|
|
|
|
|
|
|
|
|
| |
* buf.c (buf_list): New function.
(buf_init): buf-list intrinsic registered.
* buf.h (buf_list): Declared.
* txr.1: Documented.
|
|
|
|
|
|
| |
* parser.y (hash_semi_or_n_expr, hash_semi_or_i_expr): We need
to handle OREFDOT here so that .?sym can parse as a
top-level expression. Issue reported by vapnik spaknik.
|
|
|
|
|
|
| |
* parser.y (yybadtoken): Add missing cases for UREFDOT,
OREFDOT and UOREFDOT, so these don't fall through to
being reported as a junk character.
|
|
|
|
|
| |
* parser.y (yybadtoken): Merge CONSDOT and LAMBDOT cases since
they have identical code.
|
|
|
|
|
|
|
| |
* txr.1: Update outdated documentation. macro-date is not
required any more in the indicated situations. But it can
still be required sometimes, and has some interesting uses.
More detail added.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
| |
* lib.c (identity_star): The args_more function requires
an index which is a cnum, not int.
|
|
|
|
|
| |
* hash.c (hash_reset): Clear the whole structure, not
just a pointer-sized region at its base.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ffi.c (carray_unum, carray_num, unum_carray, num_carray):
Functions renamed to carray_uint, carray_int, uint_carray,
int_carray.
(ffi_init): Functions registered under new names:
carray-uint, carray-int, uint-carray, int-carray. Compat
values of 227 or less provide the old old names.
* ffi.h (carray_unum, carray_num, unum_carray, num_carray):
Declarations renamed.
* txr.1: Updated to new names; compat note added.
|
|
|
|
|
|
| |
* share/txr/stdlib/op.tl (sys:op-expand): The compatibility
version check should be against 225, not against the not
yet existent 255.
|
|
|
|
|
| |
* ffi.c (carray_num): Use the correct name carray-num rather
than carray-unum in diagnostics.
|
|
|
|
|
| |
* txr.1: The word "times" appeared in place of "types".
Reported by vapnik spaknik.
|
|
|
|
|
|
|
| |
* txr.1: User vapnik spaknik pointed out the poor
documentation for apf, which stated that it takes one argument
which is a list, when in fact it more generally takes
and works with apply-like arguments.
|
|
|
|
|
|
| |
* txr.1: Fix copy and paste errors affecting flo-zero,
struct sockaddr-in6, sockaddr-unix and sock-bind.
Reported by user vapnik spaknik.
|
|
|
|
|
| |
* txr.1: Fix incorrect return value. Reported by user
vapnik spaknik.
|
|
|
|
|
|
| |
* txr.1: Fix wording that refers to first argument as the
second argument. It is the second form element, of course,
but the first argument. Reported by user vapnik spaknik.
|
|
|
|
|
| |
* txr.1: Use .mets instead of .meti on the syntax; this
produces an indentation.
|
|
|
|
|
|
|
|
|
| |
* buf.c (buf_int, buf_uint, int_buf, uint_buf): New static
functions.
(buf_init): buf-int, buf-uint, int-buf and uint-buf intrinsic
functions registered.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The eval function uses a null macro environment for expanding
a form, even when it's given an environment object. This
causes spurious warnings about unbound variables/functions.
For instance:
(let ((env (make-env '((x . 42)) nil nil)))
(eval '(+ x x) env)) ;; warning: unbound variable x
To fix this, we have to create a macro version of the
incoming environment and expand with that.
* eval.c (env_to_menv): Take an evaluation environment chain
and convert it to a (flattened) macro environment.
(expand_eval): Take a macro environment parameter and use
that for expanding the form to be evaluated, rather than nil.
(eval_intrinsic): Calculate a macro environment corresponding
to the given evaluation environment. Use that for the
macroexpand call, and also pass it down to expand_eval
to be used for the full expansion.
|