summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
* Formatting under new macro.Kaz Kylheku2015-09-091-0/+1
| | | | * txr.1: Missing .desc added.
* Documented interactive listener.Kaz Kylheku2015-09-081-0/+343
|
* New functions, subtypep and typep.Kaz Kylheku2015-09-081-0/+144
| | | | | | | | | | | | | | | | * eval.c (eval_init): Register subtypep and typep. * eval.h (list_s): Existing variable declared. * lib.c (atom_s, integer_s, number_s, sequence_s, string_s): new symbol variables. (subtypep, typep): New functions. (obj_init): Initialize new symbol variables. * lib.c (atom_s, integer_s, number_s, sequence_s, string_s): Declared. * txr.1: Documented type hierarchy and the new functions.
* Random states of type random-state, not *random-state*.Kaz Kylheku2015-09-081-0/+8
| | | | | | | | | | | | | | | * lib.c (compat_fixup): Call rand_compat_fixup. * rand.c (random_state_var_s): New global symbol variable. (rand_compat_fixup): New static function. (rand_init): Initialize random_state_var_s by intering the earmuffed symbol *random-state*. Initialize random_state_s to the non-earmuffed symbol random-state. * rand.h (random_state_var_s): Declared. (random_state): Macro updated to look up the special variable using random_state_var_s, rather than random_state_s. (rand_compat_fixup): Declared.
* Debugger and compatibility now major sections.Kaz Kylheku2015-09-071-5/+7
| | | | | * txr.1: Debugger and Compatibility are moved out of the TXR library description, into their own major sections.
* kill function returns boolean rather than integer.Kaz Kylheku2015-09-071-1/+11
| | | | | | | | * signal.c (kill_wrap): Return boolean indication of success, with compatibility to previous behavior. * txr.1: Document return value of kill, and put in compatibility note.
* Adding raise function.Kaz Kylheku2015-09-071-0/+17
| | | | | | | * signal.c (raise_wrap): New static function (sig_init): Register raise intrinsic. * txr.1: Documented raise.
* Parse errors lose program prefix and parens.Kaz Kylheku2015-09-061-0/+10
| | | | | | | | | | | * parser.l (yyerrorf): Don't print the program prefix and parenthes, except if compatibility to 114 or older is requested. The main motivation for this is the repl, where the program prefix is not informative. The new format is also a de facto standard which is compatible with other parsers. Vim understands it directly. * txr.1: Documented.
* Version 114.txr-114Kaz Kylheku2015-09-021-2/+2
| | | | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * genvim.txr: Scan struct.c, path-test.tl and struct.tl files. * txr.vim, tl.vim: Regenerated.
* Unix password database access.Kaz Kylheku2015-09-011-0/+79
| | | | | | | | | | | | | | | * configure: Detect getpwuid, getpwuid_r and others. * sysif.c (passwd_s, name_s, gecos_s, dir_s, shell_s): New symbol variables. (setpwent_wrap, endpwent_wrap, fill_passwd, make_pwstruct, getpwent_wrap, getpwuid_wrap, getpwnam_wrap): New static functions. (sysif_init): Initialize new symbol variables. Create passwd structure type. Register setpwent, endpwent, getpwent, getpwuid and getpwnam intrinsics. * txr.1: Documented passwd structure and functions.
* Document new time structure and functions.Kaz Kylheku2015-09-011-0/+65
| | | | | * txr.1: Document time struct, time-struct-local and time-struct-utc.
* Documenting stat structure.Kaz Kylheku2015-09-011-25/+47
| | | | | | * txr.1: stat structure described; places updated to refer to it rather than the old propertly list. Compatibility note added.
* Fix bad .meta/.metn formatting.Kaz Kylheku2015-09-011-5/+5
| | | | | * txr.1: Fixed incorrect macro use under in, mapdo, set, and getenv.
* Fix wrong description of :wholeKaz Kylheku2015-09-011-2/+32
| | | | | * txr.1: :whole doesn't bind the entire macro form. Added Dialect Note to compare with CL.
* Struct documentation.Kaz Kylheku2015-08-311-5/+750
| | | | * txr.1: New section on structs documenting functions and macros.
* Document alternation syntax.Kaz Kylheku2015-08-291-0/+8
| | | | | * txr.1: The { x | y } notation has been used in the document for a long time; now it is explained.
* Fix duplication in manpage.Kaz Kylheku2015-08-251-15/+1
| | | | | * txr.1: Verbatim exact duplicate of packagep documentation removed. Fixed duplicated mknod heading over description of chmod.
* Document previously undocumented command line options.Kaz Kylheku2015-08-241-0/+21
| | | | | | * txr.1: Documented --gc-debug, --vg-debug and --dv-regex. * txr.c (help): Cover above options.
* Compatibility <= 107 allows redefinition of builtins.Kaz Kylheku2015-08-241-1/+6
| | | | | | | | * eval.c (builtin_reject_test): Suppress the diagnostic against redefinition of built-in macros and operators if the compatibility is 107 or lower. The rejection appeared in 108. * txr.1: Document this compatibility behavior.
* New function: shuffle.Kaz Kylheku2015-08-241-0/+21
| | | | | | | | * eval.c (eval_init): Register shuffle as intrinsic. * lib.c (shuffle): New function. * lib.h (shuffle): Declared.
* Use of new args for function calls in interpreter.Kaz Kylheku2015-08-231-12/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * args.c (args_copy_to_list): New function. * args.h (ARGS_MIN): New preprocessor symbol. (args_add_list): New inline function. (args_copy_to_list): Declared. * debug.c (debug): Args in debug frame are now struct args *. Pull them out nondestructively for printing using args_copy_to_list. * eval.c (do_eval_args): Fill struct args argument list rather than returning evaluated list. Dot position evaluation is handled by installing the dot position value as args->list. (do_eval): Allocate args of at least ARGS_MAX for the call to do_eval_args. Then use generic_funcall to invoke the function rather than apply. (eval_args_lisp1): Modified similarly to do_eval_args. (eval_lisp1): New static function. (expand_macro): Construct struct args argument list for the sake of debug_frame. (op_dwim): Allocate args which are filled by eval_args_lisp1, and applied to the function/object with generic_funcall. The object expression is separately evaluated with eval_lisp1. * match.c (h_fun, v_fun): Construct struct args arglist for the sake of debug_frame call. * unwind.c (uw_push_debug): args argument becomes struct args *. * unwind.h (struct uw_debug): args member becomes struct args *. (uw_push_debug): Declaration updated. * txr.1: Update documentation about dot position argument in function calls. (list . a) now works, which previously didn't.
* Clarification about @rest in do/op syntax.Kaz Kylheku2015-08-231-9/+20
| | | | | | * txr.1: Make it clear that @rest is not inserted if meta-numbers or @rest is present. Move example to the end.
* 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.