summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
* Missing notes about global lexical variables.Kaz Kylheku2015-08-201-8/+43
| | | | | | * txr.1: Note that TXR Lisp has global lexicals, and that some library variables are examples of such, and that defparm is defparameter in CL.
* Wording in description of quasiquote.Kaz Kylheku2015-08-201-2/+2
| | | | | * txr.1: An unquote's evaluation should be contrasted with the quasiquote's suppression of it, not with the quote.
* Version 113.txr-113Kaz Kylheku2015-08-141-2/+2
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.
* Troff formatting macros must not generate control sequences.Kaz Kylheku2015-08-191-4/+4
| | | | | | | | Reported by Dave Love. * txr.1 (cod1, cod2, meti, TP*): When inserting material at the start of a line, add the \& zero width character, so the line isn't interpreted as a control sequence.
* Fix man page markup errors.Dave Love2015-08-171-22/+22
| | | | | * txr.1: Numerous misspellings of macro names are repaired.
* Improved wording about auto-loading.Kaz Kylheku2015-08-161-5/+6
| | | | | * txr.1: In the stdlib variable description, rewrote the text describing the macro-time autoloading scenario.
* Allow slashes in regex passed to regex-parse.Kaz Kylheku2015-08-151-3/+32
| | | | | | | | | | | * parser.l (SREGEX): New start state, for stand-alone regex parsing. (grammar): All REGEX state rules are active in the SREGEX state also. The rule for the / character returns a REGCHAR if in the SREGEX state, so it is treated as an ordinary character. * txr.1: Updated regex-parse documentation about the treatment of the slash. Also added notes about double escaping when a string literal is passed to regex-parse.
* Formatting fix under clamp function.Kaz Kylheku2015-08-141-1/+1
| | | | * txr.1: .meta -> .metn
* Version 112.txr-112Kaz Kylheku2015-08-141-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * tl.vim, txr.vim: Regenerated.
* New function, clamp.Kaz Kylheku2015-08-131-0/+38
| | | | | | | | | | * eval.c (eval_init): Register clamp as intrinsic function. * lib.c (clamp): New function. * lib.h (clamp): Declared. * txr.1: Documented.
* Observe display width in format.Kaz Kylheku2015-08-131-3/+23
| | | | | | | | | | | | | Take into account string display width in field trimming and padding calculations, including situations where only half a character fits. * stream.c (calc_fitlen): New function. (vformat_str): Revised to use calc_fitlen. If calc_fitlen indicates that there is no trimming or padding, then use put_string rather than put_char. * txr.1: Update description of format with regard to use of dispaly width in field calculations.
* New display-width function.Kaz Kylheku2015-08-131-0/+27
| | | | | | | | | | * eval.c (eval_init): Register display-width intrinsic. * lib.c (display_width): New function. * lib.h (display_width): Declared. * txr.1: Documented display-width.
* Floating-point constant tightening.Kaz Kylheku2015-08-121-3/+4
| | | | | | | | | | | | | * parser.l (grammar): Change order of rule which recognizes FLODOT with a one-character trailing context other than a dot, and the rule which diagnoses trailing junk. The issue is that this order gives the wrong interpretation to 123.E, treating it as 123. followed by E rather than trailing junk, like in the case of 123.0E or 123.B. * txr.1: Adding the valid example 1.E5. Removing references to dot as consing dot. Fixed documentation which says that 1.E is 1 followed by a consing dot and E. The wrong behavior in fact produced 1.0 followed by E. No consing dot semantics.
* Revision to .. syntax.Kaz Kylheku2015-08-121-21/+15
| | | | | | | | | | | | | * parser.y (r_exprs, n_expr): Move the DOTDOT syntactic sugar rule from r_exprs to n_expr, where it is much simpler. This also means that the a..b syntax is now an expression by itself; it need not be enclosed in a list. The DOTDOT operator is made right associative; or rather its existing %right declaration is now activated. * txr.1: Remove documentation stating that the .. notation must be used in a list, and not in the dotted position of an improper list. Document the behavior in the dotted position, and document right associativity.
* Dot with no whitespace generates qref syntax.Kaz Kylheku2015-08-101-0/+41
| | | | | | | | | | | | | | | | | | | | | | | a.b.(expr ...).c -> (qref a b (expr ...) c) Consing dot requires whitespace. * eval.c (qref_s): New symbol global variable. (eval_init): Initialize qref_s. * eval.h (qref_s): Declared. * parser.l (REQWS): New pattern definition, required whitespace. (grammar): New rules to scan CONSDOT (space required on both sides) and LAMBDOT (space required after). * parser.y (CONSDOT, LAMBDOT): New token types. (list): (. n_expr) rule replaced with LAMBDOT and CONSDOT. (r_exprs): r_exprs . n_expr consing dot rule replaced with CONSDOT. (n_expr): New n_expr . n_expr rule introduced here for producing qref expressions. (yybadtoken): Handle CONSDOT and LAMBDOT. * txr.1: Documented qref dot.
* Version 111.txr-111Kaz Kylheku2015-08-081-2/+2
|
* Suppress debug stepping into auto-loaded library code.Kaz Kylheku2015-08-061-0/+7
| | | | | | | | | | | | | | | | | | | | | * debug.c (debug_set_state, debug_restore_state): New functions. * debug.h (debug_state_t): New type. (debug_set_state, debug_restore_state): Declared, and defined as dummy macros in non-debug-support build. * lisplib.c (opt_dbg_autoload): New global variable. (lisplib_try_load): Disable or enable debugging around library loading based on opt_dbg_autoload option. * lisplib.h (opt_dbg_autoload): Declared. * txr.c (help): List --debug-autoload option. (no_dbg_support): New static function to avoid repeated code. (txr_main): Add debugger option. Change duplicate no debug support error messages into calls to no_dbg_support. * txr.1: Document --debug-autoload
* * txr.1: Formatting issue in in-line code block under giterate.Kaz Kylheku2015-08-051-1/+1
|
* * txr.1: pppred formatting problem.Kaz Kylheku2015-08-051-1/+1
|
* New filesystem object testing functions.Kaz Kylheku2015-08-051-0/+204
| | | | | | | | | | * lisplib.c (path_test_set_entries, path_test_instantiate): New static functions. (dlt_register): Registered new functions to dl_table. * txr.1: Documented new functions. * share/txr/stdlib/path-test.tl: New file.
* Adding support for uid and gid manipulation.Kaz Kylheku2015-08-051-0/+47
| | | | | | | | | | | | * configure: Added check for geteuid and related functions. * sysif.c (getuid_wrap, geteuid_wrap, getgid_wrap, getegid_wrap, getgroups_wrap, setuid_wrap, seteuid_wrap, setgid_wrap, setegid_wrap): New static functions. (sysif_init): Register intrinsics getuid, geteuid, getgid, getegid, getgroups, setuid, seteuid, setgid, setegid. * txr.1: Documented new functions.
* * stream.c (stream_init): Register get-indent-mode, set-indent-mode,Kaz Kylheku2015-08-051-1/+143
| | | | | | | | test-set-indent-mode, get-indent, set-indent, inc-indent and width-check intrinsic functions. Register indent-off, indent-data and indent-code variables. * txr.1: Documented stream output indentation API.
* * stream.c (vformat): Implement ~! format directive for indentation.Kaz Kylheku2015-08-041-3/+35
| | | | | | | Allow negative widths to be specified with a leading minus sign, so that we can indent to the left. * txr.1: Document ~! format directive.
* Remove useless return values and checks.Kaz Kylheku2015-08-041-0/+5
| | | | | | | | | | | | | | | * stream.c (vformat_align_pre, vformat_align_post): Change to void return. Do not check return value of put_char. (vformat_num, vformat_str): Change to void return. Do not check return value of vformat_align_pre, vformat_aign_post or put_char. (vformat): Do not check return value of vformat_str or vformat_num. nilout exit point no longer needed. (put_string): Do not intercept return value of ops->put_string. Return t. (put_char): Do not intercept return value of ops->put_char. Do not check return value of put_indent. Return t. * txr.1: Document t return of put-char, put-byte and put-string.
* * eval.c (func_get_name): New function.Kaz Kylheku2015-08-041-0/+29
| | | | | | | | | | | | (bind_args): Include the entire context form in argument mismatch errors. (apply): Include the function name, or else source code if it has no name, in argument mismatch erors. (eval_init): Register func-get-name intrinsic. * eval.h (func_get_name): Declared. * txr.1: Documented func-get-name.
* * eval.c (force): Default the new second argument of source_loc_str.Kaz Kylheku2015-08-041-3/+8
| | | | | | | | | | | | | | | | | | | (eval_error): Derive location of error from the last_form_evaled, if form doesn't have it. (eval_init): Re-register source-loc-str as binary with an optional arg. * match.c (debuglf, sem_error, file_err, typed_error): Default new argument of source_loc_str. * parser.h (source_loc_str): Declaration updated. * parser.l (source_loc_str): Take second argument which specifies alternative value if the source loc info is not found. * unwind.c (uw_throw): Simplify code thanks to source_loc_str default argument. * txr.1: Document new argument of source-loc-str.
* * hash.c (hash_revget): New function.Kaz Kylheku2015-08-041-0/+44
| | | | | | | | * hash.h (hash_revget): Declared. * eval.c (eval_init): Registered hash-revget intrinsic. * txr.1: Documented hash-revget.
* Switching some globals to lexical and changing some names.Kaz Kylheku2015-08-031-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * arith.c (arith-init): Changing *flo-...* from special to lexical, and adding un-earmuffed variants. The earmuffed versions are obsolescent. Adding %pi% and %e% global lexicals. Earmuffed versions are also made global lexical, and obsolescent. * eval.c (lookup_global_var, lookup_global_var_l): New functions. (lookup_var): Uses lookup_global_var. (reg_varl): New function. (reg_var): Uses reg_var. (eval_init): Register global lexicals user-package, system-package and keyword-package. Old symbols with earmuffs are obsoleted, and also turned into global lexicals. (top-vb, top-fb): Changed to lexical. * eval.h (lookup_global_var, lookup_global_var_l, reg_varl): Declared. * genvim.txr: Scan ver.tl so that the lib-version variable is included. Extract reg_varl calls. * glob.c (glob_init): glob-err and other variables made lexical. * lib.c (get_user_package, get_system_package, get_keyword_package): Use lookup_global_var_l to avoid searching dynamic scope for lexicals which cannot be dynamically rebound. * share/txr/stdlib/ver.tl (lib-version): New global lexical variable. (*lib-version*): Turned lexical. Obsolescent. * signal.c (sig-init): sig-* variables turned lexical. * sysif.c (sysif-init): s-*, poll-* and w-* variables turned lexical. * syslog.c (syslog-init): log-* variables turned lexical. * txr.c (sysroot-init): stdlib and *txr-version* variables turned lexical. txr-version variable added, and *txr-version* is obsolescent. (txr-main): self-path variable added. *self-path* turns lexical and is obsolescent. * txr.1: Documentation updated. Lexical variables not referred to as special. Special variables referred to as special.
* Introducing global lexicals: defvarl, defparml.Kaz Kylheku2015-08-031-6/+47
| | | | | | | | | | | | | | | | | | | | | * eval.c (defvarl_s, defparm_s, defparml_s, sys_mark_special_s): New symbol variables. (mark_special): Return val rather than void, since it's hoisted into Lisp domain now with func_n1. (op_defvar): Renamed to op_defvarl, and doesn't call mark_special. defvarl is now the special form for defining variables, and special marking is an embellishment added by macros. (me_defparm): Renamed to me_def_variable. Handles defvar, defparm and defparml. (do_expand): Expand defvarl, rather than defvar. (eval_init): Intern defvarl, defparm, defparml and mark-special symbols, and initialize corresponding globals. Register defvarl special operator, retiring defvar. Register defparm to me_def_variable, and register defvar and defparml to the same. * txr.1: Document support for global lexical scopes and the new macros.
* Support lstat and fstat.Kaz Kylheku2015-08-021-1/+29
| | | | | | | | | | | | | | | * stream.h (statf): Declaration removed. * sysif.c (w_stat): Function takes val instead of const wchar_t * as leftmost argument. (w_lstat, w_fstat): New static functions, with same interface as w_stat. (stat_to_list, stat_impl): New static functions. (statp, statl): New static functions. (statf): Function removed, name re-used for new static function. (sysif_init): stat intrinsic registered to statp function, not statf. lstat and fstat intrinsics registered to statl and statf. * txr.1: Documented lstat and fstat.
* * eval.c (special_p): Function renamed to special_var_p.Kaz Kylheku2015-08-011-0/+34
| | | | | | | | (expand_opt_params_rec, expand_vars): Follow rename of special_p. (eval_init): Register special-operator-p and special-var-p intrinsics. * txr.1: Document special-operator-p and special-var-p.
* Big TXR Lisp documentation rearrangement.Kaz Kylheku2015-08-011-6225/+6374
| | | | | * txr.1: Numerous sections moved around. Miscellaneous formatting and wording fixes. New sections under TXR Lisp intro section.
* Centered fields in format.Kaz Kylheku2015-07-281-6/+13
| | | | | | | | | | | | * stream.c (enum align): New enum. (vformat_align_pre, vformat_align_post): New static functions. (vformat_num, vformat_str): Argument left renamed to align, and changed to enum align. vformat_align_pre and vformat_align_post are called to generate the correct padding for left, center and right alignment. (vformat): Two-valued local variable left turned into three-valued align. The ^ prefix on the width field is recognized. * txr.1: Documented ^ width prefix.
* * txr.1: In introduction of user-defined places, mentioningKaz Kylheku2015-07-281-2/+32
| | | | | placelet as a way of writing place update macros. Example added under placelet.
* * txr.1: Bad syntax in placelet example; bad font in headings.Kaz Kylheku2015-07-281-11/+9
|
* Version 110.txr-110Kaz Kylheku2015-07-251-2/+2
|
* * txr.1: Notes about interaction between op and quasiliterals.Kaz Kylheku2015-07-251-1/+65
|
* * txr.1: Clarifications in ifa description.Kaz Kylheku2015-07-241-5/+5
|
* * parser.l (grammar): Do not allow unescaped newline inKaz Kylheku2015-07-231-6/+21
| | | | | | | | | | | word list literals and word list quasiliterals, except in <= 109 compatibility mode. An escaped newline in these literals, together with surrounding whitespace, now produces a single space, except in <= 109 compatibility mode. * txr.1: Documented new rules for WLL's and QLL's, and added compatibility notes.
* Adding with-resources macro.Kaz Kylheku2015-07-231-0/+70
| | | | | | | | | | * share/txr/stdlib/with-resources.tl: New file. * lisplib.c (with_resource_set_entries, with_resources_instantiate): New static functions. (lisplib_init): Register new functions under dlt_register. * txr.1: Document with-resources.
* Adding nthcdr as accessor.Kaz Kylheku2015-07-221-0/+60
| | | | | | | | | | | | * eval.c (eval_init): Register nthcdr function. * lib.c (nthcdr): New function. * lib.h (nthcdr): Declared. * share/txr/stdlib/place.tl (nthcdr): New defplace. * txr.1: Documented.
* * txr.1: Delete accidentally introduced bogus text.Kaz Kylheku2015-07-221-2/+1
|
* Improve bad argument diagnosis for place macros.Kaz Kylheku2015-07-221-1/+18
| | | | | | | | | | * eval.c (op_mac_param_bind): New static function. (eval_init): Register mac-param-bind operator. * share/txr/stdlib/place.tl (define-place-macro): Use mac-param-bind inside a lambda instead of tb macro. * txr.1: Document mac-param-bind.
* Implementing second through tenth as places.Kaz Kylheku2015-07-221-12/+29
| | | | | | | | | | | | | | | | | | * eval.c (eval_init): Register second through tenth as intrinsic. * gencadr.txr: New cadr.c changes encoded. * lib.c (second, third, fourth, fifth, sixth): Functions reimplemented using ref, so they are much more efficient for vectors and strings. (seventh, eighth, ninth, tenth): New functions. * lib.h (seventh, eighth, ninth, tenth): Declared. * share/txr/stdlib/place.tl: place macros defined for second through tenth. * txr.1: Documented.
* * lisplib.c (place_set_entries): Add *place-macro* andKaz Kylheku2015-07-221-3/+44
| | | | | | | | | | | | | | define-place-macro to list of names. * share/txr/stdlib/place.tl (*place-macro*): New global hash. (sys:tigger-load, sys:pl-expand): New functions. (call-update-expander, call-clobber-expander, call-delete-expander): Recognize and expand place macros. (define-place-macro): New macro. (first, rest): Places redefined using define-place-macro, replacing the old hack of copying the expanders from one table entry to another. * txr.1: Documented place macros.
* Implementing caar, cadr, cdar and friends.Kaz Kylheku2015-07-211-0/+80
| | | | | | | | | | | | | | | | | | | | * lib.c (init): Call cadr_init. * lisplib.c (dl_table, set_dlt_entries, dlt_register): Externalize. * lisplib.h (dl_table, set_dlt_entries, dlt_register): Declared. * Makefile (OBJS): Add cadr.o. * cadr.c: New file. * cadr.h: New file. * gencadr.txr: New file. * share/txr/stdlib/cadr.tl: New file. * txr.1: Document cadr accessors.
* * share/txr/stdlib/place.tl (defplace cdr): Change deletionKaz Kylheku2015-07-211-7/+29
| | | | | | semantics so that (del (cdr x)) is symmetric with (del (car x)). * txr.1: Update documentation.
* * eval.c (eval_init): Register new split function.Kaz Kylheku2015-07-211-0/+91
| | | | | | | | | | | | * lib.c (split_func): New static function. (partition_split_common): New static function, based on on contents of partition function. (partition): Now a wrapper around partition_split_common. (split): New function. * lib.h (split): Documented. * txr.1: Documented split.
* * txr.1: Fixes in description of partition.Kaz Kylheku2015-07-211-8/+10
|
* * txr.1: Document place binding behavior of ifa.Kaz Kylheku2015-07-201-5/+13
|