summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* copy-file: fix unused warnings.Kaz Kylheku2023-03-211-13/+32
| | | | | | * stdlib/copy-file.tl (copy-files, copy-path-rec, remove-path-rec, chmod-rec, chown-rec): Fix instances of unused parameters.
* ignerr: fix unused warningKaz Kylheku2023-03-213-2/+11
| | | | | | | | | | | | | | | | | | | | The ignerr intrinsic macro generates code that has an unused variable. We fix it by turning it into a gensym, since unused warnings aren't generated for gensyms. * eval.c (unused_arg_s): New static variable. (me_ignerr): Use the value of unused_arg_s instead of error_s, for the argument of the catch clause. (eval_init): gc-protect unused_arg_s. (eval_late_init): New function in which we initialized unused_arg_s. The gensym function cannot be used during eval_init. * eval.h (eval_late_init): Declared. * lib.c (init): Call eval_late_init after some other late initializations.
* compiler: unused warnings in optimizer.Kaz Kylheku2023-03-211-62/+62
| | | | | | | | | | | | | | | | | | * stdlib/optimizer.tl (basic-block print): Suppress warning for pretty-p parameter using the use function. (basic-blocks (local-liveness, calc-liveness, thread-jumps-block, peephole-block, late-peephole, fill-treg-compacting-map), (basic-block apply-treg-compacting-map), dedup-labels): Fix unused variables in pattern, mostly by replacing them by @nil. (basic-blocks check-bypass-empty): Method moved, turned into (basic-block check-bypass-empty), losing the unused basic-blocks parameter. (basic-blocks elim-next-jump): Likewise moved into basic-block class. (basic-blocks elim-dead-code): Calls to check-bypass-empty and elim-next-jump adjusted.
* compiler: bug: unmatchable pattern in optimizer.Kaz Kylheku2023-03-211-1/+1
| | | | | | | | | | | This was uncovered by unused variable warnings. * stdlib/optimize.tl (basic-blocks peephole-block): The pattern trying to detect wasteful register moves is incorrect; the reg1 term is intended to be the @reg1 variable. It is matched literally and so will not match because the symbol reg1 does not literally occur in the VM code.
* compiler: fix remaining unused variable warningsKaz Kylheku2023-03-211-66/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have the t convention in macro parameters, we can use it to suppress many cases of unused variables in the compiler. * stdlib/compiler.tl (compiler (comp-setq, comp-lisp1-setq, comp-setqf, comp-cond, comp-ift, comp-switch, comp-unwind-protect, comp-return, comp-handler-bind, comp-catch, eliminate-frame, comp-lambda-impl, comp-fun, comp-or, comp-prog1, comp-arith-form, comp-arith-neg-form, comp-fun-form, comp-apply-call, comp-for, comp-tree-bind, comp-mac-param-bind, comp-mac-env-param-bind, comp-tree-case, comp-lisp1-value, comp-dwim, comp-prof, comp-load-time-lit), expand-quasi-mods, expand-dohash, expand-each, expand-defvar, expand-defun, expand-defmacro, expand-defsymacro, lambda-apply-transform, usr:compile): Fix unused variable warnings mostly by using the t mechanism in tree-case or mac-param-bind. In some cases, (use var) is used where it would be detrimental to diagnostic quality to replace identifiers in the pattern with t. A few unused "else" variables were renamed and used. (safe-const-reduce, ign-notfound): Fix unused exception clause unused parameters using (use param).
* time: crash: glibc overwrites time zone with literalKaz Kylheku2023-03-211-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | A crash occurs in the make_time_impl function whereby the mktime or timegm function invoked via the pmktime(&local) call overwrites the TIME_ZONE field with a string literal. We dynamically allocated that string and expect to free it in the time_fields_cleanup function. The solution is to wrap the struct tm structure with a container which separately tracks that pointer and frees that copy of it. * time.c (struct tm_wrap): New struct type. (time_fields_to_tm): Take a pointer to struct tm_wrap instead of struct_tm, and stash the timezone string in the wrapper. (time_fields_cleanup): Take a a pointer to struct tm_wrap and free the stashed pointer in the container, which is immune to TM_ZONE being altered. (time_struct_to_tm): Take pointer to tm_wrap because this calls time_fields_to_tm. (make_time_impl, time_string_meth, time_parse_meth): Use struct tm_wrap instead of struct tm.
* Allow t symbol in macro parameter lists.Kaz Kylheku2023-03-214-28/+80
| | | | | | | | | | | | | | | | | * eval.c (expand_params_rec, bind_macro_params): Handle t specially everywhere a parameter can occur. Expansion allows the syntax through without extending the environment with a t variable; binding walks over the structure without binding a variable. * stdlib/compiler.tl (expand-bind-mac-params): Likewise, handle occurrences of t, suppressing the generation of and assignment to variables, while ensuring that initializing expressions are evaluated. * tests/011/tree-bind.tl: New file. * txr.1: Documented.
* compiler: fix unused variable situationsKaz Kylheku2023-03-201-34/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We fix numerous unused variable situations uncovered by the new diagnostic. Most of those occurring inside tree-bind or mac-param-bind forms remain unfixed. These are caused by the idiom of binding a dummy variable as a placeholder in the structure. I am instead going to introduce a mechanism into tree-bind/mac-param-bind for indicating an ignored piece of structure. * stdlib/compiler.tl (compiler (comp-if, eliminate-frame, comp-lambda-impl, comp-typep, comp-fun-form, expand-and, reduce-or, compiler-emit-warnings, usr:compile with-compile-opts): Eliminate unused variables in structural pattern matches in various ways: eliminating predicate argument variables, replacing place holder variables by @nil, or just using the variables when possible. (compiler compile-in-toplevel): Remove unused saved-nlev variable. (compiler comp-atom): Use (use oreg) form to suppress unused parameter warning. (compiler comp-return-form): Eliminate unused binfo variable. The lookup-block method is called for the side effect of marking the block used, so we keep that call. (compiler comp-let): Unused variable specials is gone. (compiler comp-or): Unused variable lastfrag is gone, as is the assignment to it. There is a reason assignment isn't use! (compiler comp-inline-lambda): Get rid of the two variables called dummy by folding the associated calculation into an adjacent initform using progn and prog1. (comp-tree-case): Remove unused ncases, lerrtest and lnext variables. (safe-const-eval): Remove unused reduced-form variable, and simplify code, eliminating another local.
* compiler: recognize t as synonym for :warn.Kaz Kylheku2023-03-201-1/+1
| | | | | * stdlib/compiler.tl (opt-controlled-diag): If a the compiler option's value is t, treat it as :warn.
* compiler: source-loc propagation in tree-bind, lambdaKaz Kylheku2023-03-202-89/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unused variables in tree-bind forms are not generating diagnostics with source location info. We are missing some rlcp calls. * stdlib/compiler.tl (compiler comp-catch): The generated lambda here ends up transformed to a let by the lambda-apply-transfom function. We must propagate source info to it, otherwise unused catch clause parameters get diagnosed without it. (compiler (comp-for, comp-mac-param-bind, comp-mac-env-param-bind, comp-tree-case): Confer source location info onto the err-form argument of expand-bind-mac-params. (expand-bind-mac-params): Pass source location info from err-form onto the generated let* form. Thus, diagnostics related to variables in that let* get reported against that form's location. (lambda-apply-transform): Pass source location info from the lambda expression to the generated let. * stdlib/except.tl (usr:catch): Pass source loc info from each clause source code to the transformed clause. The transformed clause will turn into a lambda which will turn into a let in comp-catch, and then into a let in lambda-apply-transform.
* compiler: recognize use function as constant-foldableKaz Kylheku2023-03-201-1/+1
| | | | | * stdlib/constfun.tl (%const-foldable-funs%): use is a synonym of identity, which is listed; now use is also listed.
* compiler: implement unused warningKaz Kylheku2023-03-202-8/+21
| | | | | | | | | | | | | | | | * autoload.c (compiler_set_entries): Register slot symbol "unused". * stdlib/compiler.tl (compile-opts): New slot, unused. (%warning-syms%): List unused symbol. (env lookup-var): Support optional mark-used parameter, just like lookup-fun. (env unused-check): New method. (compiler comp-var): Pass t to mark-used parameter of lookup-var to register the use. (compiler (comp-let, comp-var)): Call unused-check method after sub-compilations are done to dump diagnostics about unused variables.
* compiler: compiler options mechanism.Kaz Kylheku2023-03-202-4/+71
| | | | | | | | | | | | | | | | | | | | | | | Introducing a compiler options system, so we can control diagnostics and such. We begin with three options for diagnosing shadowing. * autoload.c (compiler_set_entries): Register a structure name compiler-opts, a with-compile-opts function name, *compile-opts* variable name, and slots shadow-fun, shadow-var and shadow-cross. * stdlib/compiler.tl (compile-opts): New struct. (%warning-syms%): New macro. (*compile-opts*): New special variable. (when-opt, with-compile-opts): New macros. (opt-controlled-diag): New function. (env extend-var): Call extend-var* method instead of repeating code. (env extend-var*): Implement shadow-var and shadow-cross diagnostic options. (env extend-fun): Implement shadow-fun and shadow-cross diagnostic options.
* configure: note about ccname in --help text.Kaz Kylheku2023-03-191-1/+3
| | | | | * configure: add a note that the ccname variable is not used if the cc variable does not interpolate $(ccname).
* ffi: c++: several C-style casts have snuck inKaz Kylheku2023-02-281-4/+4
| | | | | | * ffi.c (make_ffi_type_struct, make_ffi_type_union, ffi_type_compile): Use convert macro instead of C cast notation.
* txr: bugfix, allow lazy lists in multi match.Kaz Kylheku2023-02-271-0/+1
| | | | | | | | | * match.c (do_match_line): Handle LCONS the same way as CONS. When a variable occurs whose value is a list of strings, that may be a lazy list. I ran into a problem using @(data x) to capture a list of strings, and then matching that with @x; the error being "unsupported object in spec", caused by the list's LCONS type not handled in this switch.
* New audio-related quip.Kaz Kylheku2023-02-211-0/+1
| | | | | | * stdlib/quips.tl (%quips%): New entry: what if we apply the concept of channel separation to audiophiles who hate each other's guts?
* Support gmtoff and zone in time formatting.Kaz Kylheku2023-02-131-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | The glibc strftime function can refer to the character string zone, and numeric zone via %Z and %z. So let us populate these from the Lisp structure. * time.c (time_fields_to_tm): Take gmtoff and zone arguments. Store these values in the struct tm, suitably converted, instead of zeros and nulls. In the case of zone, we dynamically allocate a utf-8 string, which will have to be freed. (time_fields_cleanup): New static function. Called to clean up any allocations performed by time_fields_to_tm. (time_struct_to_tm): Drop the strict parameter. This is useless because the underlying function time_fields_to_tm checks for nils and substitutes zeros. This silliness was introduced in a commit made in 2016. Extract the gmtoff and zone, passing these to time_fields_to_tm. (make_time_impl): Pass nil for gmtoff and zone, call time_fields_cleanup. (time_string_meth, time_parse_meth): No need to pass strict parameter to time_struct_to_tm. Need to call time_fields_cleanup.
* time: respect gmtoff in calculating numeric time.Kaz Kylheku2023-02-132-3/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have the following problem. On some platforms, the broken-down C time structure "struct tm" has a GMT offset field which gives the time zone of the specified time. In the Lisp structure, we call the corresponding slot gmtoff. This value should be taken into account when converting the broken-down time to a numeric time value. The underlying platform functions like mktime don't do this; they not only ignore the gmtoff, but in some cases clobber the field. The GNU C library version of the POSIX strptime function supports "%z" and "%Z" specifiers which populate the GMT offset. But then it gets wrongly ignored. Old/wrong behavior: 1> (time-parse-utc "%H:%M:%z" "00:00:+0900") 0 New behavior (on platforms with the GMT offset): 1> (time-parse-utc "%H:%M:%z" "00:00:+0900") 32400 * time.c (time_meth): If the Lisp time structure we are given specifies a non-nil gmtoff, then add its value to the returned result. (time_parse_local, time_parse_utc): If struct tm has a GMT offset, then we add its value to the time_t returned by mktime, timegm or timegm_hack. * txr.1: Updated.
* quips: new one about floating-point.Kaz Kylheku2023-02-081-0/+1
| | | | * stdlib/quips.tl (%quips%): New entry.
* bugfix: gc issue in parser interface.Kaz Kylheku2023-01-221-0/+2
| | | | | | | | | | | | | | * parser.c (lisp_parse_impl): Add a call to gc_hint, to protect the parser object from garbage collection. We allocate this object, and then use a raw pointer to the parser, which leaves it exposed. This resulted in a crash of the tests/010/json.tl test case (which runs with the --gc-debug mode). The crash doesn't occur in a regular build; it reproduced in build configured with --no-gen-gc. Possibly, why it doesn't repro under generational GC is that the hash table which associates streams and parsers may be moving the objects into the mature generation.
* fix --no-gen-gc configuration.Kaz Kylheku2023-01-203-4/+6
| | | | | | | | | | | | | | | | | | | This fixes only the build. I'm getting a crash in one test case, namely tests/010/json.tl. * lib.h (mut): Remove stray semicolon from definition. This semicolon compensates for the lack of a semicolon in txr.c, which becomes a syntax errror under no-gen-gc, when the other definition of mut is active. (mkloc, setcheck): Let's add casts of the object argument to void. This gets rid of a number of unused parameter errors in various functions that take an object parameter that is only used in the case of generational GC. * txr.c (txr_main): Add missing semicolon after mut call. * gc.c (gc_wrap): In the no CONFIG_GEN_GC case, cast argument full to void, since it is unused.
* fix --no-debug-support configuration.Kaz Kylheku2023-01-204-1/+10
| | | | | | | | | | | | | | | | * debug.h (debug_init): Define as ((void) 0) macro in the no debug support case. * unwind.h (uw_last_form_expanded): No-debug-support version must yield a value, not void. * unwind.c (ffcal_frame_type, eval_frame_type, expand_frame_type): Define only if CONFIG_DEBUG_SUPPORT is enabled, to suppress unused warnings. * eval.c (do_eval): Conditionally define debug-related code. The uw_push_eval function doesn't exist if CONFIG_DEBUG_SUPPORT isn't enabled.
* doc: * function not mentioned in heading.Kaz Kylheku2023-01-022-75/+75
| | | | | | | | | | | | * txr.1: The functions -, + and * are documented together, but the section heading only mentions + and -. This was introduced when these functions were documented for the first time in March 2012, in commit 6363875356bc050ef81d40553e573fc47aca2e28, and then went unnoticed for almost eleven years in spite of the heading undergoing relocation and reformatting. * stdlib/doc-syms.tl: Updated.
* doc: awk: mention res in clause descriptions.Kaz Kylheku2023-01-021-6/+14
| | | | | | * txr.1: In the description of the condition-action clause processing, mention the new res variable. Some additional improvements in neighboring text.
* Copyright year bump 2023.Kaz Kylheku2023-01-01136-138/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * LICENSE, LICENSE-CYG, METALICENSE, Makefile, alloca.h, args.c, args.h, arith.c, arith.h, autoload.c, autoload.h, buf.c, buf.h, cadr.c, cadr.h, chksum.c, chksum.h, chksums/crc32.c, chksums/crc32.h, combi.c, combi.h, configure, debug.c, debug.h, eval.c, eval.h, ffi.c, ffi.h, filter.c, filter.h, ftw.c, ftw.h, gc.c, gc.h, glob.c, glob.h, gzio.c, gzio.h, hash.c, hash.h, itypes.c, itypes.h, jmp.S, lex.yy.c.shipped, lib.c, lib.h, linenoise/linenoise.c, linenoise/linenoise.h, match.c, match.h, parser.c, parser.h, parser.l, parser.y, protsym.c, psquare.h, rand.c, rand.h, regex.c, regex.h, signal.c, signal.h, socket.c, socket.h, stdlib/arith-each.tl, stdlib/asm.tl, stdlib/awk.tl, stdlib/build.tl, stdlib/cadr.tl, stdlib/compiler.tl, stdlib/constfun.tl, stdlib/conv.tl, stdlib/copy-file.tl, stdlib/debugger.tl, stdlib/defset.tl, stdlib/doloop.tl, stdlib/each-prod.tl, stdlib/error.tl, stdlib/except.tl, stdlib/ffi.tl, stdlib/getopts.tl, stdlib/getput.tl, stdlib/hash.tl, stdlib/ifa.tl, stdlib/keyparams.tl, stdlib/match.tl, stdlib/op.tl, stdlib/optimize.tl, stdlib/package.tl, stdlib/param.tl, stdlib/path-test.tl, stdlib/pic.tl, stdlib/place.tl, stdlib/pmac.tl, stdlib/quips.tl, stdlib/save-exe.tl, stdlib/socket.tl, stdlib/stream-wrap.tl, stdlib/struct.tl, stdlib/tagbody.tl, stdlib/termios.tl, stdlib/trace.tl, stdlib/txr-case.tl, stdlib/type.tl, stdlib/vm-param.tl, stdlib/with-resources.tl, stdlib/with-stream.tl, stdlib/yield.tl, stream.c, stream.h, struct.c, struct.h, strudel.c, strudel.h, sysif.c, sysif.h, syslog.c, syslog.h, termios.c, termios.h, time.c, time.h, tree.c, tree.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h, vm.c, vm.h, vmop.h, win/cleansvg.txr, y.tab.c.shipped: Copyright year bumped to 2023.
* doc: fix date for 284 release.Kaz Kylheku2022-12-301-1/+1
| | | | * txr.1: Bump date to 2022-12-30.
* Version 284.txr-284Kaz Kylheku2022-12-307-1096/+1153
| | | | | | | | | | | | | | * 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.
* android, cygwin: do not try to test crypt.Kaz Kylheku2022-12-301-0/+3
| | | | | * tests/018/crypt.tl: Exit with successful termination status on Android or Cygwin.
* crypt: fix for platforms that lack crypt_r.Kaz Kylheku2022-12-302-1/+5
| | | | | | | | | | | | * sysif.c (crypt_wrap): Don't call free(cd) on platforms where we don't have crypt_r and have not defined the cd variable. * test/018/crypt.tl: Move the (crypt "a" "b") test case to be GNU/Linux-only. On Solaris, it yields a valid-looking hash instead of failing. That hash will not validate the password though; i.e. (crypt "a" (crypt "a" "b")) is not equal to (crypt "a" "b").
* doc: spurious plural in JSON section.Kaz Kylheku2022-12-301-1/+1
| | | | * txr.1: "in supports of" -> "in support of".
* doc: grammar under awk.Kaz Kylheku2022-12-301-1/+1
| | | | | * txr.1: Description of rng column in table is missing the verb "shows".
* doc: trim-left: don't document string case as fixed regexKaz Kylheku2022-12-301-2/+2
| | | | | * txr.1: Though it's not wrong, let's describe the string case as a fixed match without mentioning regex.
* doc: clarify @(repeat) is @(collect :vars nil)Kaz Kylheku2022-12-301-1/+11
| | | | | | * txr.1: When @(repeat) is first mentioned near the top of the @(collect) documentation, say right away what exactly it means.
* awk: new feature, res variable.Kaz Kylheku2022-12-305-2/+58
| | | | | | | | | | | | | | | | The res variable captures the specific value of the condition expression, making it available to the action. * autoload.c (awk_set_entries): Intern the res symbol * stdlib/awk.tl (awk): Instead of generating the condition-action into a simple when, we use whenlet to also bind the res variable. * tests/015/awk-res.tl: New file. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
* doc: consistency of condition-pattern term for awk.Kaz Kylheku2022-12-301-2/+2
| | | | | * txr.1: Fix instances of condition-pattern and condition-clauses to condition-action.
* doc: fix nonexistent macro name.Kaz Kylheku2022-12-302-2/+2
| | | | | | | * txr.1: *define-struct-prelude* should of course be define-struct-prelude. * stdlib/doc-syms.tl: Updated.
* doc: improve span-str, compl-span-str, break-strKaz Kylheku2022-12-101-0/+32
| | | | | * txr.1: document return value better for span-str and compl-span-str. Add examples for all three functions.
* doc: abc_function typo.Kaz Kylheku2022-12-101-1/+1
| | | | | * txr.1: In FFI-related example, a call to abc_function should just refer to function.
* quips: new one.Kaz Kylheku2022-12-101-0/+1
| | | | * stdlib/quips.tl (%quips%): New one about personality.
* compiler: runaway recursion in constant folding call.Kaz Kylheku2022-11-261-1/+4
| | | | | | | | | | | | | | | | | When an invalid call expression is constant folded, such as (call 'abs 1 2), runaway recursion occurs. This is because due to the wrong number of arguments being passed to abs, the safe-const-reduce function returns the expression unmodified. The comp-apply-call method then passes it to compile, wrongly assuming a reduction had taken place, and so everything repeats. * stdlib/compiler.tl (comp-apply-call): Detect when safe-const-reduce has hit a fixed point by returning the input form. In that case, we don't call the compiler top-level entry point, but the comp-fun-form method directly; the wrong function call will be compiled without constant folding and throw an error at run-time.
* compiler: bug: some functions mustn't be constant-foldedKaz Kylheku2022-11-251-5/+5
| | | | | | | | * stdlib/constfun.tl (%const-foldable-syms%): Removing the following functions, which cannot be constant folded because maybe are relied upon to produce fresh objects: cons, sub-list, conses, ldiff, uniq, tostring, tostringp, join, join-with.
* streams: fixes in few type error diagnostics.Kaz Kylheku2022-11-211-5/+7
| | | | | | | | | | | * stream.c (make_string_byte_input_stream, get_string_from_stream): Use self in diagnostic, and print bad object using ~s rather than ~a. (get_list_from_stream): Likewise, and add missing nao as well. (catenated_stream_push): Add self string, use in diagnostics, print bad object using ~s.
* expt: zero exponent yields 1.0.Kaz Kylheku2022-11-202-0/+9
| | | | | | | | * arith.c (expt): NUM-FLNUM, FLNUM-NUM and FLNUM-FLNUM cases ensure that if the expontent is zero, the return value is 1.0. Implementations of pow do this, but ISO C doesn't require it. * txr.1: Now documented.
* hash: floating: handle negative zero.Kaz Kylheku2022-11-201-3/+5
| | | | | | * hash.c (hash_double): If the input is equal to 0.0, return 0, so that both negative and positive zero have the same hash value.
* crypt: reduce ridiculous stack usage.Kaz Kylheku2022-11-171-4/+9
| | | | | | * sysif.c (crypt_wrap): Dynamically allocate struct crypt_data instead, because it's over 128K wide, resulting in a huge stack frame size.
* structs: use type-error rather than error.Kaz Kylheku2022-11-111-5/+5
| | | | | | | * struct.c (struct_handle, stype_handle_impl, struct_handle_for_slot, umethod_fun, umethod_args_fun): Throw type-error rather than error for the situation that an argument isn't a struct.
* read-once: support globals properly.Kaz Kylheku2022-11-103-15/+42
| | | | | | | | | | | | | | | | | | | | | | | | When a global variable v is wrapped with (read-once v), multiple accesses to the place still generate multiple accesses of the global through getv or getlx instructions. The reason is that the alet and slet macros optimize away a temporary bound to the value of a variable regardless of whether the variable is lexical. Let's fix that. * stdlib/place.tl (slet, alet): Replace the bindable test with lexical-var-p, in the given environment. A binding to a variable is only alias-like if the variable is lexical, otherwise we need a real temporary. * tests/012/struct.tl (get-current-menv): New macro. (menv): New global variable. Fix a number of tests which use expand, whose expansion has changed because the expressions refer to free variables. We introduce an environment parameter which binds all the variables, so that the optimized expansion is produced, as before. * txr.1: Updated documentation. slet gets examples.
* ftw: default flags to ftw-physKaz Kylheku2022-11-102-4/+24
| | | | | | | | | | | | | | | More often than not, you want the FTW_PHYS flag when calling the nftw function. Let's make that the default in TXR's wrapper. * ftw.c (ftw_wrap): Default to FTW_PHYS when flags argument not given, rather than zero, subject to compatibility option. (ftw_init): Don't check for FTW_PHYS with ifdef, since we relied on it being present. And anyway, any nftw implementation must have that. * txr.1: Documented.
* New feature: struct preludes.Kaz Kylheku2022-11-036-4/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | A struct prelude definition associates one or more future defstruct (by struct name) with clauses which are implicitly inserted into the defstruct. It is purely a macro-time construct, customizing the expansion behavior of defstruct. * stdlib/struct.tl (*struct-prelude, *struct-prelude-alists*): New special variables holding hash tables. (defstruct): Before processing slot-specs, augment it with the contents of the prelude definitions associated with this struct name. (define-struct-prelude): New macro. * autoload.c (struct_set_entries): define-struct-prelude is interned and triggers autoload of struct module. * tests/012/oop-prelude.tl: New file. * tests/012/oop-prelude.expected: Likewise. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.