summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Version 127.txr-127Kaz Kylheku2015-12-096-284/+330
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Solaris issue detecting ftello/fseeko.Kaz Kylheku2015-12-091-0/+4
| | | | | * configure: re-test for ftello with _LARGEFILE_SOURCE and add to lang_flags if that works.
* Solaris issue: ftruncate not detected.Kaz Kylheku2015-12-091-1/+1
| | | | * configure (lang_flags): Add POSIX_C_SOURCE set to 200112.
* Bugfix: crash in get_line.Kaz Kylheku2015-12-091-8/+6
| | | | | | | | | | | Incorrect, irrelevant handle test inside stdio_get_line virtual function fails to detect closed stream, leading to a null pointer passed to the stdio library. * stream.c (snarf_line): Rewrite according to pattern followed by the other functions. We must test h->f for null, not stream->co.handle, which never goes null until the object is being reclaimed by gc.
* Bugfix: incorrect less comparison for ranges.Kaz Kylheku2015-12-091-3/+12
| | | | | * lib.c (less): Missing test for equality before comparing to fields.
* defmeth returns compound method name.Kaz Kylheku2015-12-091-1/+1
| | | | | * share/txr/stdlib/struct.tl (sys:defmeth): Return compound method name as return value: (meth <type> <name>).
* Bugfix: ifa must allow dwim expressions.Kaz Kylheku2015-12-092-8/+25
| | | | | | | | * share/txr/stdlib/ifa.tl (ifa): Accept dwim expressions as the condition. Moreover, treat [f x] as a one-argument call, even though it is the two-argument form (dwim f x). * txr.1: Documented.
* Spacing around major headings early in doc.Kaz Kylheku2015-12-091-1/+2
| | | | * txr.1: Blank line before SYNOPSIS and DESCRIPTION.
* ifa documentation improvementKaz Kylheku2015-12-091-29/+82
| | | | | | | | * txr.1: The ifa rules are organized as numbered clauses. The definition of it-candidate is given up front. Rule 4 is corrected: the it variable is bound to the argument expression, not merely its value. Examples refer to rules and new ones added.
* Fix under ifa.Kaz Kylheku2015-12-081-9/+9
| | | | | * txr.1: Remove text fragment, and clarify treatment of not, null and false.
* Allow defmacros and defuns to co-exist.Kaz Kylheku2015-12-082-3/+14
| | | | | | | | | | | | | | | Already we have the situation that there is an if function and an if macro, and same for and and or. This change allows such situations to be programmer-defined. * eval.c (op_defun): Don't remhash the name from the toplevel macro bindings. (op-defmacro): Don't remhash the name from the toplevel function bindings. * txr.1: Document the permissive behavior as dialect notes under defmacro and defun.
* Adding mboundp and mmakunbound.Kaz Kylheku2015-12-082-3/+25
| | | | | | | | | * eval.c (mboundp, mmakunbound): New static functions. (eval_init): Registering mboundp and mmakunbound intrinsics. * txr.1: Documenting new functions. Also clarifying that fboundp checks for an operator macro binding (not a symbol macro binding).
* New function macro-ancestor.Kaz Kylheku2015-12-082-0/+19
| | | | | | | * eval.c (eval_init): Register lookup_origin as macro-ancestor intrinsic. * txr.1: Documented.
* Update under source-loc-str.Kaz Kylheku2015-12-081-8/+24
| | | | | * txr.1: formatting fix in syntax section. Added explanation that macro expansions inherit source loc info from expander.
* Documentation section restructuring.Kaz Kylheku2015-12-081-43/+47
| | | | | * txr.1: TXR pattern language condensed into fewer sections with deeper nesting. Some sections renamed.
* Clarifications under dwim operator.Kaz Kylheku2015-12-081-24/+46
|
* Remove opinion point of view.Kaz Kylheku2015-12-081-5/+2
| | | | | * txr.1: Under dwim operator, describe [...] notation without asserting that it is preferred.
* Fixes under Consecutive VariablesKaz Kylheku2015-12-081-7/+9
| | | | * txr.1: Tense agreement, clarification. Italicize de facto.
* Replace "discussed" with "described".Kaz Kylheku2015-12-081-13/+13
|
* Wording under sys:abscond-from.Kaz Kylheku2015-12-081-1/+1
| | | | * txr.1: replace colloquial word choice.
* Fix outdated references to .. denoting cons.Kaz Kylheku2015-12-081-14/+12
| | | | | * txr.1: Upgrade text under Callable Objects and Operator dwim.
* remove nonexistent function from synopsis.Kaz Kylheku2015-12-071-1/+1
| | | | | * txr.1: There is no such function as range-regst. This should be search-regst.
* range-regex returns range, not cons.Kaz Kylheku2015-12-073-7/+7
| | | | | | | | | | | * regex.c (range_regex): Return range. (search_regst): Use appropriate accessors on range returned by range_regex. * lib.c (tok_where): Destructure range returned by range_regex, using range_bind. * txr.1: Documented changed behavior.
* HTML doc: add doctype header and content-type.Kaz Kylheku2015-12-071-0/+2
|
* HTML doc: table of contents improvements.Kaz Kylheku2015-12-071-2/+54
| | | | | | * genman.txr: TOC extraction code renames Index to Contents, and adds expand/collapse links. Javascript added to handle expand/collapse.
* Large file support.Kaz Kylheku2015-12-044-11/+116
| | | | | | | | | | | | | | | | | | | | * stream.h (struct strm_ops): seek operation's second argument is now just a val. * stream.c (unimpl_seek, null_seek): Second argument is a val, not cnum, to conform with function pointer in stream structure. (stdio_seek): Accept offset as val, which could be a fixnum or bignum. Use new stdio_ftell and stdio_fseek functions so large values work. (seek_stream): No need to convert offset argument to cnum; pass the val directly to seek virtual function. * sysif.c (off_t_num, num_off_t, stdio_ftell, stdio_fseek): New functions. * sysif.h (OFF_T_MAX, OFF_T_MIN): New preprocessor symbols. (off_t_num, num_off_t, stdio_ftell, stdio_fseek): Declared.
* Configure for large file support.Kaz Kylheku2015-12-031-1/+70
| | | | | | | | | * configure (lang_flags): _XOPEN_SOURCE is bumped from 600 to 700 so that fseeko and ftello are revealed in <stdio.h> by glibc, and off_t is defined there too. New configure tests for fseeko/ftello and for detecting which macro, if any, do we add to lang_flags to enable large file support (64 bit off_t).
* Whitespace issue in configure.Kaz Kylheku2015-12-031-9/+9
| | | | * configure (read_syms): Fix bad indentation.
* static-slot-ensure always processes subtypes.Kaz Kylheku2015-12-012-49/+51
| | | | | | | | | | | * struct.c (static_slot_ensure): Restructured function so that the subtypes of stype are processed even if stype already has the static slot. This way static-slot-ensure can be used to overwrite a static slot value, not only establish one. And thus defmeth can redefine methods. * txr.1: Revamped static-slot-ensure doc, and added notes about redefining to defmeth.
* Bugfix: structs not inheriting late static slot values.Kaz Kylheku2015-12-012-6/+27
| | | | | | | | | | | | | | | | | | | | | | This bug doesn't affect static slots that are defined in defstruct, because those get initialized in the new type by the static init function. The bug is that the values of static slots added later with static_slot_ensure are not inherited by subtypes that are created later still. (Since static_slot_ensure propagates a slot to subtypes which already exist, those types get the slot value.) * struct.c (make_struct_type): Copy the contents of the static slot array of the supertype into the new type, so that static slot values are inherited. We can just use memcpy because the ordering of static slots is the same in the new type, and the inherited ones precede the new ones, due to the way the all_slots list is combined. * txr.1: Clarify inheritance of static slots.
* Resolve method name to supertype.Kaz Kylheku2015-12-011-1/+17
| | | | | | * struct.c (method_name): Don't return first match. Resolve to most ancestral superclass which has that function in the same slot.
* Suppress superfluous "located at" message.Kaz Kylheku2015-11-301-9/+5
| | | | | * eval.c (error_trace): Restructure loop. Suppress "which is located at" message in first iteration.
* Some missing exceptions to indentation rule.Kaz Kylheku2015-11-301-1/+2
| | | | | * genvim.txr: Indent new, lnew, meth, umeth and usel forms like function calls.
* defun can define methods.Kaz Kylheku2015-11-303-10/+49
| | | | | | | | | | | | * eval.c (op_defun): Handle (meth type name) syntax in place of name via sys:defmeth function, which is dynamically resolved and autoloaded as necessary. (builtin_reject_test): When defun is being checked, recognize a (method ...) form and allow it. * struct.h (meth_s): Declaration added. * txr.1: Documented new defun capability.
* Correct return value of defmeth.Kaz Kylheku2015-11-301-3/+4
| | | | | * share/txr/stdlib/struct.tl (defmeth): Return the symbol being defined.
* Refactor propagation of contexts in evaluator.Kaz Kylheku2015-11-304-63/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The context form arguments become just context objects in various places. When a context form is actually needed, or the context's symbolic name, they must be retrieved via functions applied to a context. * debug.c (debug): form argument is now a context. Use the ctx_form function to retrieve the form. * debug.h (debug_check): Rename form parameter to ctx. * eval.c (ctx_form, ctx_name): New functions. (eval_error): Leftmost parameter is a context now. Use ctx_form API to obtain the context form from this object, from which the source location info can then be retrieved as before. (abbrev_ctx): Function removed. (bind_args, bindings_helper, fbindings_helper): Convert ctx_form argument to ctx, and use the API to access name or form. (do_eval, do_eval_args, eval, eval_args_lisp1, eval_lisp1, eval_progn, eval_prog1): ctx_form param renamed to ctx. (funcall_interp): Pass the original interpreted function as the context to bind_args, not the extracted code. When ctx_name sees this object, it will compute the function name, which was not possible from the code being used as the context. This is the big reason for all these changes. * eval.h (eval_error): Declaration updated. (ctx_form, ctx_name): Declared.
* Drop ctx_form param on env_vbind_special and apply.Kaz Kylheku2015-11-303-26/+26
| | | | | | | | | | | | | | | | | * eval.c (env_vbind_special): Remove unused ctx_form parameter. (bind_args, bind_macro_params): Don't pass ctx_form to env_vbind_special. (apply): Remove unused ctx_form parameter. (apply_intrinsic, applyv, mapcarv, mappendv, lazy_mapcarv_func, mapdov, do_mapf): Don't pass nil third argument to apply. * eval.h (apply): Declaration updated. * lib.c (do_juxt): Do not bind third argument of apply to lin when currying; curry as two argument function. (do_not): Do not pass third nil argument to apply.
* Change funcall_interp API.Kaz Kylheku2015-11-303-9/+10
| | | | | | | | | | | | | | * eval.c (funcall_interp): Drop the env argument. The fun argument is now the whole function object, not the encapsulated code to be interpreted. We pull the environment and code out of the object locally and interpret as before. * eval.h (funcall_interp): Declaration updated. * lib.c (generic_funcall, funcall, funcall1, funcall2, * funcall3, funcall4): Calls to funcall_interp simplified, just passing fun.
* Rename interp_fun function.Kaz Kylheku2015-11-303-9/+9
| | | | | | | | | * eval.c (interp_fun): Function renamed to funcall_interp. * eval.h (interp_fun): Declaration updated. * lib.c (generic_funcall, funcall, funcall1, funcall2, funcall3, funcall4): Calls to interp_fun updated.
* func-get-name calculates a name for methods.Kaz Kylheku2015-11-304-19/+72
| | | | | | | | | | | | | | * eval.c (func_get_name): Use try to use new method_name function, if unable to get name from the lexical or global environment for functions. * struct.c (meth_s): New symbol variable. (struct_init): Initialize meth_s variable. (method_name): New function. * struct.h (method_name): Declared. * txr.1: Re-documented func-get-name.
* Version 126.txr-126Kaz Kylheku2015-11-296-516/+549
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Increase stack size on Windows.Kaz Kylheku2015-11-292-1/+17
| | | | | | | | | * Makefile: include CONF_LDFLAGS in LDFLAGS. * configure (conf_ldflags): New variable. (gen_config_make): Generate CONF_LDFLAGS make variable. New test which sets up conf_ldflags for a 16Mb stack size if we are on Cygwin or MinGW.
* Bugfix: split and partition again.Kaz Kylheku2015-11-291-2/+3
| | | | | | | | * lib.c (partition_split_common): nullify indices after calling function, because function can put out an empty sequence of non-list type. Use "not sequence" test rather than "atom" on final index list, so that vectors and strings can specify indices, as documented.
* Improve destructuring error messages.Kaz Kylheku2015-11-291-4/+4
| | | | | | | * eval.c (bind_macro_params): On mismatch between atom and param list, or insufficient parameters for list, report which params are mismatched. In a nested destructuring syntax, it is difficult to know.
* Bugfix: destructive behavior in transpose.Kaz Kylheku2015-11-281-1/+1
| | | | | | | | * lib.c (transpose): This function turns an input list into an argument list which ends up in an args structure, which potentially destroys it to prevent spurious retention. The list must be copied. We don't use copy-list because the function supports vectors.
* Error reports trace through layers of macroexpansion.Kaz Kylheku2015-11-284-60/+63
| | | | | | | | | | | | | | | | | | | | * eval.c (error_trace): New function. Consolidates error reporting between unhandled exception handling in uw_throw, and the catcher in the repl. (op_defmacro, expand_macrolet): Propagate location info from body to wrapping block, and to the macro binding. In the latter function, also to the body that is wrapped by local macros. (do_expand, macroexpand_1): Propagate location info from macro expander to expansion, only taking it from the form if the macro doesn't supply it. * eval.h (error_trace): Declared. * parser.c (repl): Replace error reporting code with call to error_trace. * unwind.c (uw_throw): uw_throw: likewise.
* Propagate location info in progn optimization.Kaz Kylheku2015-11-281-1/+1
| | | | * eval.c (maybe_progn): rlcp info to generated progn cons.
* Improve source loc copying in expand_qquote.Kaz Kylheku2015-11-281-5/+5
| | | | | | * eval.c (expand_qquote): Use rlcp_tree to propagate source location more completely. Also, it was missing in the quote case.
* Remove useless test from rlcp_tree.Kaz Kylheku2015-11-281-5/+4
| | | | | * parser.y (rlcp_tree): Remove redunant test, around the for loop, of a condition which is the same as its guard condition.
* WIP: fix erroneous use of rlcp that should be rl.Kaz Kylheku2015-11-261-8/+7
| | | | | * parser.y (hash, struct, range): Fix rlcp being wrongly used to copy nonexistent line number info from an integer.