| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
We have ifa and conda; whena is conspicuously absent.
* lisplib.c (ifa_set_entries): Add autoload entry for whena.
* share/txr/stdlib/ifa.tl (whena): New macro.
* txr.1: Documented whena.
|
|
|
|
|
|
|
| |
* sysif.c (poll_wrap): Fix function not accepting streams
of type stdio-stream or any other derived stream type.
We must check that the object is subtyped from stream,
not that it's exactly of type stream.
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (rem_impl): New static function.
(remove_if): Rewritten similarly to rem_impl.
(remq, remql, remqual, keepq, keepql, keepqual): Reduced to
wrappers around rem_impl.
(keep_if): Wrapper around remove_if with test negated.
* lib.c (remq, remql, remqual, remove_if, keepq, keepql,
keepqual, keep_if): Argument names adjusted.
|
|
|
|
| |
* lib.c (keepql): Remove repeated list_collect_nconc call.
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register rlcp-tree intrinsic.
* txr.1: Documented rlcp-tree. Also documented that rlcp
doesn't overwrite location info.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sys:bits converts a Lisp value to an integer whose value is
the object's bit pattern interpreted as a pure binary number.
(Only the "unboxed" part of the object that is stored in
variables or passed into functions, not any "boxded" heap part
which is referenced.)
this holds:
(eq a b) <--> (= (sys:bits a) (sys:bits b))
Two values a and b are the same object iff their sys:bits
values are the same integer.
* arith.c (bits): New static function.
(arith_init): Register bits as sys:bits.
|
|
|
|
|
| |
* txr.1: "sane name" -> "same name". We need aspell to
grok semantics.
|
|
|
|
|
|
|
|
| |
* lib.c (rehome_sym): Remove a symbol of the same name
as sym from the target package's hidden symbol list.
The documentation says that this is done. Basically,
rehome_sym permanently brings in a symbol, so that a
same-named symbol is kicked out.
|
|
|
|
|
|
|
|
| |
* lib.c (symbol_visible): Fix wrong accesses to hash
table cell: the symbol is in the cdr, not car.
This bug means that any symbol which is not in the
package is declared not visible and thus requires a
package prefix.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (call-update-expander,
call-clobber-expander, call-delete-expander): On entry into
these functions, propagaet the ancestry info to the original
unexpanded body, not only into the final expanded body. This
way, if errors go off during the expansion of the original,
the diagnostic will have access to the info.
Test case: (flet ((f ())) (set (fun f) 4)). With this patch
we trace to (fun 4) and its location.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sys:cp-origin blindly propagates macro origin into a
tree structure, and has to perform a complicated circularity
check to avoid introducing cycles
We replace it with a new function which looks only for
invocations of the local setter, getter or deleter macros
within the tree structure and sets the macro origin only
into those forms.
* share/txr/stdlib/place.tl (sys:cp-origin): Function removed.
(sys:propagate-ancestor): New function.
(call-update-expander, call-clobber-expander,
call-delete-expander): Use new function.
|
|
|
|
|
| |
* eval.c (error_trace): Wrong variable was checked as basis
for selecting one of two variants of diagnostic.
|
|
|
|
|
|
|
|
| |
* eval.c (eval-exception): Call uw_dump_deferred_warnings
before throwing exception. The warnings could provide valuable
clues about the cause of the error.
* share/txr/stdlib/error.tl (compile-error): Likewise.
|
|
|
|
|
|
|
| |
* eval.c (expand_setqf): New static function.
(do_expand): Handle sys:setqf via new function, which
avoids expanding the symbol, checks that it isn't
a lexical function, and warns about an unbound function.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_lisp1_setq): New static function.
(op_setqf): Check that the function binding which was
found is the global one. If not, throw an error that lexical
functions can't be mutated.
(do_expand): Handle sys:lisp1-setq operator expansion
seprately from the other setq operators, via the new function,
which enforces an expansion-time check against mutation
of lexical functions.
|
|
|
|
|
| |
* eval.c (do_expand): Throw an error if the destination
is a symbol macro which requires expanding.
|
|
|
|
|
| |
* eval.c (expand_lisp1_value): If the first argument is an
object other than a bindable symbol, throw an error.
|
|
|
|
|
|
|
| |
* eval.c (op_lisp1_setq, op_lisp1_value): If a Lisp-1 binding
is not found, this is because it is neither a function nor
variable, not because it is not a variable. The error message
now reflects this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of using a special variable hack to pass down the
request to treat a form as Lisp-1 if it happens to be a
symbol, we now wrap the form in ^(sys:l1-val ,form). We
define sys:l1-val as a place. In the case when form is a
symbol with no lexical binding, requiring the special Lisp-1
treatment, sys:l1-val produces ^(sys:lisp1-value, form).
We define that as a place also, and that takes care of
everything.
* share/txr/stdlib/place.tl (sys:*lisp1*): Special variable
removed.
(sys:sym-update-expander, sys:sym-clobber-expander): Do not
test sys:*lisp1*; just produce a sys:setq form for updating a
symbolic place.
(call-update-expander, call-clobber-expander,
call-delete-expander): Drop the bugfix in the previous commit:
re-binding of sys:*lisp1* to nil
(defplace sys:l1-val, defplace sys:lisp1-value): New places.
(defplace dwim): Do not bind sys:*lisp1*. Wrap obj-place
in a sys:l1-val form, thereby annotating it so that it
receives the right sort of place expander.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This underscores why sys:*lisp1* is so hacky and should be
removed. When we obtain the update, clobber or delete expander
of a place which is the argument of a DWIM, requiring Lisp-1
treatment, we bind the sys:*lisp1* special. This alters the
behavior of obtaining an expander for a symbolic place.
Unfortunately, because call-update-expander (and friends)
use sys:expand, all levels of the form are subject to place
expansion with sys:*lisp1* bound to t.
Example:
(set [(car (inc a 2)) 10] "foo")
Here, the (car ...) form is the place operand of the DWIM
operator, and so sys:*lisp1* is set up around getting its
expander. But then, oops, the a in (inc a 2) is also treated
as Lisp-1, wrongly.
These changes band-aid the situation.
* share/txr/stdlib/place.tl (call-udpate-expander,
call-clobber-expander, call-delete-expander): After retrieving
the expander, bind sys:*lisp1* to nil so that its effect does
not spill over into the sys:expand call which we apply to the
expansion; i.e. reset sys:*lisp1* to nil around recursive
expansion so that the Lisp-1 treatment is confined to depth 1.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* parser.l (grammar): Add rules which capture two symbols
glued together, and diagnose as bad token. Of course a
legitimate symbol token can be divided into two that are glued
together. This rule is placed after the legitimate symbol
matching rule, so that if a token can be interpreted as a
single symbol token or as two, the first interpretation is
taken.
|
|
|
|
|
|
|
|
|
| |
* parser.l (grammar): Add a rule that if a floating-point
(of the type that ends in decimal digits with an optional
exponent) is immediately followed by a period which is
not followed by another period (range syntax), it is
trailing junk. For instance 1.0.3 or .2.$, or
1.0. followed by no other input.
|
|
|
|
|
|
| |
* txr.c (txr_main): Bind sys:*load-recursive* to t before
reading and evaluating forms, then bind to nil before entering
repl.
|
|
|
|
|
| |
* lib.c (merge): Eliminate extra call to cdr by
keeping the result of cdr_l, and working with the location.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (merge): Fix unstable logic here. What we want is
that when the item from list1 is *not less* than the item
from list2, we take them in that order. Since all we have
is a less function, we must test (less item2 item1).
If this is false, then preserve the order, because when
the keys are identical, the less function yields false.
(sort_list): A similar change takes place here when we sort
a list of length two (which is essentially an inlined
case of merge).
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state loop): Allow an input
source to be a list of strings, which is converted to a
stream.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suppose that a program-defined package is current, has usr as
its :fallback, and has a :local symbol list. Then if 'usr:list
is printed, it must print with the usr: package symbol because
it is not visible. It is printing without the prefix.
* lib.c (symbol_present): Function renamed to symbol_visible,
which is much more descriptive of what its return value means.
The bug in this function is that it does not stop searching
when, in its search path, it encounters a symbol which has the
same name as sym, but which isn't sym. But such a symbol makes
sym invisible. This is now fixed.
|
|
|
|
|
|
|
|
|
| |
* hash.c (gethash_e): New function. Just returns the entry cell if
found, or else nil. This should have been written first.
(gethash, gethash_f, gethash_n): Replace body with trivial one-liner
based on gethash_e.
* hash.h (gethash_e): Declared.
|
|
|
|
|
|
|
| |
* txr.1: Example showing + symbol being replaced in
a custom package with a local symbol, and a function
being bound which overloads + to allow strings
and numbers.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/except.tl (catch): Expand the parameters
and body of each clause with sys:expand-params to get
rid of parameter macros. Then insert the leftmost gensym.
This now allows parameter macros to be used in cach clauses.
|
|
|
|
|
| |
* eval.c (eval_init): Register sys:expand-params intrinsic
bound to expand_params.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This issue was fixed in quasiliterals only. Because of the
implementation duplicity between output vars and quasiliteral
vars, we have to fix it in two places.
When the parser handles quasiliterals, it builds vars without
expanding the contents. The quasiliteral expander takes care
of recognzing (sys:var ...) forms and properly handles them
and their attributes, avoiding expanding the argument of
a :filter keyword.
When the parser handles an o_var that is a braced variable,
it calls expand on its contents right there, then builds the
(sys:var ...) form from the expanded contents.
Why don't we just call expand_quasi in the o_var rule to have
a single (sys:var ...) form expanded exactly how it is
done in quasiliterals.
* eval.c (expand_quasi): Change static function to external.
* eval.c (expand_quasi): Declared.
* parser.y (o_var): Construct an unexpanded (sys:var ...)
form, and then wrap it in a one-element list. This is a
de-facto quasi-items list, which can be expanded by
expand_quasi. Then we pull the car of the expansion to
get our expanded var.
|
|
|
|
|
|
|
| |
* unwind.c (uw_late_init): Register defer-warning and
dump-deferred-warnings intrinsics.
* txr.1: Documented.
|
|
|
|
| |
* lisplib.c (except_set_entries): Add catch* and handle*.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state): New slot, file-name.
(sys:awk-state loop): Set file-name from current input name,
or else from the stream name property if the current input
is a stream object.
(sys:awk-mac-let): New awk macro, fname.
* txr.1: Documented fname.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state loop): Instead of
using the lexical variable stin, use *stdin*, so that
the standard input stream is re-bound.
* txr.1: Documented binding and scope of *stdin*.
|
|
|
|
|
|
|
|
| |
* match.c (match_reg_var): No need to call
uw_purge_deferred_warning here any more.
* unwind.c (uw_register_tentative_def): Purge any
deferred warnings for the tag.
|
|
|
|
|
| |
* txr.1: Describe the Lisp expansion neglect in the pattern
language that is fixed for 166, reversible with -C.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/build.tl (sys:list-builder-macrolets): Function
renamed to sys:list-builder-flets. Builds local functions
instead of macrolets.
(build): Follow rename of sys:list-builder-macrolets.
* txr.1: Documentation updated and example added of
use of add as a higher order function.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/except.tl (sys:expand-handle): New
function.
(handle): Use sys:expand-handle to expand arguments. The
previously unused :whole form argument is now put to use,
and correctly captured using :form rather than :whole.
(handle*): New macro.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (op_catch): The sys:catch operator now passes the
exception symbol as the first argument of each clause.
This means the catch macro must be adjusted.
* share/txr/stdlib/except.tl (catch): Macro now inserts
a gensym dummy first argument into each clause to take the
symbol passed by the sys:catch operator.
(catch*): New macro, which is identical to the previous
catch macro, and thus exposes the symbol passed as the
first argument.
* txr.1: Documented catch*.
* tests/012/struct.tl: Some gensym numbers need adjusting
in one test case.
|
|
|
|
|
|
|
| |
* eval.c (do_expand): Expander for mac-param-bind is
redundantly expanding the main expression and taking that as
the epanded context form, rather than expanding the context
form.
|
|
|
|
| |
* args.h (args_init): Inline function removed.
|
|
|
|
|
|
|
| |
* lib.c (take_while_list_fun, take_until_list_fun):
We must terminate the output list when the output list
is empty, and not try to apply the predicate to
car(list) in that case.
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register plist-to-alist and
improper-plist-to-alist intrinsics.
* txr.1: Documented improper plist concept and new
functions.
|
|
|
|
|
|
|
| |
* lib.c (proper_plist_to_alist): Renamed to plist_to_alist.
* lib.h (proper_plist_to_alist): Declaration replaced.
(plist_to_alist): Declared.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/keyparams.tl (sys:extract-keys,
sys:extract-keys-p): Use the brand new memp function rather
than memq. memq is not correct for plist lookup because of
ambiguities like (:foo :bar :bar 3) where memq retrieves (:bar
:bar 3) for :bar rather than (:bar 3).
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register memp intrinsic.
* lib.c (memp): New function.
* lib.h (memp): Declared.
* txr.1: Documented.
|