| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
atom that comes out of recursive call, wrapped in (quote ...),
resulting in '(,a . b) expanding to (append 'a . quote b)
rather than (append (list 'a) (quote b)); i.e. (append (list 'a) 'b).
|
|
|
|
|
| |
environment at all, and still had vestiges of support for the the old
cptr based global variables.
|
|
|
|
|
| |
to suppress TXR_DBG_OPTS for tests under tests/011.
The --gen-gc makes mandel.txr run too slow.
|
|
|
|
|
| |
(expand): Use maybe-quote form macro-time, to not quote
result unnecessarily.
|
|
|
|
| |
* tests/011/mandel.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Save *gensym-counter* symbol in gensym_counter_s
symbol variable right after interning, and use zero as the inital value
rather than the gensym_counter variable which is removed now.
* lib.c (gensym_counter_s): New symbol variable.
(gensym_counter): Variable removed.
(gensym): Slight refactoring to avoid a double variable lookup.
Also, for generational GC correctness, use the set macro to update it,
since the variable could live inside heap object and the counter
could overflow to bignums which are heap objects.
(obj_init): Remove initialization of gensym_counter.
* lib.h (gensym_counter_s): Declared.
(gensym_counter): Declaration removed, replaced by macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
re-binding. C code now has to go through the dynamic environment lookup
to access things like *random-state*, or *stdout*. As part of this,
I'm moving some intrinsic variable and function initializations out of
eval.c and into their respective modules. Macros are are used to make
global variables look like ordinary C variables. This is very similar
to the errno trick in POSIX threads implementations.
* eval.c (looup_var, lookup_var_l): Restructured to eliminate silly
goto, the cobjp handling is gone.
(reg_fun, reg_var): Internal function becomes external.
reg_var registers a simple cons cell binding now, without any
C pointer tricks to real C global variables.
(c_var_mark): Static function removed.
(c_var_ops): Static struct removed.
(eval_init): Numerous initializations for streams, syslog, rand,
signals and others moved to their respective modules.
The new symbol variables user_package_s, keyword_package_s
and system_package_s are interned here, and the variables are
created in a special way.
* eval.h (reg_var, reg_fun): Declared.
* gc.c (prot1): Added assert that the loc pointer isn't null.
This happened, and blew up during garbage collection.
* lib.c (system_package, keyword_package, user_package): Variables
removed these become macros.
(system_package_var, keyword_package_var, user_package_var): New
global variables.
(system_package_s, keyword_package_s, user_package_s): New
symbol globals.
(get_user_package, get_system_package, get_keyword_package): New
functions.
(obj_init): Protect new variables. Initialization order of modules
tweaked: the modules sig_init, stream_init, and rand_init are moved
after eval_init because they register variables.
* lib.h (keyword_package, system_pckage, user_package): Variables
turned into macros.
(system_package_var, keyword_package_var, user_package_var): Declared.
(system_package_s, keyword_package_s, user_package_s): Declared.
(get_user_package, get_system_package, get_keyword_package): Declared.
* rand.c (struct random_state): Renamed to struct rand_state to
avoid clash with new random_state macro.
(random_state): Global variable removed.
(random_state_s): New symbol global.
(make_state, rand32, make_random_state, random_fixnum, random):
Follow rename of struct random_state.
|
|
|
|
|
|
|
|
|
|
|
|
| |
variable is defined.
(op_defsymacro): Remove the same-named variable when a symbol macro is
defined.
(op_defun): Throw excpetion if an attempt is made to define a
special operator as a function. Remove the same-named macro when a
function is defined.
(op_defmacro): Throw excpetion if an attempt is made to define a
special operator as a macro. REmove the same-named function
when a macro is defined.
|
|
|
|
|
|
|
|
| |
is generating (append (list x) . y) instead of (append (list x) y).
Also, added a nil case which is now necessary to prevent
'(,x) from generating (append (list x) nil), though this is
effectively an optimization, which is pointless, since
the expander isn't optimizing overall.
|
|
|
|
| |
* tests/010/output-clauses.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/011/macros-1.expected: New file.
* tests/011/macros-1.txr: New file.
* tests/011/macros-2.expected: New file.
* tests/011/macros-2.txr: New file.
* tests/011/special-1.expected: New file.
* tests/011/special-1.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_vars): Expand vars needs to know whether it's
handling a sequential (let*-like) or parallel (let-like) binding.
The init form of a variable sees the previous macro environment,
but that variable must, for the remaining variables, shadow any
previous symbol macro.
(expand): In expand we must inform expand_vars whether we have
a sequential or parallel binding construct. Moreover, there was
a huge bug here: the new_menv (with the shadows) was passed to
expand_vars, so that all the variables were hiding same-named
symbol macros from all their initforms.
|
|
|
|
|
|
|
|
| |
(eval_init): Initialiation of delay_s removed.
Symbol now interned in reg_mac call for registering me_delay .
* genvim.txr: Updated to recognize a reg_mac call
with intern.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
by Roman Mishin.
|
|
|
|
|
| |
as having trailing junk. The fix is to put the junk-matching rule after
the valid rules.
|
|
|
|
|
|
|
|
| |
* lib.h (copy): Declared.
* eval.c (eval_init): Registered copy function as intrinsic.
* txr.1: Added missing documentation for length. Documented copy.
|
| |
|
| |
|
|
|
|
|
|
|
| |
in eval_init. Also, scans reg_mac registrations now.
* txr.vim: Refreshed. The previously missed "delay" operator is now
listed, thanks to reg_mac.
|
|
|
|
|
| |
(expand_macrolet, expand_symacrolet): Use maybe_progn
to eliminate unnecessary progn wrapping.
|
|
|
|
|
|
|
|
| |
(me_gun): New static function.
(eval_init): New gun symbol interened, me_gun registered
as intrinsic macro.
* txr.1: Documented gun.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
formal macros that are in the top_mb table, make their symbols
fboundp and can be expanded with macroexpand.
* eval.c (mefun_t): New typedef name.
(expand_macro): If the expander is a cobj, then pull out the C function
and call it, otherwise realize the interpreted macro as before.
(me_gen, me_delay): New static functions, replace expand_gen
and expand_delay.
(expand_qquote): Renamed to me_quote.
(expand_gen, expand_delay): Renamed to me_gen and me_delay,
with an interface adjustment and moved.
(expand_op): Renamed to me_op.
(expand): Removed qquote, gen, delay, op, and do handling, since
these operators are now macros.
Removed the unnecessary expansion of with-saved-vars.
(reg_op, reg_fun): Assert that the symbol is not nil, to catch
initialization order issues. One just showed up: op_do was
interned in match.c, which is initialized later.
(reg_mac): New static function
(eval_init): Intern do_s, because match.c hasn't done it yet
at this point. Register me_gen, me_delay, me_op (twice) and me_qquote
as intrinsic macros.
* txr.1: Documented those operators as macros.
|
|
|
|
|
| |
(eval_init): Register operators with reg_op instead of direct sethash
calls.
|
|
|
|
|
|
| |
a character, then don't try to make it into a string;
keep it as a list. This allows [mapcar list "abc" "def"]
to work intuitively rather than blow up.
|
|
|
|
|
|
|
| |
(code2type): Return lit_s for LIT type.
(typeof): Return lit_s for TAG_LIT.
(replace_str): Error message wording.
(obj_init): lit_s interned.
|
|
|
|
| |
dispatching function, so it is not clobbered by argument evaluations.
|
|
|
|
|
|
|
|
|
|
|
|
| |
dwim_body, since the append2 copies list structure.
* parser.y (n_exprs): propagate source loc info from both
constituents, giving precedence to the left one, rather than just taking
it from the left one and ignoring the second constituent. This fixes
cases of missing location info. The left constituent n_expr is often
a symbol, and those do not have location info. We want a case like
like ((x) y) to take from (x), and (x (y)) to take it from (y),
and so on.
|
|
|
|
|
|
|
| |
from the @ token.
(n_expr): Bugfix: do not attribute a symbol with location info.
(quasilit): Obtain location info from quasi_items, and only
if that is unavailable, then from lineno.
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES, txr.vim: Updated.
|
|
|
|
| |
for the context string that serves in place of a filename.
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was handling silly special cases with the net effect of being
nearly equivalent to just expand, while failing to expand places
which are compound macro calls. It did diagnose nonexistent place
types at expansion time, which isn't worth much.
(expand): All the expansions for the mutating operator sset, inc, dec,
push, pop and flip were also pointless and have been removed. they did
the precise equivalent of doing expand(rest(form)), and consing the
symbol to the front, which is the fallback case for function call
forms.
|
|
|
|
|
|
|
|
|
|
|
| |
means of -Werror=implicit-function-declarations. Fix broken mkdir and
mknod tests. Regenerate config.make if we add -U__STRICT_ANSI__
to the compiler options, so that later tests benefit from this.
Regenerate config.make right away if adding -D_DARWIN_C_SOURCE.
This allows the makedev test to pass.
* stream.c: Include <sys/types.h> for makedev.
(mknod_wrap): Don't rely on makedev wrappers to be there; test.
|
|
|
|
|
|
|
|
|
|
|
|
| |
not expr. expr is subject to expand_meta.
(n_expr): Do not associate source info with character
literals.
(expand_meta): Bugfix: when walking forms in a collecting loop,
propagate the source info to them. Bugfix: attach source
info to var and expr expansions.
(rl): Rewritten in terms of rlset.
(rlset): Only set source info for an object that doesn't already
have it.
|
|
|
|
|
|
| |
to the system namespace, for hygiene.
* txr.1: Updated.
|
| |
|
|
|
|
| |
return value.
|
|
|
|
| |
strict prototypes warnings; these should be errors.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mkdir and mknod.
* eval.c (eval_init): Wrap #ifdefs around the registrations of
the wrappers for these functions.
* stream.c (mkdir_wrap): Wrap in #ifdef HAVE_MKDIR, and
provide a Windows version if HAVE_MKDIR is missing, but
HAVE_WINDOWS_H is true.
(makedev_wrap, major_wrap, minor_wrap): Wrap with #if HAVE_MAKEDEV.
(mknod): Use #if HAVE_MKNOD.
(symlink_wrap, link_wrap, readlink_wrap): Wrap with #if HAVE_SYMLINK.
|
|
|
|
| |
debugger not printing the current line of data.
|
|
|
|
|
|
|
|
| |
* stream.c (symlink_wrap, link_wrap, readlink_wrap): New functions.
* stream.h (symlink_wrap, link_wrap, readlink_wrap): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Register mkdir_wrap, chdir_wrap, getcwd_wrap, makedev_wrap, minor_wrap,
major_wrap and mknod_wrap.
* stream.c (mkdir_wrap, chdir_wrap, getcwd_wrap, makedev_wrap,
minor_wrap, major_wrap, mknod_wrap): New functions.
(stream_init): Initialize forgotten variable s-ifsock.
* stream.h (s_ifsock): Declared.
(mkdir_wrap, chdir_wrap, getcwd_wrap, makedev_wrap,
minor_wrap, major_wrap, mknod_wrap): Declared.
* txr.1: Forgotten documentation for remove-path and rename-path
added. Forgotten mention of s-ifsock. Documented new Unix functions.
|
|
|
|
|
|
| |
* txr.1: Documented.
* genvim.txr, txr.vim: Updated.
|
|
|
|
|
|
| |
of Lisp forms denoted by @.
(expand_meta): Bugfix: failure to expand vars, which can be
symbol macros now.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
vector literals using their original notation.
* parser.y (unquotes_occur): Takes new argument, level.
Only finds quotes which are at the given quasiquoting level.
Finally, this is the right semantics. In the first version of this
function, we were not eager enough: we neglected to find unquotes
that were wrapped in nested quasiquotes. Then we were too eager:
finding any unquotes, even ones belonging to the inner backquotes.
(vector, hash, choose_quote): Pass zero to unquotes_occur function.
|