summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
...
* * eval.c (not_null): New static function.Kaz Kylheku2014-06-171-3/+30
| | | | | | | | (eval_init): Use null_f in existing registration of null and not. Add registration for not_null as "true", and for null_f as "false". * txr.1: Documented true and false.
* * eval.c (eval_init): register tuples as intrinsic.Kaz Kylheku2014-06-171-0/+33
| | | | | | | | | * lib.c (tuples_func): New static function. (tuples): New function. * lib.h (tuples): Declared. * txr.1: Documented.
* * lib.c (obj_print): Render character DC00 as "pnul".Kaz Kylheku2014-06-151-2/+22
| | | | | | | | | | | | | Clean up code which chooses rendering for characters. Print C0 and C1 control characters, as well as D800-DFFF, FFFE and FFFF and characters above FFFF using hex; others are printed using the #\<char> notation. * parser.y (char_from_name): map "pnul" to DC00. * txr.1: Documented pnul, clarified character printing rules, and added a cautionary note about possible ambiguity in printing.
* * eval.c (eval_init): Register pos_max, pos_min, find_max,Kaz Kylheku2014-06-151-0/+81
| | | | | | | | | | | | | | | | | | find_min and seqp as intrinsics. * lib.c (gt_f, lt_f): New variables. (to_seq): renamed to toseq. (seqp): New function. (minmax): New static function. (replace_str, replace_vec): Follow to_seq renaming. (find_max, find_min, pos_max, pos_min): New functions. (obj_init): gc-protect and initialize gt_f and lt_f. * lib.h (gt_f, lt_f): Declared. (to_seq): Declaration updated to toseq. (seqp, find_max, find_min, pos_max, pos_min): Declared. * txr.1: Updated.
* * eval.c (eval_init): where and sel registered as intrinsicsKaz Kylheku2014-06-151-3/+59
| | | | | | | | | | | | where and select. * lib.c (generic_funcall): Support a sequence as an argument to a sequence. (where, sel): New functions. * lib.h (where, sel): Declared. * txr.1: Documented.
* * match.c (v_load): use the abs_path_p function instead ofKaz Kylheku2014-06-121-0/+36
| | | | | | | | | | | | | checking for leading slash. * stream.c (abs_path_p): New function. (stream_init): Register abs_path_p as abs-path-p. * stream.h (abs_path_p): Declared. * txr.1: Documented abs-path-p. * dep.mk: Updated.
* Version 90txr-90Kaz Kylheku2014-06-111-2/+2
|
* * eval.c (eval_init): Change registration of string_cmpKaz Kylheku2014-06-101-19/+47
| | | | | | | | | | | | | | | | | | | to cmp_str. Add registrations for str_eq, str_lt, str_gt, str_le, and str_lt. * lib.c (string_cmp): Name changes to cmp_str, and the function fixed so that it actually works. The name change doesn't affect anyone because the function was too broken to use due to the incorrect type dispatch. (string_lt): Name changes to str_lt. (str_eq, str_gt, str_le, str_ge): New functions. * lib.h (string_cmp, string_lt): Declarations renamed. (str_eq, str_gt, str_le, str_ge): New declarations. * txr.1: Document string-cmp to cmp-str rename, that string-lt is deprecated, and the new str<, str>, str>=, str<= and str= functions.
* * lib.c (match_str): Extended to suffix testing, with a negativeKaz Kylheku2014-06-091-5/+14
| | | | | | start argument. * txr.1: Documented.
* * txr.c (txr_main): New option --args.Kaz Kylheku2014-06-091-21/+62
| | | | | | Also, put in missing check for -f being erroneously clumped. * txr.1: Documented.
* * txr.1: Clarify that -B is needed in some examples.Kaz Kylheku2014-06-091-30/+30
|
* The dumping of bindings and printing of false must nowKaz Kylheku2014-06-091-58/+13
| | | | | | | | | | | | | | | | | | | | | | | | | be explicitly requested by the -B option. * match.c (opt_nobindings): Variable removed. (opt_print_bindings): New variable. (extract): Print bindings or "false" if opt_print_bindings is true. * stream.c (output_produced): Variable removed. (stdio_put_string, stdio_put_char, stdio_put_byte): Remove update of output_produced. * stream.h (output_produced): Declaration removed. * txr.1: Documentation updated. * txr.c (txr_main): Option 'b' does nothing. 'B', 'l', 'a', and '--lisp-bindings' set opt_print_bindings to 1. * txr.h (opt_nobindings): Declaration removed. (opt_print_bindings): Declared. * unwind.c (uw_throw): When exiting due to a query error or file error, print false when opt_print_bindings is true.
* Fixing issue with list-like iteration over generic sequences,Kaz Kylheku2014-06-061-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | namely that empty strings and vectors are not nil. The nullify function is introduced. It is also exposed to users, as is the existing make_like function. * eval.c (mapcarv, mappendv, lazy_mapcar, lazy_mapcarv): Use nullify to handle non-list inputs correctly. (eval_init): Registering make_like and nullify as intrinsics. * lib.c (copy_list, to_seq, list_collect_nconc, list_collect_append, reverse, lazy_appendv_func, lazy_appendv, ldiff, memq, memql, memqual, remq, remql, remqual, remove_if, keep_if, rem_lazy_rec, remq_lazy, remql_lazy, remqual_lazy, remove_if_lazy, keep_if_lazy, countqual, countql, countq, count_if, some_satisfy, all_satisfy, none_satisfy, do_chain, chainv, do_and, andv, do_or, orv, cat_vec, assoc, assql, mapcar, mapcon, mappend, sort, multi_sort, find, find_if, posqual, posql, posq, pos, pos_if, set_diff, search): Use nullify for correctness. Some functions fixed so return sequence matches type of input sequence. (nullify): New function. * lib.h (nullify): Declared. * txr.1: Documented nullify and ake-like.
* * eval.c (eval_init): Register new search function as intrinsic.Kaz Kylheku2014-06-061-0/+51
| | | | | | | | | | | * lib.c (search_list): New static function. (search): New function. * lib.h (search): New function declared. * txr.1: Documented. * txr.vim: Regenerated.
* Documenting the return value of rplaca and rplacd, and changingKaz Kylheku2014-06-031-0/+5
| | | | | | | | | | | | it to be the cell, rather than the new value. * eval.c (transform_op): Fix use of rplacd that uses return value. (force): Likewise. * lib.c (rplaca, rplacd): Return cons. (rem_lazy_rec, obj_init): Fix use of rplacd that uses return value. * txr.1: Documented.
* The call operator should be a function!Kaz Kylheku2014-05-201-12/+4
| | | | | | | | * eval.c (call): New static function. (eval_args, op_call): Static functions removed. (eval_init): call_s registered as operator rather than function. * txr.1: Updated.
* Version 89txr-89Kaz Kylheku2014-05-101-2/+2
|
* Version 88txr-88Kaz Kylheku2014-04-041-2/+2
|
* * eval.c (me_quasilist): New static function.Kaz Kylheku2014-03-251-10/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | (eval_init): Register me_quasilist as quasilist macro expander. * lib.c (quasilist_s): New global variable. (obj_init): quasilist_s initialized. * lib.h (quasilist_s): Declared. * match.c (do_txreval): Handle quasilist syntax. * parser.l (QWLIT): New exclusive state. Extend lexical grammar to transition to QWLIT state upon the #` or #*` sequence which kicks off a word literal, and in that state, piecewise lexically analyze the QLL, mostly by borrowing rules from quasiliterals. * parser.y (QWORDS, QWSPLICE): New tokens. (n_exprs): Integrate splicing form of QLL syntax. (n_expr): Integrate non-splicing form of QLL syntax. (litchars): Propagate line number info. (quasilit): Fix "string literal" wording in error message. * txr.1: Introduced WLL abbreviation for word list literals, cleaned up the text a little, and documented QLL's.
* Introducing word list literals.Kaz Kylheku2014-03-251-0/+40
| | | | | | | | | | | | | | | | * parser.l (WLIT): New exclusive start state. Extend lexical grammar to transition to WLIT state upon the #" or #*" sequence which kicks off a word literal, and in that state, piecewise lexically analyze the literal, mostly by borrowing rules from other literals. * parser.y (WORDS, WSPLICE): New tokens. (n_exprs): Integrate splicing form of word list literal syntax. (n_expr): Integrate non-splicit for of word list literal syntax. (litchars): Propagate line number info. (wordslit): New grammar rule. * txr.1: Updated.
* * eval.c (eval_init): Register last function as intrinsic.Kaz Kylheku2014-03-231-0/+16
| | | | | | | | * lib.c (last): New function. * lib.h (last): Declared. * txr.1: Documented last.
* * eval.c (eval_init): Register empty as intrinsic.Kaz Kylheku2014-03-231-3/+17
| | | | | | | | | | | | * lib.c (copy): Bugfix: handle lazy strings. Also, handle hash tables via copy_hash. (length): Bugifx: handle lazy strings. Also, handle hash tables via hash_count. (empty): New function. * lib.h (empty): Declared. * txr.1: Documented.
* * eval.c (not_s): New symbol var.Kaz Kylheku2014-03-231-3/+37
| | | | | | | (me_unless, me_while, m_until): New static functions. (eval_init): Register macros unless, while and until. * txr.1: Document unless, while and until.
* Version 87.txr-87Kaz Kylheku2014-03-221-2/+2
|
* txr.1: Improve dwim operator description.Kaz Kylheku2014-03-221-11/+28
|
* * eval.c (me_when): New static function.Kaz Kylheku2014-03-221-0/+15
| | | | | | (eval_init): Register "when" macro. * txr.1: Documented when macro.
* * arith.c (tofloat, toint): New functions.Kaz Kylheku2014-03-191-0/+26
| | | | | | | | | * arith.h (tofloat, toint): Declared. * eval.c (eval_init): tofloat and toint registered as intrinsics. * txr.1: Documented.
* Version 86.txr-86Kaz Kylheku2014-03-161-2/+2
|
* Document that leading whitespace before a backslash lineKaz Kylheku2014-03-151-2/+15
| | | | continuator is also deleted in string literals.
* * parser.l: Bugfix. When handling a backslash-newline continuationKaz Kylheku2014-03-151-2/+5
| | | | | | | | | | | | | | | | in the SPECIAL, NESTED and BRACED states, do not pop the state in all three, only in SPECIAL (to terminate the @\ continuation). * txr.1: Eliminate wrong claim that string literals do not split across lines, which is directly contradicted two paragraphs later. Document that quasiliterals also split. * genvim.txr (txr_regex, txl_regex): These definitions change from "syn match" to "syn region" so that the backslash-newline continuation can be properly handled. (txr_string, txr_quasilit): Correctly handle split literals. * txr.vim: Regenerated.
* * parser.y (text): Allow the EMPTY token (the @(empty) syntax)Kaz Kylheku2014-03-151-0/+6
| | | | | | to be a text. * txr.1: Documented @(empty).
* * eval.c (eval_init): Make seed argument optional in make-random-state.Kaz Kylheku2014-03-141-3/+24
| | | | | | | | | | | | | | | * rand.c (make_random_state): Do argument defaulting on seed. Also, mix getpid() into the seed. (random_fixnum): Bugfix: do proper defaulting on optional agument, rather than relying on nil. (random): Fix 2014-02-05 regression. This was totally broken, ignoring the random state passed in and using the global random state. This function must only use the state passed in; there is no defaulting to the global random state. * txr.1: Documenting that seed is optional in make-random-state. Describing what guarantees can be expected with regard to calls made close together temporally.
* Implementing @(if)/@(elif)/@(else) in the pattern language.Kaz Kylheku2014-03-131-5/+91
| | | | | | | | | | | | | | | | Input side for now; output later. * parser.y (if_clause, elif_clauses_opt, else_clause_opt): New nonterminals. (IF, ELIF, ELSE): New tokens. (yybadtoken): Handle IF, ELIF, ELSE. * parser.l: Recognize and return new tokens IF, ELIF and ELSE. * txr.1: Documented. * genvim.txr: Updated with if, elsif and else directive keywords. * txr.vim: Regenerated
* * stream.c (open_process): If execvp fails, use errno as theKaz Kylheku2014-03-131-4/+33
| | | | | | exit status. (sh, run): New static functions. (stream_init): sh and run registered as intrinsics.
* * eval.c (plus_s, prof_s): New symbol global variables.Kaz Kylheku2014-03-121-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (op_prof, me_pprof): New static functions. (eval_init): Intern prof symbol, store in prof_s. Captured interned + symbol in plus_s. Register prof operator and pprof macro. * gc.c (gc_bytes): New global variable. (more): Use nse function chk_malloc_gc_more instead of chk_malloc. (make_obj): Increment gc_bytes. * lib.c (malloc_bytes): New global variable. (chk_malloc, chk_realloc): Increment malloc_bytes. (chk_calloc): Bugfix: incorrect size in recursion into oom_realloc. Incorrect calculation of malloc_high_bound. Increment malloc_bytes. (chk_malloc_gc_more): New function. * lib.h (alloc_bytes_t): New typedef. (malloc_bytes, gc_bytes): Declared. (chk_malloc_gc_more): Declared. * stream.c (format_s): New symbol global. (stream_init): format_s inited. format_s used to register formatv function. * stream.h (format_s): Declared. * txr.1: Documented prof and pprof. * genvim.txr: Recognize reg_fun calls with intern followed by a preceding assignment or other syntax. * txr.vim: Updated.
* * eval.c (eval_init): Registration of url_encode and url_decodeKaz Kylheku2014-03-111-0/+155
| | | | | | | | | | | | | | | | moved to filter.c. * filter.c (trie_compress_intrinsic, html_encode, html_decode): New static functions. (filter_init): Register make_trie, trie_add, trie_compress_intrinsic, filter_string_tree, filter_equal, html_encode and html_decode as intrinsics. Move registration of url_encode and url_decode here. * genvim.txr: Look for registrations in filter.c too. * txr.1: Documented. * txr.vim: Updated.
* * stream.c (pipe_close): Restructured the function a bit.Kaz Kylheku2014-03-101-1/+18
| | | | | | | | | | Do not throw exceptions for normal process terminations, only for abnormal ones (terminated by a signal). Return the termination status instead of just t. * txr.1: Fixed the neglected documentation of the optional boolean argument of close-stream. Described the behaviors with regard to pipes in more detail.
* Version 85.txr-85Kaz Kylheku2014-03-081-2/+2
|
* * txr.1: Added missing documentation for @(forget)/@(local).Kaz Kylheku2014-03-081-0/+73
|
* Version 84.txr-84Kaz Kylheku2014-03-071-2/+2
|
* * lib.c (assert_s): New global variable.Kaz Kylheku2014-03-061-9/+60
| | | | | | | | | | | | | | | (obj_init): Intern assert symbol, store in assert_s. * lib.h (assert_s): Declared. * match.c (typed_error, v_assert, h_assert): New static functions. (dir_tables_init): Register v_assert and h_assert. Register assert_s as non-data-matching directive. * unwind.c (uw_init): Register assert as a subtype of error. * txr.1: Describe assert.
* * eval.c (apply_intrinsic, lazy_mapcar): Changed linkage to external.Kaz Kylheku2014-03-061-0/+43
| | | | | | | | | | | | | * eval.h (apply_intrinsic, lazy_mapcar): Declarations added. * stream.c (open_files, open_file_star): New functions. (stream_init): Registered new functions as intrinsics. * txr.1: Documented open-files and open-files*. Added to make-catenated-stream documentation. * genvim.txr: Replace bunch of code with open-files. * txr.vim: Regenerated.
* * stream.c (vformat): Fix broken parsing of parameteric width andKaz Kylheku2014-03-051-38/+58
| | | | | | | | | | | | precision (i.e. given by *). The simplest way to do this is to add a state vf_star which is similar to vf_digits, and reuses much of the logic via a goto. Fixing forgotten --fmt (push back char) when moving from vf_precision to vf_spec state due to unhandled character. Also, allowing a leading zero before a precision given as * so that computed precisions can be combined with zero padding. * txr.1: Documented leading zero better so it is clear it combines with *. Restructured documentation.
* * stream.c (put_line): Default string argument to empty string.Kaz Kylheku2014-03-051-2/+3
| | | | | | | (stream_init): Change how put_line is registered to take advantage of new optional parameter. * txr.1: Updated.
* * arith.c (logten): New function.Kaz Kylheku2014-03-041-1/+5
| | | | | | | | * eval.c (eval_init): logten registered as intrinsic. * lib.h (logten): Declared. * txr.1: Documented.
* * parser.l: Allowing ^ to be a quote character, and adjusting definitionKaz Kylheku2014-03-031-77/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of identifiers to rule this out from being the first character of a symbol which has no prefix. Recognize the ^ character as a token in the NESTED state. * lib.c (obj_print, obj_pprint): Render sys:qquote as ^. * parser.y (choose_quote): Function removed. (n_expr): Recognize '^' as quasiquote. Removed all the "smart quote" hacks that try to make quote behave as quote or quasiquote, or try to cancel out unquotes and quotes. * tests/009/json.txr: Fixed to ^ quasiquote. * tests/010/reghash.txr: Likewise. * tests/011/macros-2.txr: Likewise. * tests/011/mandel.txr: Likewise. * tests/011/special-1.txr: Likewise. * txr.1: Updated docs. * genvim.txr: Revamped definitions for txr_ident and txl_ident so that unqualified identifiers cannot start with # or ^, but ones with @ or : in front can start with these characters. * txr.vim: Regenerated.
* Fix bad .TP syntax.Kaz Kylheku2014-03-031-3/+7
|
* * txr.1: Incorporating more corrections from Roman Mishin.Kaz Kylheku2014-03-021-39/+31
|
* * eval.c (make_env_intrinsic): New static function.Kaz Kylheku2014-03-021-0/+43
| | | | | | (eval_init): Register new intrinsics make-env, env-fbind and env-vbind. * txr.1: Documented.
* Version 83txr-83Kaz Kylheku2014-03-021-1/+1
| | | | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version, set date. * configure (txr_ver): Bumped. * RELNOTES: Updated * dep.mk: Updated.