summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ChangeLog fixup: "Version 106" missing.Kaz Kylheku2015-04-211-0/+2
|
* Version 106.txr-106Kaz Kylheku2015-04-215-4/+105
|
* Bugfix: throwing error when trying to print valid regexps.Kaz Kylheku2015-04-192-1/+9
| | | | | | * regex.c (print_rec): Only dianose "bad object in regex syntax" for some atom other than nil, which denotes an empty (sub)expression, like what results from #// or #/a|/ and such.
* Do not allow unrecognized escapes in regex.Kaz Kylheku2015-04-193-16/+46
| | | | | | | | | | | | * parser.l (REGOP): New regex alias for matching all regex special characters. (grammar): Several rules for regex special characters merged together. New rule introduced to match a special character after a backslash, making it literal. The old rule which makes literal any character after a backslash now throws an error, unless version 105 comaptibility is selected. * txr.1: Documented this behavior change.
* Improvement in error reporting.Kaz Kylheku2015-04-192-15/+24
| | | | | | | | | | | | This fix prevents certain situations when an inappropriate form is reported, in the default unhandled exception handler, as pertaining to an error. * eval.c (do_eval): Save and restore the last_form_evaled, in an exception-unsafe way. If we successfully evaluate a form or subform, we can restore the previous one. (expand): Save and restore last_form_expanded similarly. We don't need the unwind block and counter.
* Adding lcons macro.Kaz Kylheku2015-04-185-217/+308
| | | | | | | | | * eval.c (me_lcons): New function. (eval_init): Registered lcons macro. * txr.1: Documented lcons. * tl.vim, txr.vim: Regenerated.
* Adding getenv, setenv and unsetenv.Kaz Kylheku2015-04-187-262/+380
| | | | | | | | | | | | | | * lib.c (setenv, unsetenv): Changed static functions to external. Moved them out of the #if !HAVE_TIMEGM block. * lib.h (setenv, unsetenv): Declared. * sysif.c (getenv_wrap, setenv_wrap, unsetenv_wrap): New functions. (sysif_init): Registered getenv, setenv and unsetenv. * txr.1: Documented getenv, setenv and unsetenv. * tl.vim, txr.vim: Regenerated.
* Fix quasistring regression introduced in TXR 81.Kaz Kylheku2015-04-182-0/+26
| | | | | | | | * parser.y (expand_meta): This function must recognize quasistrings, inside (sys:quasi ...) forms, (sys:var ...) forms do not denote TXR Lisp variables. These must not be expanded. Doing so is not only wrong, but the way it was done broke brace variables by stripping their arguments.
* Adding exit* function which calls _exit.Kaz Kylheku2015-04-165-280/+331
| | | | | | | | | * sysif.c (exit_star_wrap): New static function. (sysif_init): Registered exit* intrinsic. * txr.1: Documented exit*. * tl.vim, txr.vim: Regenerated.
* * txr.1: Fixed inconsistency in style of some function headings.Kaz Kylheku2015-04-161-6/+6
|
* Add exec and pipe functions.Kaz Kylheku2015-04-166-282/+393
| | | | | | | | | | | * configure: Check for pipe. * sysif.c (exec_wrap, pipe_wrap): New static functions. (sysif_init): Register exec and pipe intrinsics. * txr.1: Documented exec and pipe. * tl.vim, txr.vim: Regenerated.
* Adding chmod.Kaz Kylheku2015-04-166-320/+412
| | | | | | | | | | | * configure: Detect chmod. * sysif.c (chmod_wrap): New function. (sysif_init): Register chmod intrinsic. * txr.1: Documented. * tl.vim, txr.vim: Regenerated.
* * txr.1: Moving Unix-specific material to appropriate sections.Kaz Kylheku2015-04-161-131/+134
|
* Adding dotimes macro.Kaz Kylheku2015-04-163-0/+71
| | | | | | | * eval.c (me_dotimes): New function. (eval_init): Registering dotimes macro. * txr.1: Documented dotimes.
* Fix escaping issues in open-process on Windows.Kaz Kylheku2015-04-152-12/+64
| | | | | | | | | | | | | | | This can now execute programs with spaces in their path names. Arguments can contain embedded double quotes, and other characters that are special to cmd.exe, like &, |, (, ), ^ and others. * stream.c (string_extend_count, win_escape_cmd): New static functions. (win_escape_arg): Fix and extend escaping scheme to cover not only the argument processing scheme implemented by programs which use Microsoft's C library, but also to smuggle the command line through cmd.exe. (win_make_cmdline): Use win_escape_cmd to wrap the command. Escape the quotes which are placed around arguments, so cmd.exe doesn't interpret them, which will cause it to suppress its processing of the caret escapes.
* Allow quasiquotes in braces and quasiliterals, and quotes in braces.Kaz Kylheku2015-04-153-6/+14
| | | | | | | | | * parser.l: Consolidate rules for recognizing quote, unquote, and quasiquote. An effect of this is that quasiquotes can now occur in braces and in string quasiliterals. * parser.y (quasi_item): Support quotes and quasiquotes as quasi items: that is to say, i.e. objects denoted by @ in a quasiliteral.
* Diagnose trailing junk in numeric literals.Kaz Kylheku2015-04-142-14/+28
| | | | | | | * parser.l: Combining the handling of hex, octal and binary numeric literals into a single rule. Implementing an additional rule which diagnoses such tokens that have trailing junk. Thus, something like #x1F2AZ is now invalid syntax.
* Implementing while* and until* loops.Kaz Kylheku2015-04-115-21/+90
| | | | | | | | | | | * eval.c (while_star_s, until_star_s): New symbol variables. (me_while_star, me_until_star): New static functions. (eval_init): Initialize new variables. Register while* and until* macros. * txr.1: Documented while* and until*. * txr.vim, tl.vim: Regenerated.
* * txr.1: Add powerset example under comb functionKaz Kylheku2015-04-111-0/+10
|
* * sysif.c: Use HAVE_FORK_STUFF to wrap fork, waitpid and dup/dup2.Kaz Kylheku2015-04-112-2/+6
|
* Exposing dup and dup2.Kaz Kylheku2015-04-115-288/+323
| | | | | | | | | | * sysif.c (dup_wrap): New static function. (sysif_init): Register dup_wrap as dupfd. The name dup conflicts with an existing function. * txr.1: Documented dupfd. * txr.vim, tl.vim: Regenerated.
* Functions open-fileno and fileno.Kaz Kylheku2015-04-106-1/+84
| | | | | | | | | | | | | | | | * stream.c (fd_k): New keyword variable. (stdio_get_prop): Handle the :fd property by returning the file descriptor. (open_fileno): New function. (stream_init): Initialize fd_k, and register fileno and open-fileno. * stream.h (open_fileno): Declared. * txr.1: Documented open-fileno and fileno. * utf8.c (w_fdopen): New function. * utf8.h (w_fdopen): Declared.
* * gc.c (sweep): Fix comment referring to nonexistent identifier.Kaz Kylheku2015-04-102-1/+5
|
* * eval.c (eval_init): There is an until_s global variable, soKaz Kylheku2015-04-102-1/+6
| | | | no need to intern the symbol when registering me_until.
* * txr.1: Flurry of formatting fixes.Kaz Kylheku2015-04-091-6/+6
|
* Fork and wait support.Kaz Kylheku2015-04-095-258/+510
| | | | | | | | | | | | | | * sysif.c (work_wrap, wait_wrap, wifexited, wexitstatus, wifsignaled, wtermsig, wcoredump, wifstopped, wstopsig, wifcontinued): New static functions. (sysif_init): Register new intrinsics: functions fork, wait, w-ifexited, w-exitstatus, w-ifsignaled, w-termsig, w-coredump, w-ifstopped, w-stopsig, w-ifcontinued; and variables w-nohang, w-untraced, w-continued. * txr.1: Documented. * tl.vim, txr.vim: Regenerated.
* * eval.c (iflet_s, when_s): New global variables.Kaz Kylheku2015-04-065-224/+335
| | | | | | | | | | | (me_iflet_whenlet): New static function. (eval_init): Initialize when_s, iflet_s. Use when_s for registering me_when. Register me_iflet_whenlet. * txr.1: Documented iflet and whenlet. * tl.vim, txr.vim: Regenerated.
* Move documentation of macros from between cond and if.Kaz Kylheku2015-04-061-139/+138
| | | | | | * txr.1: move the documentation of some control and iterative macros from between if and cond to after the control constructs.
* * txr.1: formatting fix in pos-min/pos-max.Kaz Kylheku2015-04-061-2/+2
|
* New whilet macro.Kaz Kylheku2015-04-055-28/+125
| | | | | | | | | | | * eval.c (while_s): New symbol variable. (me_whilet): New static function. (eval_init): Initialize while_s. Use while_s in registration of while macro. Register new whilet macro. * txr.1: whilet is documented. * tl.vim, txr.vim: Regenerated.
* * txr.1: Formatting issue in for/for* syntax.Kaz Kylheku2015-04-041-4/+4
|
* New zap operator.Kaz Kylheku2015-04-013-2/+40
| | | | | | | | * eval.c (zap_s): New global variable. (op_modplace): Support zap. (eval_init): Initialize zap_s, and register as operator. * txr.1: Documented zap.
* Array overrun fix in apply.Kaz Kylheku2015-03-312-12/+22
| | | | | | | | | * eval.c (APPLY_ARGS): New preprocessor symbol, replaces hard-coded 32 inside apply. (apply): Use APPLY_ARGS for argument array. Fix overrun of args array in non-variadic function case when list has more than APPLY_ARGS elements. Eliminate superflous "variadic" local variable.
* Deal with spurious retention in function application.Kaz Kylheku2015-03-314-114/+135
| | | | | | | | | | | | * gc.h (zap): New inline function. (z): New macro. * lib.c (generic_funcall, funcall1, funcall2, funcall4, do_not, do_dup, do_iff): Use z macro to burn funargs with no next use. * eval.c (apply, apply_frob_args, iapply, call, do_eval, op_dwim, mapcarv, mappendv, lazy_mapcarv_func, mapdov, do_apf, do_ipf, callf): Use z macro to burn funargs with no next use.
* * stream.c (vformat): Bugfix: ~X printing in lower case, like ~x,Kaz Kylheku2015-03-302-1/+6
| | | | when argument is a bignum integer.
* * mpi-patches/eliminate-locale-dependencies: New patch.Kaz Kylheku2015-03-293-0/+53
| | | | | | (s_mp_tovalue): Eliminate use of isupper, islower. * mpi-patches/series: Add patch.
* New -n option. New "i" mode letter in file opening functions.Kaz Kylheku2015-03-295-31/+242
| | | | | | | | | | | | | | | | | | | | | | | | * stream.c (struct stdio_mode): New struct type. (stdio_mode_init_trivial): New initializer macro. (parse_mode, format_mode, normalize_mode, set_mode_props): New static functions. (make_stdio_stream_common): the isatty check, and automatic marking of tty device streams as real-time is no longer done, unless backward compatibility 105 or earlier is requested. (open_file, open_tail, open_command, open_process): Use new mode parsing, which supports the "i" flag. (stream_init): If we have isatty, and standard input is a tty, then mark the *std-input* stream as real-time. * txr.1: Document -n/--noninteractive option. Fix typo where real-time-stream-p is referred to as stream-real-time-p. Document "i" flag on open-file and others. * txr.c (opt_noninteractive): New global. (help): Help text for -n/--noninteractive. (txr_main): Handle new options. * txr.h (opt_noninteractive): Declared.
* * eval.c (prinl, pprinl): Become external functions.Kaz Kylheku2015-03-285-5/+90
| | | | | | | | | | | (tprint): New function. (eval_init): Register tprint as intrinsic. * eval.h (prinl, pprinl, tprint): Declared. * txr.c (txr_main): New option, -t. * txr.1: Documented tprint and -t option.
* * eval.c (eval_init): register get-lines as having one optionalKaz Kylheku2015-03-284-3/+20
| | | | | | | | argument. * lib.c (lazy_stream_cons): Default the argument to std_input. * txr.1: Document that the stream is optional in get-lines.
* * txr.1: formatting fixes in weave description.Kaz Kylheku2015-03-241-1/+2
|
* * Makefile (enforce): Update error error message.Kaz Kylheku2015-03-243-8/+20
| | | | | | * configure (have_git): Don't set this variable if the TXR repository is missing, even if git is installed. I.e. have_git means have have the tool and the repo.
* * lib.c (int_str): Workaround for wcstol recognizing the 0x prefix whenKaz Kylheku2015-03-203-1/+36
| | | | | | | radix is 16. Also, thrown an error if radix is not in the range 0 to 36. * txr.1: Document int-str's radix range restriction.
* * txr.c (help): Added missing documentation for -e and -p.Kaz Kylheku2015-03-173-11/+42
| | | | | | | Also documented -P. (txr_main): New option implemented, -P. * txr.1: Document -P, and clean up -e and -p documentation.
* Version 105.txr-105Kaz Kylheku2015-03-147-280/+335
|
* * stream.c (run): In Windows version, fix nasty corruption bug:Kaz Kylheku2015-03-112-2/+6
| | | | | we were freeing C strings that were not duplicated, but only borrowed from string objects.
* * stream.c (open_process, run, sh): Eliminate utf8name local variableKaz Kylheku2015-03-112-10/+12
| | | | | and associated memory leak. Correctly allocate only nargs + 1 elements for argv array, not nargs + 2.
* * sysif.c (mkdir_nothrow_exists): New static function.Kaz Kylheku2015-03-103-1/+81
| | | | | | | (ensure_dir): New function. (sysif_init): ensure_dir registered as intrinsic. * txr.1: ensure_dir documented.
* * parser.c (open_txr_file, regex_parse, lisp_parse): FunctionsKaz Kylheku2014-12-213-77/+85
| | | | | | | moved here from parser.l. * parser.l (open_txr_file, regex_parse, lisp_parse): Functions moved from here to parser.c.
* * Makefile (OBJS): Add parser.o.Kaz Kylheku2014-12-215-3/+107
| | | | | | | | | | * parser.h (parser_s): Declared. (parse_init): Declaration removed. (parser_l_init): Declared. * parser.l (parse_init): Function renamed to parser_l_init. * parser.c: New file.
* New ignerr macro.Kaz Kylheku2015-02-255-218/+269
| | | | | | | | | * eval.c (me_ignerr): New static function. (eval_init): Registered ignerr macro. * txr.1: Documented. * tl.vim, txr.vim: Regenerated.