summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* New: callable integers and ranges.Kaz Kylheku2023-06-284-2/+86
| | | | | | | | | | | | | | | | | * lib.c (do_generic_funcall): Allow integers and ranges to be function callable. They take one argument and index into it or extract a slice. In the case of ranges, this is a breaking change. Ranges can already be used in the function position in some limited ways that are not worth preserving. * tests/012/callable.tl: New file. * tests/012/iter.tl: Here we fix two instances of breakage. Using txr -C 288 will restore the behaviors previously tested here. * txr.1: Documented.
* New cached sorting functions.Kaz Kylheku2023-06-285-2/+116
| | | | | | | | | | | | | | | | | | These functions are useful when sorting a sequence using an expensive keyfun. * autoload.c (csort_set_entries, csort_instantiate): New static functions. (autlod_init): Register autoloading of csort module via new functions. * stdlib/csort.tl: New file. * tests/012/sort.tl: csort functions included in tests. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
* New function: hash-map.Kaz Kylheku2023-06-286-0/+53
| | | | | | | | | | | | | | | | | | | | hash-map converts a function mapping over a sequence into a hash table. * hash.[ch] (hash_map): New function. * tests/010/hash.tl: Test case. * genman.txr: The hash-map identifier introduces a hash collision. We have to deal with that somehow now. (colli): We put the conflicting entries into a new hash called colli which maps them to an increment value. (hash-title): Increment the hash code h by the amount indicated in colli, if the title is found there. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
* equal: bug: broken equality substitution.Kaz Kylheku2023-06-282-3/+11
| | | | | | | | | | | | | * lib.c (equal): Several cases which react to the type of the left argument have a default path which wrongly short-circuits to an early return. All these cases must break through to the logic at the end of the function which tests the right side for a possible equality substitution. * tests/012/struct.tl: One breaking test cases added. equal was found to return nil for two structures that have equal lists as their equality substitute.
* ssort: gc bug in vector case.Kaz Kylheku2023-06-283-4/+6
| | | | | | | | | | * gc.[ch] (gc_prot_array_alloc): Return the COBJ via new pointer argument. * lib.c (ssort_vec): Capture the object from gt_prot_array_alloc into a local variable, That makes it visible to the garbage collector, so it won't be prematurely reclaimed. Since we don't use or return that object, we need to use gc_hint.
* eval: take macro environment.Kaz Kylheku2023-06-278-152/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change we fix the bug that the debugger commands yield their Lisp forms rather than evaluating them. * eval.c (eval_intrinsic): Takes one more argument, the macro environment. This is passed into env_to_menv as the root macro environment. (eval_init): Update registration of eval intrinsic to have two optional arguments. * eval.h (eval_intrinsic): Declaration updated. * parser.c (read_file_common, read_eval_ret_last): Pass nil argument to new parameter of eval_intrinsic. (repl): Pass the env parameter as the new menv parameter of eval_intrinsic, rather than the existing env parameter. This fixes the command dispatch in the debugger, since the command table is consists of symbol macros, and not variables. For instance the backtrace command bt is a binding of the bt symbol to the form (sys:print-backtrace), which has to be substituted for it and executed. When that envrionment is used as the ordinary environment, bt looks like a variable whose value is the list (sys:backtrace). * parser.y (elem, check_parse_time_action): Fix eval_intrinsic calls. * txr.c (txr_main): Likewise. * txr.1: Documented. * y.tab.c.shipped: Updated. * stdlib/doc-syms.tl: Updated.
* hash: rename some variables in remove algorithmsKaz Kylheku2023-06-221-7/+7
| | | | | | | | | | hash.c (hash_remove): In the algorithm that moves cells forward in the cluster in order to avoid the use of tombstones, we use slightly better variables. The cell we are looking to replace is called wipe rather than start. The cryptic varaible name k is renamed to iprobe, because it the initial probe location for the cell at position i.
* hash: support existing mutation+iteration semantics.Kaz Kylheku2023-06-203-15/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original chained hashing scheme makes certain guarantees in situation when a hash table that is being iterated is also undergoing insertions or deletions. The original scheme meets these requirements simply, by putting a freeze against hash table growth while there are outstanding iterations. Chained hashing gracefully handles load factors above 1. Load factors above 1 are not possible under open addressing (and we don't even want to approach 1) but we would like to preserve the requirements. The requirements are: 1. If an iterator has already visited an item, it will not see that item again, regardless of insertions which cause the table to be reorganized. 2. It is not specified/required that an iterator will visit newly inserted items. It may visit some of those items, but not others. 3. If an iterator has not yet visited an item, and that item is deleted, it will not see that item, regardless of any insertions that reorganize the table. In this commit, we implement a "table stack" scheme. 1. When a table is resized due to insertions, and it is being iterated (h->usecount > 0), in that situation it will push the existing small table onto a stack, the h->tblstack (table stack). 2. Iterators take a hash table's current table and its size, and work with that snapshot of the table. If the original hash table grows, existing iterators work with the original table as it existed just before the reorganization. So after that they do not see any new insertions. 3. Whenever the delete operation (hash_remove) finds the item and removes it from the current table, it also walks the table stack, searches for the item in every table in the stack and nulls it out. This search is oblivious to nil; it's a blind search that goes around the table starting at the first probe position, looking for the identical cons cell to take out. This algorithm ensures that iterators will not see a deleted item, unless they already visited it before the deletion, of course. * hash.h (struct hash_iter): New members table, and mask. * hash.c (struct hash): New member, tblstack. (hash_grow): We drop the vec argument and recreate it locally (not essential to this commit). If we find that the usecount is positive, we push the existing table onto the table stack. Otherwise, we take the opportunity to obliterate the table stack. (hash_insert): Drop the restriction that hash_grow is only called when the use count is zero. Adjust calls to hash_grow to drop the vec argument. (hash_remove): When an item is found and deleted, and the table is in use by iterators, walk the table stack and delete it from each previous table. Otherwise, if the table is not in use by iterators, obliterate the table stack. (hash_mark): Exit early also if there is a table stack, and mark that stack. (do_make_hash, make_similar_hash, copy_hash): Initialize table stack in new hash. (hash_iter_mark): Mark the iterator's table. This is likely not necessary since we also mark the hash table, which should have a pointer to that same table. That wouldn't be defensive programming, though. (hash_iter_init, us_hash_iter_init): Initialize table and mask. (hash_iter_next_impl, hash_iter_peek): These functions have to walk the table snapshot taken by the iterator, using the captured mask, and not the current table. (has_reset): If the target table's use count drops to zero, obliterate its table stack. We add a missing setcheck here; this operation potentially stores a different hash into an existing iterator. It's not being done safely with regard to generational GC. * tests/010/hash.tl: New tests.
* hash: experimental switch to open addressing.Kaz Kylheku2023-06-202-210/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * hash.h (struct hash_iter): chain and cons members removed; index member added. * hash.c (struct hash_ops): acons_new_c_fun member removed. (hash_ops_init): Reduced to three arguments. (hash_grow): Function removed. (hash_find_slot, hash_lookup, hash_grow, hash_insert, hash_remove): New static functions. (hash_mark): Iterate the simple open table, which directly contains pointers to the hash entry cons cells, rather than lists of these. (hash_acons_new_c, hash_aconsql_new_c, hash_aconsq_new_c): Static functions removed. (hash_eq_ops, hash_eql_ops, hash_equal_ops): Initializer macro calls reduced to three arguments. (copy_hash_chain): Function removed. (copy_hash): copy_hash_chain logic altered to duplicate the hash cells like copy_hash_chain did. (gethash_c, gethash_e, remhash): Retargeted to the new static functions that do open addressing with linear probing. (hash_iter_mark): No cons member to mark any more. (hash_iter_init, us_hash_iter_init): Initialization updated to new representation. (hash_iter_next_impl, hash_iter_peek): Rewritten to traverse simple table. Loses second argument. (hash_iter_next, hash_next): Don't pass second argument to hash_iter_next_impl. (do_weak_tables): Adjusted to walk open table.
* hash: bug: initial hash mask miscalculation.Kaz Kylheku2023-06-191-3/+3
| | | | | | | | | | | | | | | | | | Hash tables are supposed to start with a mask of 255, which is the 256 modulus less one. However, due to a coding mistake, they get a modulus of 252. Now this still works. It just has a few zero bits in it: 1111 1100 rather than 11111111. When this grows by doubling in size, we get 1 1111 1001, 11 1111 0011 and so on. Now this still all works, because hash values AND-ed with such a mask are no greater than that mask. The table isn't accessed out of bounds. It's just inefficiently used. * hash.c (do_make_hash, make_similar_hash, clearhash): When converting the power-of-two modulus, which is a Lisp word, to the integer mask, subtract 1 from the integer value, not the original Lisp word.
* quips: procrastination quip.Kaz Kylheku2023-06-171-0/+1
| | | | * stdlib/quips.tl (%quips%): New one.
* New macro: match-cond.Kaz Kylheku2023-06-125-1/+98
| | | | | | | | | | | | | * stdlib/match.tl (match-cond): New macro. * autoload.c (match_set_entries): match-cond triggers autoload of match module. * tests/011/patmatch.tl: Tests. * txr.1: Documented. * stdlib/doc.tl: Updated.
* New @(push) directive.Kaz Kylheku2023-06-1211-6410/+6723
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @(push) is like @(output), but feeds back into input. Use carefully. * parser.y (PUSH): New token. (output_push): New nonterminal symbol. (output_clause): Handle OUTPUT or PUSH via output_push. Some logic moved to output_helper. (output_helper): New function. Transforms both @(output) and @(push) directives. Checks both for valid keywords; push has only :filter. * parser.l (grammar): Recognize @(push similarly to other directives. * lib.[ch] (push_s): New symbol variable. * match.c (v_output_keys): Internal linkage changes to external. (v_push): New function. (v_parallel): We must fix the max_line algorithm not to use an initial value of zero, because lines can go negative thanks to @(push). We end up rejecting the pushed data. (v_collect): We can no longer assert that the data line number doesn't retreat. (dir_tables_init): Register push directive in table of vertical directives. * match.h (append_k, continue_k, finish_k): Existing symbol variables declared. (v_output_keys): Declared. * y.tab.c.shipped, * y.tab.h.shipped, * lex.yy.c.shipped: Updated. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
* Version 288.txr-288Kaz Kylheku2023-06-106-1341/+1377
| | | | | | | | | | | | * RELNOTES: Updated. * configure (txr_ver): Bumped version. * stdlib/ver.tl (lib-version): Bumped. * txr.1: Bumped version and date. * txr.vim, tl.vim: Regenerated.
* lib: string bug spotted on Solaris.Kaz Kylheku2023-06-101-1/+1
| | | | | | | | | | * lib.c (string_finish): On platforms where we do not HAVE_MALLOC_USABLE_SIZE, there is a compiler diagnostic. The code is inappropriately using the set macro and mkloc to assign the st->st.alloc member, which is just a number (cnum type), and not a val. The set macro is only needed when mutating a gc heap object to point to another gc heap object.
* New functions keep-keys-if, separate-keys.Kaz Kylheku2023-06-076-1/+208
| | | | | | | | | | | * lib.[ch] (keep_keys_if, separate_keys): New functions. * eval.c (eval_init): keep-keys-if, separate-keys intrinsics registered. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
* clean-file: tests.Kaz Kylheku2023-06-052-0/+110
| | | | | | * tests/018/clean.tl: New file. * tests/018/clean.expected: New file.
* autoload: rename local variable.Kaz Kylheku2023-06-051-2/+2
| | | | | | | * autoload.c (expander_let_set_entries): The expander-let symbol is in the usr package, registered via autoload_set, so the array should be called name and not sys_name.
* New functions load-args-recurse and load-args-processKaz Kylheku2023-06-055-0/+352
| | | | | | | | | | | | * autoload.c (load_args_set_entries, load_args_instantiate): New static functions. (autoload_init): Register new auto-loaded module "load-args". * stdlib/load-args.tl: New file. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
* compiler: more logging regarding compiled files.Kaz Kylheku2023-06-051-12/+23
| | | | | | | | * stdlib/compiler.tl (clean-file): Under a log-level of 1 or more, report clean-file removes a file. (compile-update-file): Under a log level of 1 or more, report when a compiled file was skipped due to being up-to-date.
* compiler: new compiler option log-levelKaz Kylheku2023-06-043-7/+38
| | | | | | | | | | | | | | | | | | With log-level, we can obtain trace messages about what file is being compiled and individual forms within that file. * autoload.c (compiler_set_entries): Intern the slot symbol log-level. * stdlib/compiler.tl (compile-opts): New slot, log-level. (%warning-syms%): Add log-level to %warning-syms%. Probably we need to rename this variable. (compile-file-conditionally): Implement the two log level messages. (with-compile-opts): Allow/recognize integer option values. * txr.1: Documented.
* compiler: new function, clean-file.Kaz Kylheku2023-06-044-1/+92
| | | | | | | | | | | | | | | | This function simplifies cleaning, by allowing a file to be cleaned to be identified in much the same way as an input file to load or compile-file. * autoload.c (compiler_set_entries): The clean-file symbol is interned and becomes an autoload trigger for the compiler module. * stdlib/compiler.tl (clean-file): New function. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
* bug: compile-file can put out nil, confusing load.Kaz Kylheku2023-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | The file compiler combines compiled forms into a single list as much as possible so that objects in the list can share structure (e.g. merged string literals). However, when package-manipulating forms occur, like defpackage, it has to spit these lists, since the package manipulations of an earlier form affect the processing of a later form, such as whether symbols in that form are valid. This splitting does not take care of the case that an empty piece may result when the very last form is a package manipulation form. A nil gets written to the .tlo file, which the load function does not like; load thinks that since this is not a valid list of compiled forms, it must be the version number field of a catenated .tlo file, and proceeds to find it an invalid, incompatible version. * stdlib/compiler.tl (dump-to-tlo): Use partition* rather than split*. partition* doesn't leave empty pieces.
* bug: autoload issue affecting with-compilation-unitKaz Kylheku2023-06-031-0/+5
| | | | | | | | | | | | | | | When a (with-compilation-unit ...) form is compiled, it references the value of a certain special variable that is private to the compiler. This reference is correct, but the variable's symbol is not hooked up to trigger autoload. If the compiler module has not yet been loaded, and the compiled version of a with-compilation-unit form is evaluated, it will fail due to an unbound variable error. * autoload.c (compiler_set_entries): Add the sys:*in-compilation-unit* variable name to the autoload triggers for the compiler module.
* Version 287.txr-287Kaz Kylheku2023-06-037-1179/+1263
| | | | | | | | | | | | | | * RELNOTES: Updated. * configure (txr_ver): Bumped version. * stdlib/ver.tl (lib-version): Bumped. * txr.1: Bumped version and date. * txr.vim, tl.vim: Regenerated. * protsym.c: Regenerated.
* gc: fix bad c++ casts.Kaz Kylheku2023-06-032-6/+6
| | | | | | | | | | This C++ regression snuck into in Version 286; I didn't check C++ compilation. * lib.h (container): Macro must use coerce not convert because mem_t * isn't void *. * gc.c (gc_prot_array_alloc): Likewise.
* listener: process multiple expressionsKaz Kylheku2023-06-022-19/+29
| | | | | | | | | * parser.c (repl): use read_objects_from_string, forming a progn expression which is evaluated. Check for the first expression being a listener command. * txr.1: Updated.
* doc: missing html-encode* syntax synopsis.Kaz Kylheku2023-06-021-0/+1
| | | | | * txr.1: Documentation for html-encode* neglects to mention it in the Syntax section.
* doc: defmacro doesn't define local macros.Kaz Kylheku2023-06-021-1/+1
| | | | | * txr.1: Fix text referring to "local macro defined using defmacfro", which should of course be macrolet.
* doc: nonexistent syntactic place.Kaz Kylheku2023-06-021-1/+0
| | | | | | * txr.1: The list of syntactic places mentions the list accessor twice, with different argument orders. Removing the wrong one.
* load: now passes args via *load-args*Kaz Kylheku2023-05-316-23/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can give additional arguments to load, which become arguments of the script, which it can retrieve via the *load-args* special variable. * eval.c (load_args_s): New symbol variable. (loadv): New function, taking over the implementation of load. This takes variadic arguments. Loadv binds the *load-args* variable from the list of variadic arguments. (load): Reduced to wrapper around loadv. (rt_load_for): Each clause in load for can now have arguments after the target name. If that file needs to be loaded, then the arguments are passed. (me_load_for): The macro expander for the load-for macro needs to allow for the load-arg expressions and generate code which passes them to sys:rt-load-for. They all get evaluated. (eval-init): Initialize load_args_s and register the *load-args* variable. Update registration of intrinsic function load to use loadv. * tests/019/load-ret.tl, * tests/019/load-ret/module.tl, * tests/019/load-ret/module2.tl: New files. * txr.1: Documented.
* load: now establishes a block named load.Kaz Kylheku2023-05-314-16/+67
| | | | | | | | | | | | | | | | | | | | | | Files loaded from the command line or via the load function or @(load) directive now have a block named load in scope. Thus (return-from load <expr>) may be used to abort a load when it is finished. The load function will then return the value of <expr>. * eval.c (load): Bind a load block around the whole thing and use the captured return value as the function's return value. * match.c (v_load): Bind the load block here too. Ensure that if the block return is taken, the ret variable contains next_spec_k, so that processing continues with whatever directive follows the @(load). * txr.c (txr_main): Bind the block in severl cases that load code. * txr.1: Documented.
* command line: -e takes multiple forms.Kaz Kylheku2023-05-304-15/+54
| | | | | | | | | | | | * parser.[ch] (read_objects_from_string): New function. * txr.c (help): Update description of -e, and don't describe -p as being like -e. (txr_main): Implement -e using read_objects_from_string, with progn consed to the front. Don't evaluate if it returns the error value colon_k. * txr.1: Documentation updated.
* parser: handle "fatal" conditions in flex scannerKaz Kylheku2023-05-292-174/+192
| | | | | | | | | * parser.l (YY_FATAL_ERROR): New macro. (lex_irrecovarable_error): New function. (parser_l_init): Take address of yy_fatal_error and cast to void, to suppress warning that the function is unused. * lex.yy.c.shipped: Updated.
* New macro: expander-let.Kaz Kylheku2023-05-284-0/+116
| | | | | | | | | | | | | * stdlib/expander-let.tl: New file. * autoload.c (expander_let_set_entries, expander_let_instantiate); New static functions. (autoload_init): Register autoloading of above new file via above new functions. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
* doc: compiler-let syntaxKaz Kylheku2023-05-281-1/+9
| | | | | | * txr.1: the compiler-let operator has a stricter syntax than shown in the synopsis; it only allows (var init-form) pairs, not single variables.
* expander: support param macros in nested macro param lists.Kaz Kylheku2023-05-273-39/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parameter list macros work in inside macro parameter lists, like they do in function parameter lists. However, they ony work at the top level. Macro parameter lists are nested; they may contain nested parameter lists that match corresponding shapes in the argument list. This patch extends parameter list macros to work in nested macro parameter lists. * eval.c (expand_opt_params_rec, expand_params_rec): These two functions must be extended to take a body argument, and to return not just an expanded parameter list but a parameter list accompanied by a body. We do that by making them return a cons cell, whose car is the expanded parameter list and the cdr is the possibly transformed body. Additionally, these functions now call expand_param_macro on nested macro parameter lists. (expand_params): This function becomes slightly simpler as a result of the above changes. Because expand_params_rec already returns a cons cell holding a parameter list and body, we just return that as-is. * tests/011/keyparams.tl: Added some tests of this, vie the standard :key parameter list macro. A macro is tested which has a nested (:key ...) parameter list in a required parameter position as well as in an optional position. * txr.1: Documented.
* awk: new :fun clause for local functions.Kaz Kylheku2023-05-242-28/+56
| | | | | | | | * stdlib/awk.tl (awk-compile-time): New slot, funs. (awk-expander): Gather :fun clauses info funs slot. (awk): Include a labels form which injects the functions. * txr.1: Documented.
* compiler: fbind/lbind: elide unnecessary frames.Kaz Kylheku2023-05-241-9/+15
| | | | | | | | | | | * stdlib/compiler.tl (comp-fbind): When after removing unused functions we are left with an empty list (or the list of functions was empty to begin with), let's only emit the body fragment without any frame wrapping. We can't just return bfrag because that was compiled in the environment which matches the frame. Instead of the expense of compiling the code again, we rely on eliminate-frame to move all v registers up one level.
* label/flet: bug: empty case wallops symbol macros.Kaz Kylheku2023-05-242-1/+6
| | | | | | | | | | | | | | * eval.c (make_var_shadowing_env): We cannot return the original env in the empty variable case, but earnestly make a new one. This function is used by the expander when walking the lbind/fbind special from emitted by labels/flet. That form clobbers the environment via make_fun_shadowing_env, which calls make_var_shadowing_env and then destructively moves the variable bindings to the function binding slot of the environment. The manifestation is that when we have (symacrolet ((x 1)) (labels () x)), the x fails to expand; it has been wrongly moved to the function bindings area of the macro environment.
* awk: widen scope of redirection macros.Kaz Kylheku2023-05-242-39/+52
| | | | | | | | | | | | | | | | | This change makes it possible to use the redirection macros like -> and ->> everywhere in the awk macro, including the init-forms of the :let clause. * stdlib/awk.tl (sys:awk-mac-let-outer): New macro. (sys:awk-mac-let): Move redirection macros into awk-mac-let-outer. (awk): Rearrange the order of wrapping. We split the let so the awk-retval and aws-sym are bound outermost. Then we have the outer macros that provide the redirection operators. Then the application-defined lets inside of that. * txr.1: Documented wide scope of redirection macros.
* lib: fix issue uncovered by recent vm CALL insn change.Kaz Kylheku2023-05-242-7/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The functions funcall1 through funcall4, when invoking a VM function, are not defending against the case when there are more arguments than the function can take. As a result, some :mass-delegate tests in tests/012/oop.tl are failing. They expect an :error result, but the calls are succeeding in spite of passing too many parameters via the delegate interface. The tests/012/lambda.tl suite should catch this, but it has unfortunate weaknesses. * lib.c (funcall1, funcall2, funcall3, funcall4): When dispatching the general VM case via vm_execute_closure, check that if the closure has fewer fixed parameters than arguments we are passing, it must be variadic, or else there is an error. * tests/012/lambda.tl (call-lambda-fixed): New function. Unlike call-lambda, which uses the apply dot syntax, this switches on the argument list shape and dispatches direct calls. These compile to the CALL instruction cases with four arguments or less which will exercise funcall, funcall1, ... funcall4. Also, adding some missing test cases that probe behavior with excess arguments.
* awk: bug: fix ->> appending redirection operator.Kaz Kylheku2023-05-232-1/+43
| | | | | | | * stdlib/awk.tl (awk-state ensure-stream): Fix missing handling for the :apf kind symbol used by appending. * tests/015/awk-redir.tl: New file.
* awk: bug: broken redirection operators.Kaz Kylheku2023-05-231-2/+2
| | | | | | | * stdlib/awk.tl (sys:awk-redir): Fix regression from April 2018. The gensym variable introduced must be parallel bound, since it is referenced by the init expression of the other variable. This breaks all awk redirection operators.
* vm: handle cases in CALL like in GCALL.Kaz Kylheku2023-05-171-14/+58
| | | | | | | | * vm.c (vm_call): Specially handle the cases of 0 to 4 arguments, avoiding the general loop and invocation of generic_funcall. This gets us about a 1% improvement in recompiling the standard libarry (touch stdlib/*.tl; make).
* quips: reference to Super Dave Osborne.Kaz Kylheku2023-05-171-0/+1
| | | | * stdlib/quips.tl (%quips%): New entry.
* with-compile-options: reimplement using compiler-letKaz Kylheku2023-05-162-26/+64
| | | | | | | | | | | | | | | | | | | The with-compile-opts macro is rewritten such that it cad occur inside code that is being compiled, and change compiler options for individual subexpressions. It continues to work as before in scripted build steps such as when calls to (compile-file ...) are wrapped in it. However, for the time being, that now only works in interpreted code, because with this change, when a with-compile-opts form is compiled, it no longer arranges for the binding of *compile-opts* to be visible to the subforms; the binding affects the compiler's own environment. * stdlib/compiler.tl (with-compile-opts): Rewrite. * txr.1: Documented.
* New special operator: compiler-letKaz Kylheku2023-05-165-3/+87
| | | | | | | | | | | | | | | | | | | | | | * eval.c (compiler_let_s): New symbol variable. (op_let): Recognize compiler-let for sequential binding. (do_expand): Traverse and diagnose compiler-let form. (eval_init): Initialize compiler_let_s and register the interpreted version of the operator. * stdlib/compiler.tl (compiler compile): Handle compiler-let form. (compiler comp-compiler-let): New method. (no-dvbind-eval): New function. * autoload.c (compiler-set-entries): Intern the compiler-let symbol in the user package. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
* New special operator: progvKaz Kylheku2023-05-155-1/+185
| | | | | | | | | | | | | | | | | | | | | | Adding a progv operator, similar to the Common Lisp one. * eval.c (progv_s): New symbol variable. (op_progv): New static function. (do_expand): Recognize and traverse the progv form. (rt_progv): New static function: run-time support for compiled progv. (eval_init): Initialize progv_s, and register the the op_progv operator interpreting function. * stdlib/compilert (compiler compile): Handle progv operator ... (compiler comp-progv): ... via this new method. * tests/019/progv.tl: New file. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
* quips: piano-related quip.Kaz Kylheku2023-05-151-0/+1
| | | | * stdlib/quips.tl (%quips%): New entry.