summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * * mpi-patches/config-types: Include the header as "config.h"Kaz Kylheku2012-10-302-7/+7
| | | | | | | | | | | | | | | | rather than "../config.h" because the dependency generation script checks for this as a special case and treats it relative to the build directory. * dep.mk: Regenerated.
* | * arith.c (bignum_from_long): New function.Kaz Kylheku2012-10-014-6/+34
|/ | | | | | | | | * arith.h (bignum_from_long): Declared. * lib.c (int_str): Streamlined. Only use mp_read_radix in the case when wcstol fails, because now we have bignum_from_long to handle all values of long. Ensure that the bignum is normalized, in case it falls in the fixnum range (does not happen on our usual platforms).
* * eval.c: Allow the test form of a for loop to be omitted,Kaz Kylheku2012-09-253-6/+17
| | | | | | | defaulting to a true test, allowing an infinite loop to be expressed as (for () () () ...). * txr.1: Documented.
* Spelling dammit.Kaz Kylheku2012-09-251-1/+1
|
* * RELNOTES: Correct incorrect 2011 yeras on all 2012 dates.Kaz Kylheku2012-09-252-14/+19
| | | | How did that happen?
* * eval.c (apply): Fix in error message: hard coded "apply" insteadKaz Kylheku2012-09-242-1/+6
| | | | of using ctx_form.
* Bugfix: internal funcall functions not handling functionsKaz Kylheku2012-09-242-1/+123
| | | | | | | | | with optional arguments. * lib.c (generic_funcall): New static function, based on apply from eval.c. (funcall, funcall1, funcall2, funcall3, funcall4): If the function being called has optional arguments, then go through generic_funcall.
* * arith.c (logand): Fix incorrect return value.Kaz Kylheku2012-09-242-1/+5
|
* * arith.c (logtest): New function.Kaz Kylheku2012-09-187-3/+170
| | | | | | | | | | | | | | | | | | | | | | | * eval.c (eval_init): Registered logtest. Registered s-ifmt, s-iflnk, s-ifreg, s-ifblk, s-ifdir, s-ifchr, s-ififo, s-isuid, s-isgid, s-isvtx, s-irwxu, s-irusr, s-iwusr, s-ixusr, s-irwxg, s-irgrp, s-iwgrp, s-ixgrp, s-irwxo, s-iroth, s-iwoth, s-ixoth variables. * lib.h (logtest): Declared. * stream.c (s_ifmt, s_ifsock, s_iflnk, s_ifreg, s_ifblk, s_ifdir, s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx, s_irwxu, s_irusr, s_iwusr, s_ixusr, s_irwxg, s_irgrp, s_iwgrp, s_ixgrp, s_irwxo, s_iroth, s_iwoth, s_ixoth): New global variables. * stream.h (s_ifmt, s_ifsock, s_iflnk, s_ifreg, s_ifblk, s_ifdir, s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx, s_irwxu, s_irusr, s_iwusr, s_ixusr, s_irwxg, s_irgrp, s_iwgrp, s_ixgrp, s_irwxo, s_iroth, s_iwoth, s_ixoth): Declared. * txr.1: Documented logtest and s-* variables for stat, as well as open-file and open-directory.
* Documenting bit ops.Kaz Kylheku2012-09-171-0/+101
|
* Bring syntax highlighting function list up to date.Kaz Kylheku2012-09-171-5/+7
|
* * stream.c (vformat): Slight change in ~s directive. For a floatingKaz Kylheku2012-09-173-2/+12
| | | | | | | | | point integer, .0 is now always shown if the precision is not given, or if it is given and nonzero. Previous behavior of ~s was add .0 only when a precision is not specified. The new behavior is more sensible and consistent with documentation. * txr.1: Typo fixed in related documentation.
* * arith.c (comp_trunc, logcomp): logcomp renamed to lognot,Kaz Kylheku2012-09-174-8/+17
| | | | | | | | consistent with Common Lisp. * eval.c (eval_init): logcomp to lognot. * lib.h (logcomp): Declaration updated.
* * arith.c (highest_significant_bit): New static function.Kaz Kylheku2012-09-175-11/+262
| | | | | | | | | | | | | | | | (comp_clamp): Bugfix: avoid shifting left into sign bit. Function renamed to comp_trunc. (logtrunc, ash): New functions. * eval.c (eval_init): Registered logtrunc and ash intrinsics. * lib.h (logtrunc, ash): Declared. * mpi-patches/add-bitops (s_highest_bit_mp): Forward declaration for added. (mp_clamp_comp): Bugfix in handling remainder bits. Function renamed to mp_trunc_comp. (mp_trunc, mp_shift): New functions.
* * mpi-patches/add-bitops: Bugfixes: mp_2comp is extended to properlyKaz Kylheku2012-09-162-13/+26
| | | | | | | | allow arbitrarily wide complements (which causes the code to access beyond the a argument's digits array). A similar fix is applied in the new mp_clamp_comp function. Incorrect initializations of mp_int fixed in all the logic functions: mp_init was used instead of mp_init_size.
* * arith.c (logand, logior, logxor): Bugfix: result needs to beKaz Kylheku2012-09-165-10/+111
| | | | | | | | | | | | | | normalized, otherwise we end up with fixnum-range bignums. (comp_clamp): New function. (logcomp): Changed to two argument form. If second argument is present (not nil) then call comp_clamp. * eval.c (eval_init): Change registration of logcomp to allow optional argument. * lib.h (logcomp): Declaration updated. * mpi-patches/add-bitops: New mp_clamp_comp function implemented.
* Adding complementing function.Kaz Kylheku2012-09-165-7/+85
| | | | | | | | | | * arith.c (logcomp): New function. * eval.c (eval_init): logcomp registered as intrinsic. * lib.h (logcomp) declared. * mpi-patches/add-bitops: Fixed bugs in mp_xor. Implemented mp_comp.
* Starting work on adding bit operations. The semantics is thatKaz Kylheku2012-09-166-0/+418
| | | | | | | | | | | | | | negative integers behave as an "infinite bit two's complement". * arith.c (logand, logor, logxor): New functions. * eval.c (eval_init): New intrinsic functions logand, logior, logxor. * lib.h (logand, logor, logxor): Declared. * mpi-patches/series: New patch, add-bitops. * mpi-patches/add-bitops: New file.
* * stream.c (vformat): Fix bug in ~x format directive for printingKaz Kylheku2012-09-162-14/+17
| | | | | | | | integers in hex. When we use the printf's %x conversion specifiers for fixnums, we get incorrect results when the values are negative, because the argument is actually treated as an unsigned integer. The end result is that (format t "~x" -1) produces FFFFFFFF rather than -1. Also, merged together mindless code duplication.
* * parser.l: Implemented hexadecimal integer constants.Kaz Kylheku2012-09-163-5/+44
| | | | | | | These will be very useful since bit operations are about to be implemented. * txr.1: Documented.
* * eval.c (eval_init): New intrinsics: make-similar-hash, copy-hash,Kaz Kylheku2012-09-126-3/+209
| | | | | | | | | | | | | | hash-uni, hash-diff, hash-isec. * hash.c (make_similar_hash, copy_hash, hash_uni, hash_diff, hash_isec): New functions. * hash.h (make_similar_hash, copy_hash, hash_uni, hash_diff, hash_isec): Declared. * txr.1: Updated. * txr.vim: Highlighting for these new functions.
* Vector functions documented.Kaz Kylheku2012-09-111-1/+170
|
* * 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.