| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
db1fc32ebe29de61b0432a72385516a186f62a87, 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.
|
|
|
|
|
|
|
|
| |
* eval.c (me_case): If forms is nil, substitute
the object (nil) for forms, to ensure a nil result
through the expansion to a cond.
* txr.1: Documented and added compat notes.
|
|
|
|
|
|
|
|
|
| |
* eval.c (me_case): The key must be quoted unconditionally
whether it's an atom or list. Let's make this subject
to the compatibility flag in case someone's code depends
on it.
* txr.1: Compat notes added.
|
|
|
|
|
|
|
|
|
| |
* genvim.txr (txr_circ): New match. Link to
Special highlight group.
(txr_bracevar, txr_directive, txr_list, txr_mlist,
txr_mbracket): Introduce txr_circ into these regions.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (package_set_entries, package_instantiate): New
static functions.
(lisplib_init): Register auto-loading for new package.tl
file using new functions.
* share/txr/stdlib/package.tl: New file.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* eval.c (op_setq, op_lisp1_setq): Take the bindable(var) test
out of the frequently executed path. We can safely do the variable
lookup with any object. If the lookup fails, then we can
complain that the object isn't a bindable symbol, if that is
the case.
|
|
|
|
|
|
| |
* lib.c (obj_print_impl): Print package name using ~a
rather than ~s. Otherwise if the string object occurs
elsewhere in the structure being printed, we have a problem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Interpreted functions print as #<interpreted fun: name args>,
thus repeating some list structure in their notation.
This means we must traverse them when populating the
object hash during printing, and also when backpatching
after parsing.
Test case: evaluate and print
(let ((s '(lambda (a b c) d))) (list s (eval s)))
with *print-circle* enabled.
* lib.c (populate_obj_hash): Handle FUN objects of
functype FINTERP.
* parser.c (circ_backpatch): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (force): When replacing the promise by a
forced value, we must use the set macro. Only the deref
assignments which store symbols are safe, not the one storing
ret.
* lib.c (alist_nremove, alist_nremove1): We must
use the set macro here instead of assigning through deref.
Even though these assignments preserve the direction of the
list (they just splice out nodes), it's possible that the list
already contains a "wrong-way" reference (old generation to
new) and that the node making this reference is appropriately
marked to be processed properly in the next GC cycle. If we
remove *that* node, we then cause its predecessor to point to
the new generation node and that predecessor could be old
generation.
|
|
|
|
|
|
| |
* lib.c (get_current_package): If *package* contains
nonsense, then reset it to a sane value and throw
an exception.
|