1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

merge from 1.8 branch

This commit is contained in:
Kevin Ryde 2006-10-09 22:59:10 +00:00
parent 40296bab81
commit afc4ccd4dd
7 changed files with 77 additions and 33 deletions

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006
@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@ -511,3 +511,8 @@ behaviour as well as the more traditional @code{trace-here}.
The older mechanism will probably become obsolete eventually, but it's
worth keeping it around for a while until we are sure that the new
mechanism is correct and does what programmers need.
@c Local Variables:
@c TeX-master: "guile.texi"
@c End:

View file

@ -9,6 +9,10 @@
globals. Save and restore the new-input- and continuation-
prompts around the REPL read call.
2006-10-05 Kevin Ryde <user42@zip.com.au>
* ice-9/readline.scm (filename-completion-function): Export this.
2006-04-17 Kevin Ryde <user42@zip.com.au>
* ice-9/readline.scm: Bump lib file version to libguilereadline-v-18,

View file

@ -27,7 +27,8 @@
:use-module (ice-9 session)
:use-module (ice-9 regex)
:use-module (ice-9 buffered-input)
:no-backtrace)
:no-backtrace
:export (filename-completion-function))

View file

@ -1,3 +1,11 @@
2006-10-05 Kevin Ryde <user42@zip.com.au>
* ftw.scm (visited?-proc): Use hashv since we know we're getting
numbers. Incorporate stat:dev, since stat:ino is only unique within a
single device. This fixes a bug where if two files with the same
inode on different devices where seen only the first would be returned
by ftw (and nftw).
2006-10-03 Neil Jerram <neil@ossau.uklinux.net>
* gds-client.scm (run-utility): Remove unnecessary
@ -22,6 +30,18 @@
(info-args, info-frame, position, evaluate): Docstring
improvements.
2006-09-23 Kevin Ryde <user42@zip.com.au>
* boot-9.scm (log, log10, exp, sqrt): Remove, now in
libguile/numbers.c.
2006-09-07 Kevin Ryde <user42@zip.com.au>
* format.scm: Module "(ice-9 threads)" no longer used, now no mutex.
(format:parse-float): Fix normalization of leading zeros like "02.5"
to "2.5". left-zeros was zeroed before adjusting format:fn-dot,
resulting in the latter being unchanged.
2006-08-18 Neil Jerram <neil@ossau.uklinux.net>
* debugging/trc.scm: New file.
@ -44,6 +64,13 @@
* Makefile.am (SUBDIRS): Add debugging.
2006-08-02 Kevin Ryde <user42@zip.com.au>
* boot-9.scm (%record-type-check): New function.
(record-accessor, record-modifier): Use it for a strict type check of
the given record. Previously an accessor returned #f on a wrong
record type, and modifier silently did nothing.
2006-06-19 Neil Jerram <neil@ossau.uklinux.net>
* Makefile.am (ice9_sources): Add new files.

View file

@ -429,13 +429,20 @@
(define (record-predicate rtd)
(lambda (obj) (and (struct? obj) (eq? rtd (struct-vtable obj)))))
(define (%record-type-check rtd obj) ;; private helper
(or (eq? rtd (record-type-descriptor obj))
(scm-error 'wrong-type-arg "%record-type-check"
"Wrong type record (want `~S'): ~S"
(list (record-type-name rtd) obj)
#f)))
(define (record-accessor rtd field-name)
(let* ((pos (list-index (record-type-fields rtd) field-name)))
(if (not pos)
(error 'no-such-field field-name))
(local-eval `(lambda (obj)
(and (eq? ',rtd (record-type-descriptor obj))
(struct-ref obj ,pos)))
(%record-type-check ',rtd obj)
(struct-ref obj ,pos))
the-root-environment)))
(define (record-modifier rtd field-name)
@ -443,8 +450,8 @@
(if (not pos)
(error 'no-such-field field-name))
(local-eval `(lambda (obj val)
(and (eq? ',rtd (record-type-descriptor obj))
(struct-set! obj ,pos val)))
(%record-type-check ',rtd obj)
(struct-set! obj ,pos val))
the-root-environment)))
@ -779,21 +786,6 @@
;;; See the file `COPYING' for terms applying to this program.
;;;
(define (exp z)
(if (real? z) ($exp z)
(make-polar ($exp (real-part z)) (imag-part z))))
(define (log z)
(if (and (real? z) (>= z 0))
($log z)
(make-rectangular ($log (magnitude z)) (angle z))))
(define (sqrt z)
(if (real? z)
(if (negative? z) (make-rectangular 0 ($sqrt (- z)))
($sqrt z))
(make-polar ($sqrt (magnitude z)) (/ (angle z) 2))))
(define expt
(let ((integer-expt integer-expt))
(lambda (z1 z2)
@ -868,9 +860,6 @@
(/ (log (/ (- +i z) (+ +i z))) +2i))
($atan2 z (car y))))
(define (log10 arg)
(/ (log arg) (log 10)))
;;; {Reader Extensions}

View file

@ -13,7 +13,6 @@
(define-module (ice-9 format)
:use-module (ice-9 and-let-star)
:use-module (ice-9 threads)
:autoload (ice-9 pretty-print) (pretty-print)
:replace (format)
:export (format:symbol-case-conv
@ -1461,8 +1460,8 @@
(if (> format:fn-dot left-zeros)
(begin ; norm 0{0}nn.mm to nn.mm
(format:fn-shiftleft left-zeros)
(set! left-zeros 0)
(set! format:fn-dot (- format:fn-dot left-zeros)))
(set! format:fn-dot (- format:fn-dot left-zeros))
(set! left-zeros 0))
(begin ; normalize 0{0}.nnn to .nnn
(format:fn-shiftleft format:fn-dot)
(set! left-zeros (- left-zeros format:fn-dot))

View file

@ -217,14 +217,33 @@
(define (abs? filename)
(char=? #\/ (string-ref filename 0)))
;; `visited?-proc' returns a test procedure VISITED? which when called as
;; (VISITED? stat-obj) returns #f the first time a distinct file is seen,
;; then #t on any subsequent sighting of it.
;;
;; stat:dev and stat:ino together uniquely identify a file (see "Attribute
;; Meanings" in the glibc manual). Often there'll be just one dev, and
;; usually there's just a handful mounted, so the strategy here is a small
;; hash table indexed by dev, containing hash tables indexed by ino.
;;
;; It'd be possible to make a pair (dev . ino) and use that as the key to a
;; single hash table. It'd use an extra pair for every file visited, but
;; might be a little faster if it meant less scheme code.
;;
(define (visited?-proc size)
(let ((visited (make-hash-table size)))
(let ((dev-hash (make-hash-table 7)))
(lambda (s)
(and s (let ((ino (stat:ino s)))
(or (hash-ref visited ino)
(begin
(hash-set! visited ino #t)
#f)))))))
(and s
(let ((ino-hash (hashv-ref dev-hash (stat:dev s)))
(ino (stat:ino s)))
(or ino-hash
(begin
(set! ino-hash (make-hash-table size))
(hashv-set! dev-hash (stat:dev s) ino-hash)))
(or (hashv-ref ino-hash ino)
(begin
(hashv-set! ino-hash ino #t)
#f)))))))
(define (stat-dir-readable?-proc uid gid)
(let ((uid (getuid))