| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* share/txr/stdlib/socket.tl (sys:str-inaddr-net-impl):
Use let* so that calculation of we can see dependent w
variable.
|
|
|
|
|
|
|
|
|
|
| |
The test case is (op list . @rest) and similar, which were
expanding to a syntax containing an incorrect form like
[sys:apply list sys:var rest #:rest-0123] where the
sys:var rest are superfluous.
* eval.c (transform_op): Missing case: the code which handles
metas in the dot position must handle @rest not only @<number>.
|
|
|
|
|
|
| |
* eval.c (do_expand): If the form is (sys:var ...)
then skip it without expanding. Of course, that does
not preclude it form being a macro.
|
|
|
|
|
|
| |
* eval.c (me_op): When the operator is op, the arguments
must be expanded as Lisp-1 with expand_forms_lisp1, not
with the regular expand_forms.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (do_expand): When expanding the macro-time
form, do not macro-expand it entirely and then evaluate.
Rather, expand each argument form and evaluate.
This way earlier forms can make global definitions
which are used while macro-expanding later definitions.
* txr.1: Behavior documented.
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (test-inc): Expander
refers to unbound variable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The syntax of mac-param-bind forms isn't recognized at all in
the expander, causing these forms to be incorrectly expanded
as if they were function calls.
* eval.c (mac_param_bind_s): New symbol variable.
(do_expand): Handle mac_param_bind_s with the same block of
code as tree_bind_s, adjusted to account for the small
syntactic difference.
(eval_init): Initialize mac_param_bind_s with interned symbol.
Register operator using mac_param_bind_s to avoid redundant
intern call.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the function bodies of macrolets are themselves
being macro-expanded, this is incorrectly being done in
the original macro environment without taking into account
the macrolet parameters which those bodies have in scope.
Hence the parameters are not able to shadow symbol macros.
* eval.c (make_var_shadowing_env): Moved above expand_macrolet
so we can avoid adding a forward declaration. Otherwise
unchanged.
(expand_macrolet): For each macrolet function, create
a shadowing environment which contains its parameters,
and use that for expanding the body.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem is about those Boolean parameters which indicate
whether their associated optional parameters are present: in
(lambda (: (opt-parm 42 opt-parm-p))), such a parameter is
opt-parm-p. When parameter lists are walked by the macro
expander, these parameters are not being included as shadow
entries in macro-time parameter lists. Thus if opt-parm-p
happens to shadow an outer symbol macro, that symbol macro
will be expanded anyway.
* eval.c (get_opt_param_syms): Function now lists those
additional parameters.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The backpatching of literal hash objects containing
circular notation labels is incorrect, because it
directly mutates the hash keys, without regard for
the fact that this alters their hash values.
This change makes the test case #1=#H(() (#1# #1#))
work properly: a hash which contains itself as a key
and corresponding value. When this object is constructed by
the reader, we can do a gethash call on it, using itself as
the key, and it emerges as the value. Before this fix,
nil would be returned indicating that the key is not found,
although it is listed in the table (corrupt hash).
* parser.c (circ_backpatch): When traversing a hash, local
list of the cells. Then clear the hash, iterate the list of
old cells, and re-insert the key-value pairs.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is needed for an upcoming bugfix, so why not expose it as
an intrinsic.
* hash.c (clearhash): New function.
(hash_init): clearhash intrinsic registered.
* hash.h (clearhash): Declared.
* txr.1: Documented clearhash.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (reg_mac): Static function changed to extern.
(me_defex, register_exception_subtypes): Static function
removed here; relocated into unwind.c.
(eval_init): Registrations of defex, throw, throwf, error,
register-exception-subtypes and exception-subtype-p removed.
* eval.h (reg_mac): Declared.
* unwind.c (me_defex, register_exception_subtypes): Static
function moved here.
(uw_late_init): Registrations of defex, throw, throwf, error,
register-exception-subtypes and exception-subtype-p moved
here.
|
|
|
|
| |
* txr.1: Mention support for OOP.
|
|
|
|
|
|
| |
* txr.1: Fix text saying that symbol-function retrieves
only functions; that is true for symbols, not for the
compound syntax.
|
|
|
|
|
|
| |
* txr.1: Grammar: to occurs -> to occur. Also any subforms
of a tagbody form may be go, not just one one form as the text
seems to be saying.
|
|
|
|
| |
* txr.1: Fix bad inline expression splitting.
|
|
|
|
|
|
|
|
|
| |
* configure (lexname, lexname_given, lex_given):
New variables.
(lex): interpolate lexname (in make syntax).
Inform about lexname in help text.
(gen_config_make): Generate lexname make var.
New lex test.
|
|
|
|
|
| |
* txr.1: Fix two instances of clause parameter being
typeset as .code rather than .meta.
|
|
|
|
| |
* txr.1: Missing article: *the* sys:capture-cont function.
|
|
|
|
|
| |
* txr.1: Fix .code *package* embedded in paragraph. Remove
stray words in code comment in package example.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* Makefile (conftest.darwin): New phony target.
* configure: Always do Darwin check via make conftest.darwin.
|
|
|
|
|
|
|
|
| |
* txr.c (txr_main): Implement -b option that takes an
argument. Ensure that -b produces an error if clumped with
other options.
* txr.1: Documented -b var=val.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TXR's build should use the values of standard make variables:
use the existing $(CC), $(CFLAGS), $(YACC), $(LDFLAGS) and
such.
* Makefile (TXR_CFLAGS): New variable. Initialized with the
value of $(CFLAGS) and then customized. Used everywhere
in place of CFLAGS.
(CFLAGS): Now used only as the initial value of TXR_CFLAGS; no
longer clobbered with the := assignment. Thus if a
distribution of free software builds everything with certain
CFLAGS, we incorporate those CFLAGS that it wants us to use.
(TXR_LDFLAGS): New variable, initialized from $(LDFLAGS).
Used in place of LDFLAGS.
(LDFLAGS): Use only, do not modify.
(NM): Replaced with TXR_NM.
(YACC): Replaced with TXR_YACC.
* configure (ccname): Default to $(CC) rather than gcc.
(lex): Default name portion $(LEX) rather than flex; keep
the optional prefixes.
(gen_config_make): Generate TXR_CC, TXR_LEX, TXR_YACC and
TXR_NM variables, rather than clobbering the standard ones
CC, LEX and YACC.
Also, in the rule that finds yacc, we now try '$(YACC)'
first.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/trace.tl (sys:trace): If symbol-function
returns nil, throw exception.
* txr.1: Document the behavior, along with return values
of trace and untrace, and the tolerance of untrace to
bad arguments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch we allow (symbol-function '(macro sym)),
(defun (macro sym) (form env) ...), and
(trace (macro sym)).
* eval.c (macro_s): New symbol variable.
(lookup_fun, func_get_name, op_defun): Support (macro sym)
syntax.
(builtin_reject_test): Pass through (macro sym) syntax.
(eval_init); Initialize macro_s.
* share/txr/stdlib/place.tl (sys:get-fun-getter-setter):
Support macro place.
* txr.1: Documented verything.
|
|
|
|
|
| |
* share/txr/stdlib/trace.tl (sys:*trace-hash*): Hash must be
equal-based to correctly support compound places.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All macros are function bindings now.
* eval.c (me_interp_macro): New function. Body is
a copy of block from expand_macro.
(op_defmacro): Hoist the me_interp_macro function into
the object domain, installing the macro material as the
environment. This function is the expander.
(expand_macro): Assume that the binding is a function
and call it. The cons case is gone.
(expand_macrolet): Similar change to the one in
op_defmacro: a macrolet is also a function.
* txr.1: Documentation under symbol-macro updated.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (mefun_t): Typedef removed.
(expand_macro): Test whether the binding is a function, rather
than C object, and call it with funcall2.
(reg_mac): Take a val argument for the expander function,
rather than a C function pointer, and just store that value
into the binding unconverted.
(eval_init): Insert a func_n2(...) call into all reg_mac calls
to hoist the C functions into the object domain.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_forms_ss): New static function:
like eval_forms but preserves shared substructure
along the spine of the list.
(expand_list_of_form_lists): Use expand_forms_ss
instead of expand_forms, taking the required hash
via a new parameter.
(expand_switch): Instantiate the required hash table
and pass down to expand_list_of_form_lists.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was exposed by causing an issue in the multi-pass
expansion strategy used in tagbody which shields macro forms
from a global macro using a local macro.
* eval.c (expand_progn): When calling constantp,
pass the macro environment, as required, rather than nil.
This was causing (go ...) forms in tagbody to be expanded
in the global environment using the global go macro
which unconditionally throws an error about an undefined
label, rather than using the harmless local go macrolet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a "disciplined goto" feature of Common Lisp.
This uses a new sys:switch operator, which could
also be used for optimizing case and cond forms.
* eval.c (switch_s): New symbol variable.
(op_switch, expand_list_of_form_lists, expand_switch):
New static functions.
(do_expand): Hook in the expansion of the sys:switch
operator.
(eval_init): Initialize switch_s special variable to
sys:switch symbol. Register sys:switch special op.
* lisplib.c (tagbody_set_entries, tagbody_instantiate): New
static functions.
(lisplib_init): Register autoloading of tagbody module
via new functions.
* share/txr/stdlib/tagbody.tl: New file.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (find_symbol): New function.
(symbol_present): Search the fallback list also to
determine whether the symbol is visible.
* lib.h (find_symbol): Declared.
* parser.y (sym_helper): Implement a new behavior for
qualified symbols. Interning new symbols is only allowed
for packages that have an empty fallback list.
* parser.c (get_visible_syms): New static function.
(find_matching_syms): Use get_visible_syms to get
the list of eligible symbols. This way the fallback list
of the package is included if it is the current package.
* share/txr/stdlib/package.tl (defpackage): Do not insert
a default (:use usr) if there is no :usr clause. Since
defpackage is very new, no need for backward compatibility;
the amount of code depending on this is likely zero.
* txr.1: Documented fallback list feature.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register package-fallback-list and
set-package-fallback-list intrinsics.
* lib.c (package_fallback_list, set_package_fallback_list,
intern_fallback): New functions
* lib.h (package_fallback_list, set_package_fallback_list,
intern_fallback): Declared.
* parser.y (sym_helper): Slightly restructure function
so that the symbol interning is done separately in
the various cases. In the unqualified symbol case,
use intern_fallback to search the fallback list
of the current package.
* share/txr/stdlib/package.tl (defpackage): Implement
:fallback clause.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tuning some parameters by experimenting with
timings.
* gc.c (CHECKOBJ_VEC_SIZE): Reduce to 2*HEAP_SIZE;
this doesn't have to be equal in size to FRESHOBJ_VEC_SIZE;
entries into the checkobj array are not expected to
be as frequent as in the freshobj array.
(MUTOBJ_VEC_SIZE): On the other hand, at HEAP_SIZE/4,
this may be too small. Increasing to 2*HEAP_SIZE.
Overall, the storage for these arrays is reduced by
over 25%, with seemingly better performance.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
| |
* txr.1: clarification; article-noun plurality agreement.
|
|
|
|
|
|
| |
* mpi/mpi.c (mp_set_uintptr, mp_set_double_intptr): The value of z might
not require all of the digits implied by the size of its C data type.
We must clamp the result to trim trailing zero limbs from the bignum.
|
|
|
|
|
|
|
|
|
| |
* Makefile (TXR_DBG_OPTS): Suppress for new directory
tests/016.
* tests/016/arith.tl: New file.
* tests/016/arith.expected: New file.
|
|
|
|
|
|
|
|
| |
* args.h (args_atz): Do not zap the car field
of the first list cons; rather, zap the list itself.
The list shouldn't be modified because in apply
calls, it is a data structure belonging to the
caller.
|
|
|
|
|
|
|
|
|
| |
* mpi/mpi-config.h: Eliminate several trailing spaces.
* mpi/mpi.c: Eliminate all trailing spaces. Removed some
commented-out code, and adjusted brace placement
and indentation in one place. Also removed some spurious
blank lines.
|
|
|
|
|
|
|
|
|
| |
* mpi/mpi.c (s_mp_add): It looks like this function had the
same kind of bug I fixed years ago in the multiplication routines.
("fix-mult-bug" patch, originally). In the main loop, two digit-sized
values are added together to produce a partial sum with carry.
Unfortunately, both operands digit-sized, so the result is truncated to
the digit type. The cast of one of the operands to mp_word is missing.
|
|
|
|
|
|
| |
* txr.c (txr_main): The file loaded by the -i command line
argument could manipulate *package*. Let's reset *package*
to the user package before running the REPL.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (struct struct_inst): New bitfield member, dirty.
(struct_init): Register test-dirty, test-clear-dirty and
clear-dirty intrinsics.
(make_struct): Initialize dirty flag to 1.
(slotset): If the object is clean, then determine whether
the slot being set is an instance slot. If so, then
set the dirty flag.
(test_dirty, test_clear_dirty, clear_dirty): New functions.
* struct.h (test_dirty, test_clear_dirty, clear_dirty):
Declared.
* txr.1: Documented dirty flags concept and new functions.
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (package_set_entries): Add in-package
symbol name to autload list.
* share/txr/stdlib/package.tl (in-package): New macro.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test case: (symacrolet ((f g)) (set [f x] y)) fails to expand.
The root cause is that f is not expanded, because a nil
environment is passed down to with-update-expander macro.
This problem affects not only the dwim place, but nthcdr,
sub and others.
This bug was surprising at first because the Awk macro
establishes the field array f via symbol macro. But
assignments like (set [f 0] ...) worked!
The thing is, they only worked by fluke due to the
way expansions are handled in the Awk macro. That fluke
came to an end in the November 4 commit
157fd76ee20125f409929b95b768b931268b43cf, just before 156
was released. The changes there don't cause this problem,
but they remove the circumstances which protect the awk
macro from the problem. So yes, that commit effectively
caused another regression in 156: assignment to awk fields
not working.
* share/txr/stdlib/place.tl (nthcdr, nthlast, ref, sub,
dwim): Do not pass an environment value of nil to
with-update-expander! Pass the value of the special variable
sys:*pl-env* which is there exactly for this purpose:
to give to place expanders like these the original macro
environment where the form occurs, so they can expand
embedded places.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (getput_set_entries, getput_instantiate):
New static functions.
(dlt_register): Register auto-loading for getput module
via new functions.
* share/txr/stdlib/getput.tl: New file.
* txr.1: Documented new functions file-get, file-put,
file-append, file-get-string, file-put-string,
file-append-string, file-get-lines, file-put-lines,
file-append-lines, command-get, command-put,
command-get-string, command-put-string, command-get-lines,
and command-put-lines.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (caseq_star_s, caseql_star_s, casequal_star_s):
New symbol variables.
(me_case): Implement new macro semantics.
(eval_init): Initialize new symbol variables, and
register the symbols to the me_case macro expander.
* tests/sock-common.tl (local-addr): This function
depends on the old broken caseql semantics which
evaluate keys. Using caseql* makes it work again.
* txr.1: Document case{q,ql,qual}* macros.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/package.tl (defpackage): Implemented
new :use-from clause.
* txr.1: Documented :use-from and made some improvements
to the defpackage documentation.
|