summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
...
* Do not allow unrecognized escapes in regex.Kaz Kylheku2015-04-191-5/+18
| | | | | | | | | | | | * 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.
* Adding lcons macro.Kaz Kylheku2015-04-181-1/+62
| | | | | | | | | * 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-181-0/+66
| | | | | | | | | | | | | | * 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.
* Adding exit* function which calls _exit.Kaz Kylheku2015-04-161-0/+21
| | | | | | | | | * 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-161-0/+43
| | | | | | | | | | | * 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-161-0/+40
| | | | | | | | | | | * 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-161-0/+41
| | | | | | | * eval.c (me_dotimes): New function. (eval_init): Registering dotimes macro. * txr.1: Documented dotimes.
* Implementing while* and until* loops.Kaz Kylheku2015-04-111-0/+30
| | | | | | | | | | | * 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
|
* Exposing dup and dup2.Kaz Kylheku2015-04-111-0/+13
| | | | | | | | | | * 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-101-0/+36
| | | | | | | | | | | | | | | | * 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.
* * txr.1: Flurry of formatting fixes.Kaz Kylheku2015-04-091-6/+6
|
* Fork and wait support.Kaz Kylheku2015-04-091-0/+132
| | | | | | | | | | | | | | * 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-061-0/+77
| | | | | | | | | | | (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-051-0/+63
| | | | | | | | | | | * 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-011-1/+23
| | | | | | | | * eval.c (zap_s): New global variable. (op_modplace): Support zap. (eval_init): Initialize zap_s, and register as operator. * txr.1: Documented zap.
* New -n option. New "i" mode letter in file opening functions.Kaz Kylheku2015-03-291-21/+66
| | | | | | | | | | | | | | | | | | | | | | | | * 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-281-0/+41
| | | | | | | | | | | (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-281-2/+8
| | | | | | | | 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
|
* * lib.c (int_str): Workaround for wcstol recognizing the 0x prefix whenKaz Kylheku2015-03-201-0/+1
| | | | | | | 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-171-6/+18
| | | | | | | 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-141-2/+2
|
* * sysif.c (mkdir_nothrow_exists): New static function.Kaz Kylheku2015-03-101-1/+9
| | | | | | | (ensure_dir): New function. (sysif_init): ensure_dir registered as intrinsic. * txr.1: ensure_dir documented.
* New ignerr macro.Kaz Kylheku2015-02-251-0/+30
| | | | | | | | | * eval.c (me_ignerr): New static function. (eval_init): Registered ignerr macro. * txr.1: Documented. * tl.vim, txr.vim: Regenerated.
* Introducing persistent error state on streams.Kaz Kylheku2015-02-251-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib.c (cobj_ops): New function. * lib.h (cobj_ops): Declared. * stream.c (null_ops): Initializer updated. (struct stdio_handle): New member, err. (stdio_stream_mark): Mark the err member. (errno_to_string): New static function. (stdio_maybe_read_error, stdio_maybe_error): Set persistent error state. Use errno_to_string_function. (stdio_put_string, stdio_put_char, stdio_put_byte, stdio_seek, stdio_get_line): Set errno to zero, so that if the underlying operations do not set errno on err, we don't misinterpret some pervious errno value as pertaining to the failed stream operation. (stdio_get_error, stdio_get_error_str, stdio_clear_error): New static functions. (stdio_ops, tail_ops, pipe_ops): Update initializer with new functions. (string_in_get_error, string_in_get_error_str): New static functions. (string_in_ops): Update initializer with new functions. (byte_in_get_error, byte_in_get_error_str): New static functions. (byte_in_ops): Update initializer with new functions. (string_out_ops, strlist_out_ops): Update initializer with null pointers for new functions. (struct dir_handle): New struct type. (dir_destroy, dir_mark): New functions. (dir_get_line): Refactor for struct dir_handle context rather than DIR. Persist error state. (dir_close): Refactor for struct dir_handle. (dir_get_error, dir_get_error_str, dir_clear_error): New static functions. (dir_ops): Update initializer with new functions. (make_stdio_stream_common): Initialize new err member. (make_dir_stream): Refactor for struct dir_handle. (get_error, get_error_str, clear_error): New functions. (cat_get_error, cat_get_error_str, cat_clear_error): New static functions. (cat_stream_ops): Update initializer with new functions. (stream_init): Register get-error, get-error-str, clear-error intrinsics. * stream.h (struct strm_ops): New function pointer members, get_error, get_error_str and clear_error. (strm_ops_init): Macro extended with new arguments for new function pointers. (get_error, get_error_str, clear_error): Declared. * syslog.c (syslog_strm_ops): Update initializer with null pointers for new functions. * txr.1: Documented get-error, get-error-str and clear-error.
* String-returning wrappers for some regex matching functions.Kaz Kylheku2015-02-201-4/+33
| | | | | | | | | | | * eval.c (eval_init): Register search-regst, match-regst and match-regst-right intrinsics. * regex.c (search_regst, match_regst, match_regst_right): New functions. * regex.h (search_regst, match_regst, match_regst_right): Declared. * txr.1: Documented new variants.
* New functions pad and weave.Kaz Kylheku2015-02-121-0/+61
| | | | | | | | * eval.c (pad_func, pad, weave_while, weave_gen, weavev): New static functions. (eval_init): Registered pad and weave intrisics. * txr.1: Documented pad and weave.
* * eval.c (symacro_k, fun_k): New keyword variables.Kaz Kylheku2015-02-101-0/+36
| | | | | | | | | | (lexical_lisp1_binding): New static function. (eval_init): Initialize symacro_k and fun_k; register new intrinsic function lexical-lisp1-binding. * match.h (var_k): Existing external name declared. * txr.1: Documented lexical-lisp1-binding.
* Version 104.txr-104Kaz Kylheku2015-02-081-2/+2
|
* * arith.c (trunc_rem): New function.Kaz Kylheku2015-02-071-1/+21
| | | | | | | | | | * eval.c (eval_init): Register trunc-rem intrinsic. * lib.h (trunc_rem): Declared. * txr.1: Documented trunc-rem. * tl.vim, txr.vim: Updated.
* * txr.1: fixed flurry of phrasing, formatting fumbles.Kaz Kylheku2015-02-071-12/+22
|
* * sysif.c (abort_wrap): New static function.Kaz Kylheku2015-02-061-2/+25
| | | | | | | | | | (sysif_init): Registered abort intrinsic. * txr.1: Documented abort. Changed Unix Programming heading to System Programming, since exit, abort and errno are not Unix-specific, but C-specific. * tl.vim, txr.vim: Updated.
* * unwind.c (unhandled_hook_s): New static variable.Kaz Kylheku2015-02-061-0/+41
| | | | | | | | | | | | | | | | | | | (uw_throw): In the unhandled case, check if *unhandled-hook* variable has a function, and use it instead of the default logic. If it's not a function, abort with an error message. Clear it so that if the hook function re-enters this code, it will not be used. Always exit now on unhandled exceptions; do not abort. (uw_late_init): New function. * unwind.h (uw_late_init): Declared. * lib.c (init): Call uw_late_init. * txr.1: Documented *unhandled-hook*. * genvim.txr: Scan the unwind.c file, since it has a reg_var now. * tl.vim, txr.vim: Updated.
* Symbol macros shadowed by functions under dwim.Kaz Kylheku2015-02-031-20/+44
| | | | | | | | | | | * eval.c (lookup_symac_lisp1, expand_lisp1, expand_forms_lisp1): New static functions. (expand): Handle dwim's arguments via expand_forms_lisp1, rather than as a generic compound form. * txr.1: Revised text in several places to clarify this expansion rule.
* Version 103.txr-103Kaz Kylheku2015-02-011-2/+2
|
* * arith.c (make_ubignum): New static function.Kaz Kylheku2015-01-291-0/+29
| | | | | | | | | | | | (sign_extend): New function. * eval.c (eval_init): Register sign-extend intrinsic. * lib.h (sign_extend): Declared. * txr.1: Documented sign-extend. * tl.vim, txr.vim: Updated.
* * txr.1: Minor change under make-random-state.Kaz Kylheku2015-01-291-1/+1
|
* * txr.1: fixed use of nonexistent str-int in @(require) example;Kaz Kylheku2015-01-291-5/+3
| | | | fixed bad formatting under logtrunc and partition.
* * arith.c (width): New function.Kaz Kylheku2015-01-271-0/+28
| | | | | | | | * arith.h (width): Declared. * eval.c (eval_init): Width registered as intrisinc. * txr.1: Documented width.
* * eval.c (call_f): new global variable.Kaz Kylheku2015-01-251-0/+45
| | | | | | | | | (do_mapf, mapf): new static functions. (eval_init): protect call_f from gc, and initialize it. re-register call function using call_f. register mapf intrinsic. * txr.1: Documented mapf.
* * eval.c (eval_init): Register dupl and swap_12_21 asKaz Kylheku2015-01-251-0/+31
| | | | | | | | | | | the dup and flip intrinsics. * lib.c (do_dup): New static function. (dupl): New function. * lib.h (dupl): Declared. * txr.1: Documented dup and flip.
* * eval.c (callf): New static function.Kaz Kylheku2015-01-241-0/+32
| | | | | | (eval_init): callf registered. * txr.1: Documented callf.
* * txr.1: Grammar.Kaz Kylheku2015-01-241-1/+1
|
* Basic implementation of constantp. Does notKaz Kylheku2015-01-211-0/+37
| | | | | | | | | | | recognize forms like (+ 2 2) as constant. * eval.c (constantp_noex, constantp): New functions. (eval_init): Registered constantp as intrinsic. * tl.vim, txr.vim: Updated. * txr.1: Documented constantp.