summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* linenoise: bugfix: caret notation for NUL.Kaz Kylheku2019-02-051-2/+2
| | | | | | | * linenoise/linenoise.c (sync_data_to_buf): The null character appears from the stream as 0xDC00. We must test for that and render it as ^@, counting a a width of two, rather than sending it to the terminal, counting as width of 1.
* linenoise: bugfix: regression in mlmode line wrap.Kaz Kylheku2019-02-051-1/+6
| | | | | | | | | | | | | | | | | | | | | The following problem happens: when charaters are inserted past the end of the line such that it wraps, hitting backspace or any cursor movement causes a spurious scroll. This was caused on Nov 1 2018 by bf85503b (linenoise: avoid refresh for new text in multi-line mode). The reason is that the maxrows variable isn't updated when we trivially add a character without repainting. * linenoise/linenoise.c (lino state): Document special value for need_refresh: when it is 2, the refresh doesn't perform a any output, but recalculates maxrows. (refreh_multiline): If need_refresh is 2, bail after updating maxrows. (edit_insert): When trivially adding a character at the end and just outputting it, if in multi-line mode, set need_refresh to 2.
* sum and prod take keyfun argument.Kaz Kylheku2019-02-024-21/+66
| | | | | | | | | | | | | * eval.c (eval_init): Adjust registrations of sum and prod to be binary functions with an optional argument. * lib.c (nary_op_keyfun, sumv, prodv): New static functions. (sum, prod): Implement optional keyfun argument via sumv and prodv helpers. * lib.h (sum, prod): Declarations updated. * txr.1: Documentation updated.
* pattern lang: diagnose undefined function facing EOF.Kaz Kylheku2019-02-011-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses the following issue. Suppose the query is something like this: @abc @(nonexistent) and there is one line of data. In this case, there is no error about a nonexistent function. The function lookup fails in vertical mode, so horizontal mode fallback takes place. But that just concludes that there is no data, and reports a failed match. But the programmer might have intended to invoke some function or directive that doesn't need to match anything, but rather has an important effect. In this patch we fix that. As part of the change, we disallow functions from shadowing horizontal directives. * match.c (match_files): Do not look up sys:var and sys:text through the directive table, but check for these. If the directive is not found in the vertical table, check the horizontal table; if found there, don't try it as a function but go to horizontal processing. Then if the function lookup fails, we diagnose a failed lookup; don't fall through to horizontal processing.
* style: convert assignment to initialization.Kaz Kylheku2019-02-011-3/+1
| | | | | | * match.c (match_files): Change pointless two-step initialization of a variable by assignment into straight initialization.
* compiler: new dump-compiled-objects function.Kaz Kylheku2019-02-013-7/+124
| | | | | | | | | | | | | * lisplib.c (compiler_set_entries): Register dump-compiled-objects for auto-loading. * share/txr/stdlib/compiler.tl (usr:dmp-to-tlo): New function. (compile-file): Code to be shared with dump-compiled-objects moved into dump-to-tlo function. (usr:dump-compiled-objects): New function. * txr.1: Documented.
* doc: document string and bignum merging.Kaz Kylheku2019-01-311-0/+55
| | | | * txr.1: New section on Treatment of literals.
* compiler: de-dupe strings and bignum literals.Kaz Kylheku2019-01-311-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's squash duplicate strings and bignum integers in the virtual machine data tables. We can safely do it for these objects. For lists and vectors, things are tricky because these aggregates can contain circularity; so we leave those alone for now. Text processing code can generate a lot of duplicate strings. For instance `@a @b @c` generates three copies of the " " literal. * share/txr/stdlib/compiler.tl (*dedup*): New special variable. This is our de-dupe table, but it is globally nil, so that we don't retain cruft between compile jobs. (dedup): New function. (get-dreg): Map the incoming object through dedup. (dreg-key): New function. This converts a literal object to key for the dreg hash. Objects that can be de-duped represent themselves. Objects that cannot be de-duped are keyed by a gensym. (compiler get-dreg): Use dreg-key to reduce the incoming object to a key, and work with that, with the effect that strings, characters and numbers in the data table get de-duped: multiple occurrences of a character, string or number in the code get the same dreg. (usr:compile-toplevel, usr:with-compilation-unit): Establish a dedup hash for the dynamically enclosed compile job. If one is already established by the surroundign dynamic environment, then use that one, otherwise create a new hash.
* caseql: generate better code.Kaz Kylheku2019-01-301-9/+7
| | | | | | | | | | | * eval.c (me_case): Replace a code generation pattern of the (if (and x y) z) with the equivalent (and x y z). The motivation behind this is that it effectively coaxes a jump-threading optimization out of our simplistic compiler. The failure cases out of a single *and* all jump past the entire code block, whereas with the cascaded if + and we get a double test of the same failed value threading through two branches.
* Version 208.txr-208Kaz Kylheku2019-01-284-4/+28
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.
* @(next): Cover Lisp expressions with :nothrow.Kaz Kylheku2019-01-281-10/+57
| | | | | | | | | | | | | | We would like @(next (open-directory "nonexistent") :nothrow) to act as a failed match, rather than for the exception to propagate (and likely terminate TXR). The problem is that only file sources are treated with :nothrow. * match.c (tleval_nothrow, tleval_144_nothrow): New static functions. (v_next_impl): Use tleval_nothrow for all Lisp evaluation. If nothrow is requested and Lisp evaluation returns the colon symbol (which tleval_nothrow produces in the case of an exception), then treat the situation as a failed match.
* @(next): Diagnose source combined with source-giving option.Kaz Kylheku2019-01-281-3/+3
| | | | | | | | * match.c (v_next_impl): The check against the presence of multiple of source-specifying keyword options must also consider the base source as part of the mutual exclusion, so that syntax like @(next "file" :string "str") is also ruled out.
* @(next): bugfix: nothrow not causing failed match.Kaz Kylheku2019-01-281-6/+14
| | | | | | | | | | * match.c (v_next_impl): Contrary to the documentation and to "classic" TXR behavior exhibited in compatibility mode, when @(next "file" :nothrow) fails to open "file", it treats the situation as a cue to read from standard input, rather than to treat the situation as a failed match. This is because complex_open returns nil, and when that is passed to lazy_stream_cons, that function defaults to standard input.
* command line: support -f in Hash Bang Null Hack.Kaz Kylheku2019-01-282-3/+63
| | | | | | | | | | | | * txr.c (txr_main): In processing the -f option, if there is already an input source, but its name exactly matches the argument of the -f option, then ignore the -f and its option intead of terminating with a diagnostic. This allows the user to use -f in the Null Hack to achieve the usual trick of allowing the script to take options passed through to the interpreter. * txr.1: Documented.
* command line: improve -c option diagnostic.Kaz Kylheku2019-01-281-2/+2
| | | | | | | * txr.c (txr_main): Fix misleading message formatting here. The spec_file string is irrelevant; we must show the argument to -c which is in arg. The name of the input source is spec_file_str; let's show that.
* command line: better diagnosis for --args and --eargsKaz Kylheku2019-01-281-3/+15
| | | | | | | | | * txr.c (txr_main): Diagnose accurately when --args or --eargs is specified without any of the required trailing syntax, instead of complaining about --args or --eargs being an unknown option. Also, fix the error message about --eargs not having an argument, such that it doesn't insinuate that there exists an --eargs=value syntax.
* copy-hash: showstopper: seed must be copied.Kaz Kylheku2019-01-281-0/+1
| | | | | | * hash.c (copy_hash): Fix failure to initialize seed member in the duplicated hash structure. This regression was introduced along with seeded hashing.
* Version 207.txr-207Kaz Kylheku2019-01-264-5/+23
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.
* configure: problems with 128 bit integer detection.Kaz Kylheku2019-01-262-12/+13
| | | | | | | | | | | * configure: we can't assume that we can just edit "int" to "uint" in forming the superulong_t type. Let's consolidate the detection of the signed and unsigned superlong. Only if both are available, then emit material into config.h, along with a single constant: HAVE_SUPERLONG_T. * mpi/mpi-types.h: Don't refer to removed HAVE_USUPERLONG_T. Change superulong_t to usuperlong_t.
* disassemble: tidier data table.Kaz Kylheku2019-01-261-1/+1
| | | | | | * share/txr/stdlib/asm.tl (dissassemble-cdf): Print the rows of the data table with simple numeric offsets, with no d prefix or leading zeros.
* streams: use Boolean return value for stdio_fseek.Kaz Kylheku2019-01-253-6/+5
| | | | | | | | | | | | | | * stream.c (stdio_seek): Handle new-style Boolean return from stdio_fseek. * sysif.c (stdio_fseek): Return an int indication that is 1 for success, 0 for failure. There was a mistaken assumption here that fseeko returns the file offset, and the return value in the fseek case was mistakenly harmonized, using a wasteful call to stdio_ftell. The only call to this function relies only on a Boolean success/fail indication. * sysif.h (stdio_fseek): Declaration updated.
* install: broken when using separate build dir.Kaz Kylheku2019-01-251-2/+1
| | | | | | | | * Makefile (install): Drop the $(top_srcdir) prefix from share/txr/stdlib materials. This fails for the .tlo files which are only found in the build directory, not the source directory. The .txr and .tl files are found in both, thanks to symlinks; for those it works either way.
* mul: add forgotten MPI error check.Kaz Kylheku2019-01-251-1/+4
| | | | | | * arith.c (mul): In code that is only compiled when HAVE_DOUBLE_INTPTR_T is missing/zero, we need to test the return value of MPI's mp_mul.
* sysif: take advantage of i64_t in off_t handling.Kaz Kylheku2019-01-251-10/+4
| | | | | | * sysif.c (num_off_t): Remove #ifdef here and just use num_64 if off_t fits into 64 bits. Now this code compiles even if HAVE_DOUBLE_INTPTR_T is missing.
* ffi: use enhanced 64 bit support in itypes.c.Kaz Kylheku2019-01-251-155/+24
| | | | | | | | | * ffi.c (ffi_be_i64_put, ffi_be_i64_get, ffi_be_u64_put, ffi_be_u64_get, ffe_le_i64_put, ffi_le_i64_get, ffi_le_u64_put, ffi_le_u64_get): Functions simplified by using u64_t and i64_t types and functions from itypes.c. Conditional compilation and range tests are no longer required.
* itypes: take advantage of double_intptr_t.Kaz Kylheku2019-01-252-1/+54
| | | | | | | | | | | | | | | | | If double_intptr_t is at least 64 bits wide (which is always going to be true) we can take advantage of it. * itypes.c (c_i64, c_u64): Provide implementations that use the new dbl_intptr_t and dbl_uintptr_t infrastructure. The fallback implementation that uses ash and logior is basically not used now. (num_64, unum_64): New functions for obtaining a Lisp value from a 64 bit number, abstracting whether this is done via the cnum or dbl_cnum route. * itypes.h (u64_t, i64_t): Define in terms of double_uintptr_t and double_intptr_t, if no other 64 bit type is available. (num_64, unum_64): Declared.
* Extend infrastructure for double_intptr_t.Kaz Kylheku2019-01-256-1/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We support an unsigned version of the type, and add functions for converting between Lisp values and both types. * arith.c (bignum_dbl_uipt): New function, unsigned companion to existing bignum_dbl_ipt. (c_dbl_num, c_dbl_unum): New functions. * arith.h (bignum_dbl_uipt, c_dbl_num, c_dbl_unum): Declared. * configure (superulong_t, SIZEOF_DOUBLE_INTPTR, DOUBLE_INTPTR_MAX, DOUBLE_INTPTR_MIN, DOUBLE_UINTPTR_MAX, double_uintptr_t): New definitions going into config.h. * lib.h (dbl_cnum, dbl_ucnum): New typedefs: double-sized analogs of cnum and ucnum. * mpi/mpi.c (mp_set_double_uintptr, mp_get_double_uintptr, mp_get_double_intptr): New functions. (s_mp_in_big_range): New static function. (mp_in_double_intptr_range, mp_in_double_uintptr_range): New functions. * mpi/mpi.h (mp_set_double_uintptr, mp_get_double_intptr, mp_get_double_uintptr, mp_in_double_intptr_range, mp_in_double_uintptr_range): Declared.
* Provide faster bignum-in-fixed-integer range tests in MPI.Kaz Kylheku2019-01-254-40/+37
| | | | | | | | | | | | | | | | | | | | | | | * mpi/mpi.c (mp_in_range, mp_in_intptr_range, mp_in_uintptr_range): New functions. * mpi/mpi.h (mp_in_range, mp_in_intptr_range, mp_in_uintptr_range): Declared. * arith.c (NUM_MAX_MP, INT_PTR_MAX_MP, UINT_PTR_MAX_MP, INT_PTR_MAX_SUCC_MP): Static variables removed. Note that INT_PTR_MAX_MP was not used at all! (normalize): Use mp_in_range instead magnitude comparison to NUM_MAX_MP. (in_int_ptr_range, in_uint_ptr_range): Static functions removed. (c_unum): Use mp_in_uintptr_range instead of in_uint_ptr_range. (arith_init): Remove initializations of removed variables. (arith_free_all): Remove cleanup of removed variables, leaving function empty. * lib.c (c_num): Use mp_in_intptr_range instead of in_int_ptr_range.
* lib: revise wording of integer range errors.Kaz Kylheku2019-01-242-8/+10
| | | | | | | | * arith.c (c_unum): Fix misleading error message, and instead specify the range that was violated. * lib.c (c_num): Similar change: don't refer to a 'cnum range' which means nothing to the user.
* ffi: fix range checks in be/le i64 put ops.Kaz Kylheku2019-01-241-4/+4
| | | | | | | | | * ffi.c (ffi_be_i64_put, ffi_le_i64_put): Fix incorrect range check, causing most negative two values to be rejected. The aim here is to accept the #x-80..00 most negative two's complement value. We can't express that directly using the C expression -0x8000000000000000 because it's not a simple constant; it's the unary minus applied an unsigned number.
* ffi: incorrect big endian int64 get.Kaz Kylheku2019-01-241-2/+2
| | | | | * ffi.c (ffi_le_i64_get): Fix wrong array indices, causing lower half of 64 bit word to be taken as the upper half.
* ffi: almost bug: 64 bit signed big/little endian type.Kaz Kylheku2019-01-231-4/+4
| | | | | | | | | | | | | | * ffi.c (ffi_be_i64_get, ffi_le_i64_get): The code here for 32 bit platforms is fishy: it is using the signed cnum type for the low 32 bits, when that should be ucnum. We are actually okay because ths code would only be executed on a platform where cnum is 32 bits. We are saved by the fact that we are doing left shifts (no sign extension), that shifting a 1 into a sign bit is harmless on two's complement machines, and that the lo32 value is ultimately passed to unum whereby it is coerced to a ucnum argument type (which preserves the bit representation) and prevents logior from seeing a negative value.
* Fix some instances of 4 bytes = 32 bits assumption.Kaz Kylheku2019-01-237-42/+48
| | | | | | | | | | | | | | | | | * hash.c (equal_hash, eql_hash, cobj_eq_hash_op, hash_hash_op): Multiply object size by CHAR_BIT and switch on number of bits, rather than bytes. * sysif.c (off_t_num): Likewise. * arith.c, ffi.c, itypes.c, rand.c: In numerous #if directive, fix size tests from bytes to bits. * configure: in the test that detects integer types, and in the test for enabling large file offsets, detect one more variable from the system: the value of CHAR_BIT. This turns into SIZEOF_BYTE. We use that value instead of a hard-coded 8.
* sysif: use double-intptr function from arith.Kaz Kylheku2019-01-233-5/+6
| | | | | | | | | | | * arith.c (bignum_dbl_ipt): Change internal function to external linkage. * arith.h (bignum_dbl_ipt): Conditionally declared. * sysif.c (num_off_t): Use bignum_dbl_ipt instead of open-coding exactly the same thing that bignum_dbl_ipt does. Abort is changed to same internal_error as in off_t_num.
* sysif: remove low-level MPI code for off_t conversion.Kaz Kylheku2019-01-232-50/+12
| | | | | | | | | | | * sysif.c (off_t_num): Retarget to just use c_i32 or c_i64 from ctypes.c, depending on which of these types is the same width as off_t. (stdio_fseek): Pass identifying "self" string to off_t_num. Don't use off_t_num for fseek's offset argument which is of type long; for that we can use c_long from ctypes.c. * sysif.h (off_t_num): Declaration updated.
* mpi: put access macros into mp_ namespaceKaz Kylheku2019-01-225-26/+34
| | | | | | | | | | | | | | | | | | * mpi/mpi.h (mp_sign, mp_isneg, mp_used, mp_alloc, mp_digits, mp_digit): New macros, based on renaming SIGN, ISNEG, USED, ALLOC, DIGITS and DIGIT. (mp_set_prec): Use mp_digits instead of DIGITS. * mpi/mpi.c (SIGN, ISNEG, USED, ALLOC, DIGITS, DIGIT): Macros defined here now, as local aliases for their namespaced counterparts. * arith.c (signum, floordiv): Replace ISNEG with mp_isneg. * rand.c (random): Replace ISNEG with mp_isneg. * sysif.c (off_t_num): Replace USED, DIGITS and ISNEG with mp_used, mp_digits and mp_isneg.
* doc: review of Lisp CompilationKaz Kylheku2019-01-201-3/+14
| | | | | | | | * txr.1: eval mistakenly referred to instead of compile-file under Compile File. Spurious pluralization of literals fixed. New "Bound symbols in dwim" heading to separate text from discussion of unbound symbols in dwim. Clarifying text added about compile-toplevel's treatment of form.
* Version 206.txr-206Kaz Kylheku2019-01-186-186/+206
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* mpi: some params should be mp_size, not mp_digit.Kaz Kylheku2019-01-182-9/+9
| | | | | | | | | * mpi/mpi.c (s_mp_2expt, mp_trunc_comp, mp_trunc, mp_bit): Arguments that give a number of bits or bit position should be mp_size; they are not related to digit values. * mpi/mpi.h (mp_trunc_comp, mp_trunc, mp_bit): Declaration updated.
* mpi: remove unused mplogic module.Kaz Kylheku2019-01-181-1/+1
| | | | * Makefile (MPI_OBJ_BASE): remove mplogic.o.
* mpi: hardening; bug found.Kaz Kylheku2019-01-184-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The flaw in the rand function caused by mp_count_ones is serious. For instance calls to (rand 3000000000) are expected to produce evenly distributed values in the range zero to one less than 3 billion. Due to this flaw, only values in the range [0, 2147483648) are produced. The function is wrongly informed that 3000000000 is a power of two, and so it subtracts one from the number of bits needed for the clamping bit mask, causing raw random values to be clamped to 31 bits instead of 32. * arith.c (logcount): Use mp_err to capture return value from mp_count_ones, rather than mp_size. If the result is less than zero, throw an internal error. (The only non-internal error indication that could come from this function is a memory allocation, and we already use chk_malloc under MPI). * mpi/mpi.c (mp_count_ones): Switch return type to mp_err, because this function returns error codes, which are negative. (mp_is_pow_two): Fix broken test that is always true. This affects our random number module; it's used in the random function for bignum moduli. (mp_toradix_case): Use unsigned char temporary for exchanging two unsigned chars, rather than a char temporary. (s_mp_div_d): Assert that the partial quotient t and remainder w, of mp_word_type, have values that fit into the mp_digit variables to which they are being assigned. (s_mp_ispow2d): The result of s_highest_bit(d) is unsigned, so if we subtract 1 from 0, we create a large value which likely converts to -1. Let's ensure that clearly with a cast to (int) of the return value. * mpi/mpi.h (mp_count_ones): Declaration updated. * mpi/mplogic.c (mpl_rsh, mpl_lsh): Fix two places where we shift the constant 1 (of type int) left by a number of bits that can exceed the type int. Note, that these functions are currently not called anywhere in TXR.
* mpi: use wchar_t string for text-to-bignum.Kaz Kylheku2019-01-183-8/+5
| | | | | | | | | | | | | * mpi/mpi.c (mp_read_radix): Take const wchar_t * string rather than unsigned char *. (s_mp_tovalue): Take character argument as wchar_t rather than int. * mpi/mpi.h (mp_read_radix): Declaration updated. * lib.c (int_str): Avoid a malloc/free and UTF-8 conversion by passing the original wide string to mp_read_radix. This removes a TODO dating back to December 2011.
* int-flo: take advantage of unsigned range.Kaz Kylheku2019-01-181-0/+3
| | | | | | | | * arith.c (int_flo): If the floating point value is in the ucnum range, we can convert to integer by way of that type; we gain a little bit of range. For instance on 32 bits, floating values in the range 2147483648.0 to 4294967295.0 can be converted via the fast path.
* configure: improvements related to int_ptr_t.Kaz Kylheku2019-01-181-9/+3
| | | | | | | | | | | | | | * configure: We remove the uintptr variable and do not generate the HAVE_UINTPTR_T constant in config.h. This is always 1, and not actually tested anywhere. In situations when uintptr is not established, intptr is also not established and the configure script fails. We simply assume that for whatever type we detect as inptr_t, we can derive the unsigned type. (INT_PTR_MAX): We define this a bit differently; instead of interpolating into the expression the underlying C type, we use the int_ptr_t typedef that the previous lines of config.h establish. (UINT_PTR_MAX): New constant introduced in config.h.
* int-flo: fix always-false test.Kaz Kylheku2019-01-181-1/+1
| | | | | | | | * arith.c (int_flo): Fix reversed inequality tests which cause the test to be always false. This always false test prevents use of the faster code path for converting floating-point point values that are in range of the cptr type.
* Fix bug in bignum single-digit addition.Kaz Kylheku2019-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sigh; this is a continuation of the same topic that was addressed in November 14, 2016: "Fix bug in bignum addition". Commit SHA: c30a96120f53b960db56bc05a7ce6310bb2528f5. Though I fixed s_mp_add, s_mp_add_d has the same problem. Two digit-sized quantities are added together in the digit-sized type, and so the CARRYOUT(w) from the result is always zero. This bug causes the following consequences (using behavior under 32 bit as an example): 1. Wrong arithmetic: (succ (pred (expt 2 32)) -> 0 2. Wrong conversion from decimal: 4294967296 -> 0 4294967297 -> 1 4294967298 -> 2 4294967299 -> 3 As well as all values that begin with the above digit sequences. 4. Wrong conversion from floating-point. (toint 4294967296.0) -> 0 * mpi/mpi.c (s_mp_add_d): Add missing cast to the initial addition that adds the incoming digit d to the least significant limb of the bignum, so that the addition is done in the wider mp_word type, allowing CARRYOUT(w) to calculate a nonzero k value.
* carray: fix vec/list conversion bug.Kaz Kylheku2019-01-172-13/+31
| | | | | | | | | | | | | | | | | | | | If a zero-length carray is converted with vec-carray or list-carray and the null-term-p argument is t, there is an exception about a negative index. An empty vector or list should be returned in this case, and the documentation says exactly that. Also, if a carray of unknown length is converted, there is an exception from vec-carray, as documented, but it's an uninformative one that is incidentally produced when -1 is passed to the vec function. The list-carray just returns nil, contravening the documentation. * ffi.c (vec_carray, list_carray): Fix the problems described above. * txr.1: Reviewing the documentation for these functions, an improperly terminated sentence was found.
* Copyright year bump 2019.Kaz Kylheku2019-01-16107-108/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * LICENSE, LICENSE-CYG, METALICENSE, Makefile, args.c, args.h, arith.c, arith.h, buf.c, buf.h, cadr.c, cadr.h, combi.c, combi.h, configure, debug.c, debug.h, eval.c, eval.h, ffi.c, ffi.h, filter.c, filter.h, ftw.h, gc.c, gc.h, glob.c, glob.h, hash.c, hash.h, itypes.c, itypes.h, jmp.S, lib.c, lib.h, lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h, parser.l, parser.y, protsym.c, rand.c, rand.h, regex.c, regex.h, share/txr/stdlib/asm.tl, share/txr/stdlib/awk.tl, share/txr/stdlib/build.tl, share/txr/stdlib/cadr.tl, share/txr/stdlib/compiler.tl, share/txr/stdlib/conv.tl, share/txr/stdlib/doloop.tl, share/txr/stdlib/error.tl, share/txr/stdlib/except.tl, share/txr/stdlib/ffi.tl, share/txr/stdlib/getopts.tl, share/txr/stdlib/getput.tl, share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl, share/txr/stdlib/keyparams.tl, share/txr/stdlib/op.tl, share/txr/stdlib/package.tl, share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl, share/txr/stdlib/pmac.tl, share/txr/stdlib/socket.tl, share/txr/stdlib/stream-wrap.tl, share/txr/stdlib/struct.tl, share/txr/stdlib/tagbody.tl, share/txr/stdlib/termios.tl, share/txr/stdlib/trace.tl, share/txr/stdlib/txr-case.tl, share/txr/stdlib/type.tl, share/txr/stdlib/vm-param.tl, share/txr/stdlib/with-resources.tl, share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl, signal.c, signal.h, socket.c, socket.h, stream.c, stream.h, struct.c, struct.h, strudel.c, strudel.h, sysif.c, sysif.h, syslog.c, syslog.h, termios.c, termios.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h, vm.c, vm.h, vmop.h, win/cleansvg.txr: Extended Copyright line to 2018.
* doc: with-dyn-lib mention other deffi-* macros.Kaz Kylheku2019-01-161-4/+18
| | | | | * txr.1: with-dyn-lib relates not only to deffi but also deffi-var and deffi-sym.
* ffi: diagnose missing with-dyn-lib.Kaz Kylheku2019-01-161-24/+23
| | | | | | | | | | | | | | | If the programmer writes a deffi, deffi-sym or deffi-var that makes simple references, and that macro is not wrapped in with-dyn-lib, an unhelpful error message results about sys:ffi-lib being unbound. We can detect this situation and provide a warning. * share/txr/stdlib/ffi.tl (sys:with-dyn-lib-check, sys:expand-sym-ref): New functions. (deffi, deffi-sym, deffi-var): Capture environment parameter. Common code replaced by call to sys:expand-sym-ref, where the missing sys:ffi-lib situation is diagnosed. This is only done in cases when the simple reference syntax occurs.