| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I'm fixing a historic mistake copied from ANSI Lisp,
which trips up language newcomers and sometimes even
experienced users.
The function innocently named sort will now return newly
allocated structure. The function previously called sort will
be available as nsort (non-consing/allocating sort).
The shuffle function also becomes pure, and is accompanied by
nshuffle.
* eval (me_op): Continue to use destructive sort in this
legacy code that is only triggered in very old compat mode.
(eval_init): Registered nsort and nshuffle.
* lib.c (nsort, nshuffle): New functions introduced, closely
based on sort and shuffle.
(sort, shuffle): Rewritten to avoid destructive behavior: work
by copying the input and calling destructive counterparts.
(sort_group): Continue to use destructive sort, which is safe;
the structure is locally allocated. The sort_group function
has pure semantics.
(grade): Likewise.
* lib.h (nsort, nshuffle): Declared.
* share/txr/stdlib/getopts.tl (opthelp): Replace an instance
of the (sort (copy-list ...)) pattern with just (sort ...).
* tags.tl (toplevel): Continue to use destructive sort to sort
tags before writing the tag file; the lifetime of the tags
list ends when the file is written.
* tests/010/seq.txr: Switch some sort calls to nsort to keep
test case working.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* tags.tl (fake-load): When the file doesn't end in .tl, we
are only trying it with the .tl suffix, without falling back
on the original name. And we are doing that in an ignerr, so
the nil object will be used as a stream. This cause stdin to
be read when the function encounters a dangling symlink.
|
|
|
|
|
| |
* tags.tl (process-clause): Symbols from @(bind) should be
recorded as variable tags, not function tags.
|
|
|
|
| |
* tags.tl (process-form): Handle top-level macro-time form.
|
|
|
|
|
|
| |
* tags.tl (process-form): Use mappend for the recursive
processing, not mapdo, and invoke pend on the result
to add it to the accumulated list.
|
|
|
|
|
|
| |
* tags.tl (process-package-influencing-form): When a load-for
is encountered, only descend into fake-load if the clause
kind is pkg, and the package doesn't exist.
|
|
|
|
|
|
|
| |
* tags.tl (in-anon-package): Take advantage of the system
function sys:make-anon-package which is used in the
file compiler, instead of creating a package named "anon"
which could plausibly clash with an existing package.
|
|
|
|
|
|
|
|
| |
* tags.tl (in-anon-package): Instead of the unwind-protect
which deletes the anonymous package, let us save and restore
the *package-alist* by dynamically binding it to its current
value. This will roll back packages that were created by
fake-load.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tags.tl (*fake-load-path*): New special variable.
(process-package-influencing-form, fake-load): New functions.
(process-form): Pass each compound form to
process-package-influencing-form in case it might be a
defpackage or load.
(collect-tags-tl): Bind *fake-load-path* to the file's path
so fake-load will resolve relative paths relative to the
file's own directory, similarly to how load works with
*load-path*.
|
|
|
|
|
|
|
|
|
|
| |
Let's process each file in an anonymous package, saving and
restoring the *package* special. TXR files can mess with that
variable.
* tags.tl (in-anon-package): New macro.
(collect-tags-tl, collect-tags-txr): Wrap parsing with
in-anon-package macro.
|
|
|
|
|
| |
* tags.tl (process-clause): Bugfix: flatcar must be used, not
flatten, because the bindings can contain dotted notation.
|
|
|
|
|
|
|
|
|
|
|
| |
* tags.tl (unexpand): New function.
(process-clause): Walk the forms enclosed in a @(do ...)
directive that appears at the top level. Because all Lisp is
macro-expanded right inside the TXR parser, we need to
"unexpand" the forms by chasing their macro-ancestor
chain, gaining access to the original forms like defun
and defstruct. We can then turn these forms into tags using
the process-form function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Handles only top-level define and bind.
* tags.tl (with-tag-shorthand-macro): New macro: a robot for
writing the the shorthand macrolet in collect-tags, so we can reuse it.
(process-form): New function, made from the bulk of
collect-tags.
(collect-tags): Renamed to collect-tags-tl. The macrolet is
replaced by invocation of with-tag-shorthand macro and the
form case processing logic by a call to process-form.
(process-clause, collect-tags-txr, collect-tags-guess): New
functions.
(toplevel): Help text updated. Process .txr files through
collect-tags-txr. Also process unsuffixed files, if they are
explicity mentioned on the command line, through
collect-tags-guess, which looks for hash-bang lines containing
the --lisp option.
|
|
|
|
|
|
|
| |
* tags.tl (escape): Vim is failing to find tag entries when
the search patterns are lines containing backslashes.
Backslash must be added to the list of characters needing
escaping in tag patterns.
|
|
|
|
|
| |
* txr.tl (toplevel): In the usage output, a few quasiliterals
should just be literals since nothing is interpolated.
|
|
|
|
|
|
|
|
| |
* tags.tl (toplevel): We need to push directories into the
skiplist when we don't have FTW_ACTIONRETVAL, indicated by
ftw-actionretval being zero. If ftw-actionretval is nonzero,
so is ftw-skip-subtree, which completely takes care of the
skipping of subdirectories.
|
|
|
|
|
| |
* tags.tl (static-when): Macro must explicitly reduce
expression to its value.
|
|
|
|
|
| |
* tags.tl (toplevel): Wrap in compile-only so compiler doesn't
execute it.
|
|
|
|
|
|
|
|
|
|
| |
* tags.tl (collect-tags): Snarf the file as a string from
which we can make a string byte input stream suitable for
parsing. Having that string, we can handle hash bang by
detecting it and commenting it out with a semicolon. We obtain
the lines by splitting the string. When calling read, we
pass the path as the name argument, so error messages still
use the correct file name.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tags.tl (tags-opts): Cumulative exlude option added.
(ftw-actionretval, ftw-continue, ftw-skip-subtree): These
variables are missing if we are not on Glibc, so we define
them as zero. These definitions help us take advantage of
FTW_ACTIONRETVAL to skip recursing into exluded subtrees.
(static-when): New macro.
(toplevel): Implement exclude option. Skipping directories on
platforms whose nftw function doesn't have FTW_ACTIONRETVAL is
simulated by keeping a dynamic skip list, which is
intelligently purged to keep it short.
|
|
|
|
|
|
|
|
| |
* tags.tl (collect-tags): In proccessing a
define-option-struct, don't record a tag for a
long or short option that is nil. Each option definition
defines only one slot. If both a long and short option are
present (non-nil), then the long option names the slot.
|
|
|
|
|
|
|
| |
* tags.tl (write-tagfile): Since we can assume that the tags
file is sorted, and the tags coming into this function are
likewise sorted, we can just merge the sorted lists.
Then, we don't have to sort the tags list a second time.
|
|
|
|
|
|
|
|
|
| |
* tags.tl (collect-tags): For hash-bang files, pop the dummy
blank line that we inserted at the head of the line
list to obtain 1-based numbering. If the parser starts working
ater the #! line, it means the second line is 1, which is the
same as zero-based numbering, so we can lose the dummy
entry and all is well.
|
|
|
|
|
|
| |
* tags.tl (collect-tags): Generate tags for the
define-option-struct macro, indexing both the long
and short forms.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tags.tl (tag-opts): New option struct.
(orig-tag): New struct.
(write-tagfile): Take option struct as argument.
Implement merge and append options.
(toplevel): Parse arguments and provide usage text.
Default to processing the current directory when
no non-option arguments are given. Allow files that
don't end in .tl, if they are explicititly specified;
but directories are searched only for .tl files.
|
|
|
|
|
| |
* tags.tl (collect-tags): Use macrolet to sugar over the
numerous new operator calls.
|
|
|
|
|
|
|
|
|
| |
* tags.tl (tag): New slot, type; new method, text.
(fun-tag, var-tag, struct-tag, type-tag): Override
type slot with appropriate value ("f", "v", "s", "t"), and
remove text method.
(slot-tag): Override type; keep text method, and interpolate
typee instead of hard-coded "m".
|
|
* tags.tl: New file.
|