summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* struct: fix lack of hygiene in null-safe qref.Kaz Kylheku2021-04-051-1/+3
| | | | | | | | | The expression a.?b is not being treated hygienically; a is evaluated twice. This is only if the null-safe object is the left most; a.b.?c is hygienic. * share/txr/stdlib/struct.tl (qref): Add the necessary gensym use to fix the broken case.
* doc: document null-safe method call.Kaz Kylheku2021-04-051-4/+26
| | | | | * txr.1: The notation obj.?(fun ...) exists, but is not documented. Let's fix that.
* compiler: remove optional param from lookup-var.Kaz Kylheku2021-04-051-5/+3
| | | | | | * share/txr/stdlib/compiler.tl (struct env): The mark-used optional parameter of lookup-var is not used anywhere, and so always nil. Let's remove it.
* INSTALL: revise outdated text, add cross-compiling advice.Kaz Kylheku2021-04-041-5/+40
| | | | | | | * INSTALL: Mention the parallel debug and optimized build capability of txr: no need to have two separate directories for that. New section on handling the .tl files in cross-compilation, when the txr executable isn't native.
* doc: remove superfluous words.Kaz Kylheku2021-04-041-1/+1
| | | | | * txr.1: under "File-Wide Insertion of Gensyms", remove superfluous verb phrase from sentence.
* doc: vice versa formatting.Kaz Kylheku2021-04-041-1/+1
| | | | | * txr.1: Under "Treatment of Literals", fix lack of close double quote in italicization of vice versa.
* doc: clarify definition of top-level form.Kaz Kylheku2021-04-041-3/+6
| | | | | | | * txr.1: In the definition of what is a top-level form to the compiler, replace poor wording about macro-expansion in rule 6, and add a rule which makes it clear that the rules are recursive.
* doc: note about environment handling in compile.Kaz Kylheku2021-04-041-1/+11
| | | | | | * txr.1: Add notes about environment handling when an interpreted function is compiled, and how hlet/hlet* can be used to obtain sharing.
* doc: fix missing item periods.Kaz Kylheku2021-04-041-20/+20
| | | | * txr.1: All missing item number periods added.
* doc: double word in awk intro.Kaz Kylheku2021-04-041-1/+1
| | | | * txr.1: Fix "implement implement".
* awk: relax restriction on :name.Kaz Kylheku2021-04-042-10/+9
| | | | | | | | * share/txr/stdlib/awk.tl (sys:awk-expander): Do not impose stricter restrictions on :name than the block mechanism itself. * txr.1: Documentation updated.
* doc: block names need not be symbols.Kaz Kylheku2021-04-041-1/+7
| | | | | * txr.1: The block implementation doesn't care whether blocks are symbols; anything comparable with eq may be used.
* func-optparam-count: bugfix.Kaz Kylheku2021-04-031-1/+1
| | | | | | | * lib.c (get_param_counts): If there are no optional parameters, then the oa variable stays negative; we must turn that into a zero, otherwise we return the bogus value -1 as the number of optional arguments.
* lib: new function for documentation lookup.Kaz Kylheku2021-04-035-1/+2142
| | | | | | | | | | | | | | | | * genman.txr: dump contents of symhash into a doc-syms.tl library file, as a defvarl form. * lisplib.c (doc_instantiate, doc_set_entries): New static functions. (lisplib_init): Register autoload for doc-lookup module to symbols doc and *doc-url*. * share/txr/stdlib/doc-lookup.tl: New file. * share/txr/stdlib/doc-syms.tl: Likewise. * txr.1: Documented.
* doc: dialect note capitalization.Kaz Kylheku2021-03-311-8/+8
| | | | * txr.1: Consistently capitalize Dialect Note
* doc: PP fixes.Kaz Kylheku2021-03-311-4/+0
| | | | | * txr.1: Remove two unnecessary .PP directives and a blank line before one.
* doc: formatting of notes under circle, erase notation.Kaz Kylheku2021-03-311-3/+7
| | | | | | * txr.1: Don't use TP* for notes and dialect notes because it doesn't fit these paragraphs that don't have an indented margin.
* doc: bad indenation under if directive.Kaz Kylheku2021-03-311-1/+1
| | | | * txr.1: Add .PP to deindent after example.
* doc: fix wording under --lispKaz Kylheku2021-03-311-2/+2
| | | | | * txr.1: Fix grammar problem and wording for --lisp and --compiled.
* doc: split up -l or --lisp-bindingsKaz Kylheku2021-03-311-1/+2
| | | | | * txr.1: Give the two -l and --lisp-bindings synonyms in the same way was other synonyms, as two separate .IP items.
* doc: style items better, without grid style.Kaz Kylheku2021-03-311-6/+11
| | | | | | * genman.txr: Use an alternative solution for dl.items elemens which places short items to the left of their definining text, while allowing long items to overhang.
* doc: blank lines after IP sections.Kaz Kylheku2021-03-302-21/+10
| | | | | | | | * checkman.txr (check-ip): New pattern function for checking for IP, coIP and meIP macros followed by blank line. This causes a formatting issue in HTML. * txr.1: Fix numerous instances of problem caught by check-ip.
* doc: missing RS/RE.Kaz Kylheku2021-03-301-0/+2
| | | | * txr.1: add .RS/.RE pair in Quote and Quasiquote.
* doc: add grid styling to itemized lists.Kaz Kylheku2021-03-301-1/+14
| | | | | * genman.txr: add CSS rules targeting <dl class="items">, which are now supported in man2html.
* doc: incorrect synopsis of push.Kaz Kylheku2021-03-301-4/+5
| | | | | | * txr.1: Under the summary of place-mutating operations, rewrite the description of push which falsely claims that the pushed item is returned.
* compiler: incorrect self-check in spy framework.Kaz Kylheku2021-03-301-2/+2
| | | | | | * share/txr/stdlib/compiler.tl (compiler (pop-closure-spy, pop-access-spy)): The stack underflow checkt must be done by checking top, not the incoming spy argument.
* doc: copy and paste of :wrap under window-mapKaz Kylheku2021-03-301-1/+1
| | | | * txr.1: Fix about :reflect wrongly referring to :wrap.
* doc: fix under stream indentationKaz Kylheku2021-03-301-1/+1
| | | | * txr.1: indent-foff misspelled as intent-foff.
* doc: numerous grammar fixes.Paul A. Patience2021-03-281-21/+25
| | | | | * txr.1: Fix grammar, punctuation, formatting, and cases of misspellings landing on dictionary words.
* expander: fun: misleading diagnostic.Kaz Kylheku2021-03-281-1/+1
| | | | | * eval.c (do_expand): argument of fun is not in "operator position"; fixed wording.
* doc: fix space before period.Kaz Kylheku2021-03-281-2/+2
| | | | | * txr.1: Fix two occurrences of \*(TL being separated from a period by a space in the ARGUMENTS AND OPTIONS section.
* compiler: cache param-info objects.Kaz Kylheku2021-03-272-13/+16
| | | | | | | | | | | | | | | * share/txr/stdlib/compiler.tl (%param-info%): New global variable. (compiler comp-fun-form): Use get-param-info function to get param-info object. (get-param-info): Retrieve object from cache, using the function as the key. If not found, create the entry. (compiler-emit-warning): Use get-param-info. * share/txr/stdlib/param.tl (struct param-info): Remove symbol slot, replacing it with the function. (param-info :postinit): No need to do symbol-function lookup; the function is given.
* compiler: regressions in source loc propagationKaz Kylheku2021-03-271-25/+27
| | | | | * share/txr/stdlib/compiler.tl (reduce-lisp, reduce-constant): Propagate source location to rewritten forms.
* compile/eval: more standard formatting for diags.Kaz Kylheku2021-03-275-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch eliminates parentheses from the error messages, as well as a leading ./ being added to relative paths. The word "warning: " is moved into the error message, so that it does not appear before the location. Example, when doing (compile-file "path/to/foo.tl"). Before patch: warning: (./path/to/foo.tl:37): unbound function foo After: path/to/foo.tl:37: warning: unbound function foo Now when I compile out of Vim, it nicely jumps to errors in Lisp code. * eval.c (eval_exception): Drop parentheses from error location, add colon. (eval_warn): Prepend "warning: " to format string. (eval_defr_warn): Drop parentheses from location, and prepend "warning: " to format string. * parser.c (repl-warning): Drop "warning:" prefix. * share/txr/stdlib/compiler.tl (open-compile-streams): Do not do parent substitution for relative paths if the parent path is the empty string "", to avoid inserting ./ onto relative paths in that case. * share/txr/stdlib/error.tl (sys:loc): Drop parentheses and space from location. (compile-error) Separate location with colon and space. (compile-warning, compile-defr-warning): Likewise and add "warning: " prefix. * unwind.c (uw_rthrow): Drop "warning: " prefix. (uw_warningf): Add "warning: " prefix. (uw_dump_deferred_warnings): Drop "warning: " prefix.
* compiler: bugfix: bad expand-quasi-mods call.Kaz Kylheku2021-03-271-1/+1
| | | | | | | | | * share/txr/stdlib/compiler.tl (expand-quasi-args): Here, expand-quasi-mods is being called with the wrong number of arguments. This was likely intended to be a recursive call to expand-quasi-args. Let's convert it to that. Removing this case also works, but it is nicer not to generate the sys:fmt-simple call.
* compiler: check number of arguments.Kaz Kylheku2021-03-272-35/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We implement rudimentary compile-time checking beween function calls and function definitions. * share/txr/stdlib/compiler.tl (dstruct frag): We add one more optional BOA parameter, corresponding to a new slot. This is used when compiling a lambda. A lambda fragment is annotated with the parameter parser object which gives information about its arguments. (struct fbinding): New slot, pars. When processing a sys:fbind or sys:lbind form, we decorate the lexical function bindings with the parameter object pulled from the lambda fragment that is compiled for each function binding. (*unchecked-calls*): New special variable. This is used for checking, at the end of the compilation unit, the arguments of calls to functions that were not defined at the time of the call. (compiler comp-fbind): When processing the lambda expressions, propagate the parameter object from the compiled lambda fragment to the function binding. (compiler comp-fun-form): On entry, look up the function being called and if it is lexical or has a global definition, check the arguments. If it has no definition, push information into the *unchecked-calls* list to do the check later, if possible. Also, there is a behavior change here now: optimizations are now applied here only to functions that don't have a lexical binding. Thus if the application lexically redefines a standard function, and calls it, we won't try to optimize it. (param-check): New function. * share/txr/stdlib/param.tl (param-info): New struct. This presents information about a global function in a similar way to param-parser, using some of the same fields. With this object we can check the call to a lexical function or global function in a uniform way, using the same code.
* compiler: fix: careless constant folding of call.Kaz Kylheku2021-03-271-1/+4
| | | | | | | | | | | * share/txr/stdlib/compiler.tl (compiler comp-apply-call): The conditions for constant-folding a call expressions are too weak. The first argument could be a quoted symbol, which is a constant expression, and so we end up wrongly evaluating an expression like (call 'print '3) at compile time. We can constant-fold if the first expression evaluates to a symbol, which names a constant-foldable function, or else if it evaluates to something which is not a bindable symbol.
* Version 255txr-255Kaz Kylheku2021-03-266-971/+1010
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Bumped. * txr.vim, tl.vim: Regenerated.
* doc: improve wording under copy-hash.Kaz Kylheku2021-03-261-5/+6
| | | | | * txr.1: Relationship between make-similiar-hash and copy-hash is expressed more accurately.
* lib: remove unnecessary braces in funcall FVM cases.Kaz Kylheku2021-03-251-25/+15
| | | | | * lib.c (funcall, funcall1, funcall2, funcall3, funcall4): Remove unnecessary braces.
* compiler: new jump skid optimization case.Kaz Kylheku2021-03-251-0/+9
| | | | | | | | | | | | | | ifq tN t0 label0 ifq tN t0 label1 ... ... label0: --> ... if tN label2 label1: label1: ... ... * share/txr/stdlib/optimize.tl (basic-blocks thread-jumps-block): Implement case. There are there are 56 "hits" for this in the standard library.
* vm: allow signals during vm execution.Kaz Kylheku2021-03-251-1/+6
| | | | | | | | | | I have experimented with several approaches, and found that this one has an immeasurably small effect on performance, below the noise floor. * vm.c (vm_jmp): Call sig_check_fast whenever there is a backwards branch. (vm_execute): Check for signals once, on entry.
* METALICENSE: fix typo.Kaz Kylheku2021-03-241-1/+1
| | | | * METALICENSE: yeras typo teported by P. A. Patience.
* MacOS: adjust socket-basic test for dgram size.Kaz Kylheku2021-03-241-4/+7
| | | | | | | | | * tests/014/socket-basic.tl (%iters%): New variable. 2000 on MacOS, 5000 elsewhere. (client, server): Use %iters% instead of hard-coded 5000. (test): Rename to sock-test, since it clashes with the test macro coming from common.tl, which we neeed to for the os-symbol function.
* M1: Fix sed issue.Kaz Kylheku2021-03-241-1/+5
| | | | | | | | | | | | | | | | | The MacOS sed doesn't accept semicolon termination for commands involving defining labels or branching to labels. This is not a new issue, but it is revealed on newer MacOS because the sed now complains about unused labels. In the sed command ':x; /whatever/ { ...; tx }', everything after the initial : is interpreted as a label. * Makefile (DEPGEN): Split the sed command's syntax up into logical lines using multiple -e commands, applying some formatting with indentation to try to keep it readable. It looks like multiple -e options just glue together to make a program, as if they were lines of code; one -e can define a label referenced by another, and even the closing brace can be treated as a separate command.
* M1: disable -nopie.Kaz Kylheku2021-03-241-4/+2
| | | | | * configure: Don't try to use -nopie in Darwin environments. With newer clang on the M1, it generates nuisance warnings.
* build: port to Apple M1.Kaz Kylheku2021-03-232-2/+15
| | | | | | | | | | * configure (lit_align): Also don't calculate lit_align as 2 on Darwin/arm64; that is a hack needed on 32 bit x86 Mac OS. * jmp.S: Define DEFUN for Arm64 on Darwin. We have to use %% as the statement separator; semicolons are comments. Use the same __aarch64__ code for __arm64__. We just need some Apple specific tidbits before and after.
* build: use yacc pattern rule with "y" as stem.Kaz Kylheku2021-03-221-9/+1
| | | | | | | | | | | | | | | | Thanks to a recent discussion in the GNU Make mailing list about some issue related to grouped patterns, I hit upon the realization that the rule y.tab.h y.tab.c: parser.y has a common stem, y, which can be exploited to write a pattern rule. This is only active in maintainer mode; in user mode, the y.tab.h and y.tab.c are separately produced from .shipped files. * Makefile (y.tab.h): Eliminate rule which detects a removed y.tab.h. (y.tab.c): Delete rule, replacing with new rule. (%.tab.c %.tab.h): New pattern rule, which groups the targets together.
* ffi: support float type as variadic argument.Kaz Kylheku2021-03-222-8/+69
| | | | | | | | | | | | | | | | | | | The float type promotes to double when passed as a variadic argument. This patch adds internal FFI types which models that promotion. It uses double for its C type, while still performing the range checks for float. Also, the types be-float and le-float are rejected from being variadic arguments. * share/txr/stdlib/ffi.tl (analyze-argtypes): Rewrite function, adding validation and substitution for the variadic part of the argument type list. Map float type to double, and reject be-float and le-float. * txr.1: Documented.
* ffi: fix missing support for misaligned ushort.Kaz Kylheku2021-03-221-0/+2
| | | | | | | | | * ffi.c (ffi_ushort_get): Add the missing align_sw_get macro that checks for and handles misalignment. Commit e539fbc2af3bd4a5bd4ca3d9b567862005509aa1 made on 2017-06-05 added these macros and fixes to numerous functions. The commit message claims that ffi_ushort_get was among the functions fixed, but no change was made to the function.