summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* * configure: Added test for <sys/stat.h>Kaz Kylheku2012-09-116-0/+132
| | | | | | | | | | | | | | | * eval.c: New intrinsic functions "stat" and "prop". * stream.c: Include <sys/stat.h> if we have it. (w_stat, statf): New functions. (val dev_k, ino_k, mode_k, nlink_k, uid_k, val gid_k, rdev_k, size_k, blksize_k, blocks_k; val atime_k, mtime_k, ctime_k): New sybol variables. (stream_init): Intern new keywords symbols. * stream.h (statf): Declared. * txr.1: prop documented. Stub for stat created.
* * eval.c (eval_init): new instrinsic function /= registered.Kaz Kylheku2012-09-115-0/+39
| | | | | | | | * lib.c (numneqv): New function. * lib.h (numneqv): Declared. * txr.1: New function documented.
* Clarify when bug was introduced.Kaz Kylheku2012-09-111-1/+2
|
* * match.c (v_collect): Bug in processing of @(last) directive.Kaz Kylheku2012-09-102-1/+9
| | | | | | When a match for the @(last) material occured at the end of data, c->data was being mistakenly set to nil rather than t before breaking out of the loop, wreaking havoc.
* * txr.1: Documented string library.Kaz Kylheku2012-09-062-1/+375
|
* Spelling, grammar and stylistic fixes. Arguments in functionKaz Kylheku2012-09-031-228/+250
| | | | descriptions should be referred to in angle brackets.
* Some string functions documented.Kaz Kylheku2012-09-021-0/+222
|
* * eval.c (eval_init): Follow function renames.Kaz Kylheku2012-09-027-36/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * hash.c (make_hash): Likewise. * lib.c (assq): Renamed to assql for consistency. (aconsq_new): Renamed to aconsql_new. (aconsq_new_l): Renamed to aconsql_new_l. (alist_remove_test): Use equal rather than eq. Association lists use equal equality by default. (alist_nremove): Use memqual rather than memq. (alist_nremove1): Use equal rather than eq. (merge): Bugfix: unnecessary consing caused by using append instead of nconc on list pieces that are already destructively chopped up. This has implications for the efficiency of sort over lists! (multi_sort_less): Implement key functions. (multi_sort): Interface change: arguments rearranged, and new argument to specify key functions. * lib.h (assoc, assq, assql, aconsq_new, aconsq_new_l): Declarations renamed. (multi_sort): Declaration updated. * txr.1: Documented alist library, list sorting and completed documenting lazy library. * txr.vim: multi-sort highlighted.
* * txr.1: Lots of new documentation. Major rearrangement of document,Kaz Kylheku2012-09-012-1018/+1302
| | | | with new headings.
* * eval.c (symbol_function): Bugfix: return the function rather thanKaz Kylheku2012-09-012-1/+6
| | | | the whole binding.
* Fixing accidental edit.Kaz Kylheku2012-09-011-1/+1
|
* * txr.1: Minor corrections, and documented most stream functions,Kaz Kylheku2012-09-012-3/+192
| | | | except directory-related ones.
* * txr.1: Documented print, pprint, tostring and tostringp.Kaz Kylheku2012-09-012-0/+40
|
* * stream.c (vformat): Bugfix: under the ~a and ~s directives,Kaz Kylheku2012-08-313-1/+155
| | | | | | | apply field formatting to the object not only if a nonzero width has been specified, but also if precision has been specified. * txr.1: documented stream global variables and format.
* * eval.c (expand): Bugfix: failure to handle regularKaz Kylheku2012-08-312-0/+8
| | | | | expression syntax, resulting in (set ...) syntax being regarded as assignment (due to another recent change).
* * txr.1: Documented chain, andf, orf and iff.Kaz Kylheku2012-08-302-0/+100
|
* * eval.c (eval_intrinsic): Bugfix: take the expanded form insteadKaz Kylheku2012-08-303-2/+25
| | | | | | | of throwing it away. (expand): Recurse into expand_place for (set ...) forms. * txr.1: Documented eval.
* * txr.1: Documented all functions related to hashing.Kaz Kylheku2012-08-302-2/+186
|
* * lib.c (multi_sort_less): Fixing semantics of return value. IndividualKaz Kylheku2012-08-292-2/+9
| | | | sorted lists are returned, rather than a list of zipped tuples.
* * lib.c (multi_sort_less): Change the semantics so that when theKaz Kylheku2012-08-292-5/+11
| | | | | list of the functions is empty, the left item is considered less than the right, thereby preserving the order.
* * eval.c (mapcarv): Changed to external linkage.Kaz Kylheku2012-08-296-1/+51
| | | | | | | | | | | | * eval.h (mapcarv): Declaration added. (eval_init): New intrinsic multi-sort registered. * lib.c (multi_sort_less): New static function. (multi_sort): New function. * lib.h (multi_sort): Declared. * txr.1: stub section added.
* * eval.c (eval_init): Registered open-command and open-processKaz Kylheku2012-05-185-9/+25
| | | | | | | | | | | | intrinsics. open-pipe is now deprecated but stays for backward compatibility as a synonym for open-command. * stream.c (open_pipe): Renamed to open_command. (open_pipevp): Renamed to open_process. * stream.h (open_pipe, open_pipevp): Declarations updated. * txr.1: Documentation headings updated.
* * stream.c (open_pipev): Bugfix: program name is includedKaz Kylheku2012-05-182-2/+7
| | | | as first element of argv.
* Implement open_pipev in terms of popen for Windows whichKaz Kylheku2012-05-182-1/+79
| | | | | | | | | | | | | does not have for or exec. We could use CreateProcess and CreatePipe, et cetera, but it won't buy us anything because the whole point of this function is to improve the argument passing, and CreateProcess takes a single command line string, not too different from popen. * stream.c (pipev_close, make_pipev_stream): Surrounded with HAVE_FORK_STUFF ifdef. (pipe_close): Choice of close strategy conditional on HAVE_FORK_STUFF. (open_pipev): Conditionally defined in two ways now. (win_escape_arg, win_make_cmdline): New static functions.
* * configure: New test added for fork, pipe, exec and waitpid.Kaz Kylheku2012-05-182-0/+36
| | | | Produces HAVE_FORK_STUFF in config.h.
* * match.c (complex_open): Likewise.Kaz Kylheku2012-05-183-2/+6
| | | | * stream.c (w_opendir): Likewise.
* * utf8.c (w_fopen, w_popen): Removing unnecessary casts ofKaz Kylheku2012-05-182-4/+9
| | | | return values of ut8_dup_to.
* Implementing new pipe function to get around the limitationKaz Kylheku2012-05-185-3/+128
| | | | | | | | | | | | | | | | | | | | | | | that popen accepts a complete command. We need something which accepts a program name, and a list of arguments, so that we don't have to assemble together a correctly quoted string. popen needs an alternative interface resembling execvp. * eval.c (eval_init): New intrinsic registered, open-pipe-args. * stream.c (struct stdio_handle): New member, pid. (stdio_stream_print): Print the pid, if it is nonzero. (pipevp_close): New close function. (pipe_close): If h->pid is nonzero, it's a new-style pipe, which must be closed with pipev_close. (make_stdio_stream, make_pipe_stream): Initialize new stdio_handle member to zero. (make_pipevp_stream): New static function. (open_pipevp): New function. * stream.h (open_pipevp): Declared. * txr.1: open-pipe-args added to stub section heading.
* * match.c (v_collect): Implemented semantics for repeat symbol.Kaz Kylheku2012-05-174-12/+59
| | | | | | | | | | | | | | | | (dir_tables_init): Register dispatch for repeat to v_collect function. * parser.y (collect_repeat): New nonterminal symbol. (clause): Removed repeat_clause error case because that now clashes with the syntax in collect_clause. (collect_clause): Repeat syntax implemented, with help of collect_repeat. (out_clause): Error case for collect_clause removed due to syntactic clash. * txr.1: Added mention of @(collect :vars nil) and documented @(repeat) as the shorthand.
* * configure: Do not capture the stderr of GNU Make in theKaz Kylheku2012-05-173-2/+48
| | | | | | configure step; send it to /dev/null. * txr.spec: Adding specfile for building RPMs.
* * eval.c (range_v_func, range_v_star_func): Restore the order ofKaz Kylheku2012-04-242-2/+13
| | | | | | | | | | arguments to plus, so that the from object is on the left. This change was introduced in a commit on 2012-02-14, causing character ranges to break due to bug that addition did not commute for char + fixnum. Although the previous commit fixed the regression, it's still good to have the object on the left in case there are some future data types in case there is ever some form of addition which does not commute.
* * arith.c (plus): Fixed broken (+ fixnum char) case.Kaz Kylheku2012-04-242-2/+6
|
* Fixes for configuring and building in a separate directory.Kaz Kylheku2012-04-203-10/+21
| | | | | | | | | | * configure: MPI is now extracted and patched in the build directory, not in the source directory. * Makefile (CFLAGS): Refer to mpi headers relative to current directory, not $(top_srcdir). (repatch): Run MPI repatching steps in correct directory. (clean): Remove extracted MPI from build directory.
* Version 65txr-65Kaz Kylheku2012-04-205-4/+61
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * regex.c (regex_space_chars): Variable removed.Kaz Kylheku2012-04-202-22/+26
| | | | | | | | | (char_set_addr_str): New function. (char_set_compile): Use char_set_addr_str to add spaces to set. (init_special_char_sets): Use char_set_addr_str to add spaces to set. Bugfix: word_cs, cword_cs wrongly initialized. (regex_init): Removed reference to regex_space_chars.
* * parser.y (regtoken): New nonterminal symbol.Kaz Kylheku2012-04-204-37/+68
| | | | | | | | | | | | | | | | (regterm): REGTOKEN production factored out to regtoken. (regclass): Reverted prior commmit's changes. (regclassterm): Reverted prior commit, removing REGTOKEN production for character classes, and introduced a regtoken production. So now the keyword symbols are part of the character class abstract syntax. (regtoken): New production rule. * regex.c (regex_space_chars): Converted to internal linkage. (char_set_compile): Handle token keywords in character class abstract syntax. * regex.h (regex_space_chars): External declaration removed.
* * txr.1: Documented new regex tokens.Kaz Kylheku2012-04-192-1/+17
|
* First cut at implementing \s, \d, \w, \S, \D and \W regex tokens.Kaz Kylheku2012-04-196-9/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib.c (init): Call regex_init. * parser.l: return new REGTOKEN kind. * parser.y (REGTOKEN): New token type. (REGTERM): Translate REGTERM to keyword. (regclass): Restructured to handle inherited nodes as lists. (regclassterm): Produce $$ as list. Add handling for REGTOKEN occurring inside character class by expanding it. This might not be the best approach. (yybadtoken): Handle REGTOKEN in switch. * regex.c (struct any_char_set, struct small_char_set, struct displaced_char_set, struct large_char_set, struct xlarge_char_set): New bitfield member, stat. (char_set_create): New parameter for indicating static char set. (char_set_destroy): Do not free a static char set. (char_set_compile): Pass zero to new parameter of char_set_create. (spaces): New static array. (space_cs, digit_cs, word_cs, cspace_cs, cdigit_cs, cword_cs): New static pointers to char_set_t. (init_special_char_sets, nfa_compile_given_set): New static function. (nfa_compile_regex, dv_compile_regex): Handle new character set token keywords. (space_k, digit_k, word_char_k, cspace_k, cdigit_k, cword_char_k, regex_space_chars): New variables. (regex_init): New function. * regex.h (space_k, digit_k, word_char_k, cspace_k, cdigit_k, cword_char_k, regex_space_chars, regex_init): Declared.
* * eval.c (eval_init): New intrinsic functions remq*, remql*,Kaz Kylheku2012-04-155-1/+111
| | | | | | | | | | | | | remqual*, remove-if*, keep-if*. * lib.c (rem_lazy_func, rem_lazy_rec): New static functions. (remq_lazy, remql_lazy, remqual_lazy, remove_if_lazy, keep_if_lazy): New functions. * lib.h (remq_lazy, remql_lazy, remqual_lazy, remove_if_lazy, keep_if_lazy): Declared. * txr.1: New functions documented.
* * eval.c (eval_init): find-if intrinsic registered.Kaz Kylheku2012-04-145-6/+42
| | | | | | | | | | | * lib.c (find): First and second arguments reversed. The item should be first. (find_if): New function. * lib.h (find): Declaration updated. (find_if): Declaration added. * txr.1: Stub section.
* * HACKING: Added notes on generational garbage collection.Kaz Kylheku2012-04-142-0/+114
|
* * eval.c (eval_init): New functions remove-if and keep-if.Kaz Kylheku2012-04-145-0/+99
| | | | | | | | * lib.c (remove_if, keep_if): New functions. * lib.h (remove_if, keep_if): Declared. * txr.1: Documented.
* * configure: Restructuring configure script to be able to detectKaz Kylheku2012-04-132-51/+76
| | | | | | | | | | nonexistent options. Variable default values are established first, which simplifies the syntax. The scanning loop detects attempts to create configuration variables that do not exist. The var_given convention is folded into the parsing. (If var exists, and var_given exists, and the user specifies var, then var_given is set to y to indicate that the value came from the user.)
* Bugfix: multiple uses of @(next :args) seeing junk "args" stringKaz Kylheku2012-04-132-18/+34
| | | | | | | | | | | | | | in argument list. Fix is not to rely on the hack of using the first element of the list of files to hold the name of the current file. * match.c (match_files_ctx): New member, curfile. (mf_all): Initialize curfile. (mf_args): Set curfile to "args". (mf_file_data): Initialize curfile. (v_skip, v_fuzz, v_gather, v_collect): Use c->curfile rater than first(c->files) in debug calls. (freeform_prepare, match_files): Pass c->curfile to ml_all constructor of match_line_ctx rather than rather than first(c->files).
* Improve the regex Lisp syntax by allowing strings to specifyKaz Kylheku2012-04-122-4/+24
| | | | | | | | | | | character compounds. I.e. the syntax "foo" is equivalent to the cumbersome canonical form (compound #\f #\o #\o). * regex.c (nfa_compile_regex, dv_compile_regex): Use chrp function instead of typeof. Handle stringp case by forming a compound out of the characters and recursing. Check for some bad objects in the regex that would never come out of our regex parser but could occur in a "hand crafted" syntax tree.
* * txr.1: Fixed wrong comment in example.Kaz Kylheku2012-04-111-1/+1
|
* * txr.1: Fix misleading comment example.Kaz Kylheku2012-04-112-1/+6
|
* Provide access to line number info and source path.Kaz Kylheku2012-04-116-1/+17
| | | | | | | | | | | | | | * eval.c (eval_init): New intrinsic functions source-loc and source-loc-str. New variable *self-path*. * txr.1: Stub doc sections. * txr.c (self_path): New variable. * txr.h (self_path): Declared. * txr.vim: Syntax highlighting for source-loc, source-loc-str and *self-path*.
* Adding patch to MPI to disable its Makefile so people don't tryKaz Kylheku2012-04-104-0/+66
| | | | | | | | | | | | | | to work around TXR build problems by running make inside the MPI directory, which is wrong. Also fixing an incorrect use of ctype.h functions in MPI and one case of a superfluous warning. * mpi-patches/series: new patches added. * mpi-patches/disable-make: New file. * mpi-patches/fix-ctype-warnings: New file.
* More NetBSD porting.Kaz Kylheku2012-04-104-2/+51
| | | | | | | | | | | | | | | | | | * Makefile (EXTRA_FLAGS): Handy new variable for additional ad-hoc CFLAGS. Needed by a new test in configure. * configure: Check for annoying warnings about char being used as an array subscript when calling the macros from <ctype.h>. If this occurs, suppress it by #undef-ing the macros. (lang_flags): Switching fromm _XOPEN_SOURCE to _XOPEN_SOURCE=2 because this is needed on NetBSD to obtain declarations of popen and pclose. * stream.c (pipe_close): If we don't have the WIFCONTINUED macro, then define it to expand to zero. It's absent on NetBSD and they already seem to have a hack for this because there is a warning about the function not being defined, but then the program links anyway. Let's do it properly and not rely on their hack.