1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Fix typos leading to unbound variable references.

* module/ice-9/session.scm (help): Fix unbound reference to `env'.

* module/system/vm/program.scm (program-property): Fix typo.

* module/system/vm/frame.scm: Add missing `#:use-module (system vm
  objcode)'.

* module/system/repl/command.scm (guile:load): New.
  (load): Use either `primitive-load' or `load'.

* module/srfi/srfi-18.scm (thread-sleep!): Fix typo.

* module/srfi/srfi-19.scm: Use `(ice-9 rdelim)'.
  (date->broken-down-time, priv:year-day, priv:char->int): Fix typo.
  (time-*->time-*, time-*->time-*!): Fix reference to unbound variable
  `caller'.

* module/oop/goops.scm (bound-check-get): Fix typo.

* module/language/glil/compile-assembly.scm (glil->assembly): Fix typo.

* module/language/glil.scm (parse-glil): Fix typo.

* module/language/ecmascript/base.scm (object->value/string,
  object->value/number, ->number): Fix typos.

* module/language/assembly/disassemble.scm (disassemble-free-vars): Fix
  typo.
This commit is contained in:
Ludovic Courtès 2009-10-22 22:42:45 +02:00
parent 6bb891dc61
commit 84012ef4b1
11 changed files with 44 additions and 34 deletions

View file

@ -1,4 +1,4 @@
;;;; Copyright (C) 1997, 2000, 2001, 2003, 2006 Free Software Foundation, Inc.
;;;; Copyright (C) 1997, 2000, 2001, 2003, 2006, 2009 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@ -112,7 +112,8 @@ You don't seem to have regular expressions installed.\n")
(= (length name) 2)
(eq? (car name) 'unquote))
(let ((doc (try-value-help (cadr name)
(local-eval (cadr name) env))))
(module-ref (current-module)
(cadr name)))))
(cond ((not doc) (not-found 'documentation (cadr name)))
((eq? doc #t)) ;; pass
(else (write-line doc)))))

View file

@ -95,7 +95,7 @@
(define (disassemble-free-vars free-vars)
(display "Free variables:\n\n")
(let ((i 0))
(let lp ((i 0))
(cond ((< i (vector-length free-vars))
(print-info i (vector-ref free-vars i) #f #f)
(lp (1+ i))))))

View file

@ -149,14 +149,14 @@
o))))
(define (object->value/string o)
(if (is-a? x <js-object>)
(if (is-a? o <js-object>)
(object->number o #t)
x))
o))
(define (object->value/number o)
(if (is-a? x <js-object>)
(if (is-a? o <js-object>)
(object->string o #t)
x))
o))
(define (object->value o)
;; FIXME: if it's a date, we should try numbers first
@ -176,7 +176,7 @@
((boolean? x) (if x 1 0))
((null? x) 0)
((eq? x *undefined*) +nan.0)
((is-a? x <js-object>) (object->number o))
((is-a? x <js-object>) (object->number x))
((string? x) (string->number x))
(else (throw 'TypeError o '->number))))

View file

@ -105,7 +105,7 @@
((toplevel ,op ,name) (make-glil-toplevel op name))
((module public ,op ,mod ,name) (make-glil-module op mod name #t))
((module private ,op ,mod ,name) (make-glil-module op mod name #f))
((label ,label) (make-label label))
((label ,label) (make-glil-label label))
((branch ,inst ,label) (make-glil-branch inst label))
((call ,inst ,nargs) (make-glil-call inst nargs))
((mv-call ,nargs ,ra) (make-glil-mv-call nargs ra))

View file

@ -262,8 +262,8 @@
((empty-box) `((empty-box ,index)))
((fix) `((fix-closure 0 ,index)))
(else (error "what" op)))
(let ((a (quotient i 256))
(b (modulo i 256)))
(let ((a (quotient index 256))
(b (modulo index 256)))
`((,(case op
((ref)
(if boxed?

View file

@ -1157,7 +1157,7 @@
(define-standard-accessor-method ((bound-check-get n) o)
(let ((x (@slot-ref o n)))
(if (unbound? x)
(slot-unbound obj)
(slot-unbound o)
x)))
(define-standard-accessor-method ((standard-get n) o)

View file

@ -1,6 +1,6 @@
;;; srfi-18.scm --- Multithreading support
;; Copyright (C) 2008 Free Software Foundation, Inc.
;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
;;
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
@ -232,7 +232,7 @@
(let* ((ct (time->seconds (current-time)))
(t (cond ((time? timeout) (- (time->seconds timeout) ct))
((number? timeout) (- timeout ct))
(else (scm-error 'wrong-type-arg caller
(else (scm-error 'wrong-type-arg "thread-sleep!"
"Wrong type argument: ~S"
(list timeout)
'()))))

View file

@ -42,6 +42,7 @@
:use-module (srfi srfi-6)
:use-module (srfi srfi-8)
:use-module (srfi srfi-9)
:autoload (ice-9 rdelim) (read-line)
:use-module (ice-9 i18n))
(begin-deprecated
@ -300,7 +301,7 @@
(set-tm:hour result (date-hour date))
;; FIXME: SRFI day ranges from 0-31. (not compatible with set-tm:mday).
(set-tm:mday result (date-day date))
(set-tm:month result (- (date-month date) 1))
(set-tm:mon result (- (date-month date) 1))
;; FIXME: need to signal error on range violation.
(set-tm:year result (+ 1900 (date-year date)))
(set-tm:isdst result -1)
@ -489,33 +490,38 @@
;; -- these depend on time-monotonic having the same definition as time-tai!
(define (time-monotonic->time-utc time-in)
(if (not (eq? (time-type time-in) time-monotonic))
(priv:time-error caller 'incompatible-time-types time-in))
(priv:time-error 'time-monotonic->time-utc
'incompatible-time-types time-in))
(let ((ntime (copy-time time-in)))
(set-time-type! ntime time-tai)
(priv:time-tai->time-utc! ntime ntime 'time-monotonic->time-utc)))
(define (time-monotonic->time-utc! time-in)
(if (not (eq? (time-type time-in) time-monotonic))
(priv:time-error caller 'incompatible-time-types time-in))
(priv:time-error 'time-monotonic->time-utc!
'incompatible-time-types time-in))
(set-time-type! time-in time-tai)
(priv:time-tai->time-utc! ntime ntime 'time-monotonic->time-utc))
(priv:time-tai->time-utc! time-in time-in 'time-monotonic->time-utc))
(define (time-monotonic->time-tai time-in)
(if (not (eq? (time-type time-in) time-monotonic))
(priv:time-error caller 'incompatible-time-types time-in))
(priv:time-error 'time-monotonic->time-tai
'incompatible-time-types time-in))
(let ((ntime (copy-time time-in)))
(set-time-type! ntime time-tai)
ntime))
(define (time-monotonic->time-tai! time-in)
(if (not (eq? (time-type time-in) time-monotonic))
(priv:time-error caller 'incompatible-time-types time-in))
(priv:time-error 'time-monotonic->time-tai!
'incompatible-time-types time-in))
(set-time-type! time-in time-tai)
time-in)
(define (time-utc->time-monotonic time-in)
(if (not (eq? (time-type time-in) time-utc))
(priv:time-error caller 'incompatible-time-types time-in))
(priv:time-error 'time-utc->time-monotonic
'incompatible-time-types time-in))
(let ((ntime (priv:time-utc->time-tai! time-in (make-time-unnormalized #f #f #f)
'time-utc->time-monotonic)))
(set-time-type! ntime time-monotonic)
@ -523,7 +529,8 @@
(define (time-utc->time-monotonic! time-in)
(if (not (eq? (time-type time-in) time-utc))
(priv:time-error caller 'incompatible-time-types time-in))
(priv:time-error 'time-utc->time-monotonic!
'incompatible-time-types time-in))
(let ((ntime (priv:time-utc->time-tai! time-in time-in
'time-utc->time-monotonic!)))
(set-time-type! ntime time-monotonic)
@ -531,14 +538,16 @@
(define (time-tai->time-monotonic time-in)
(if (not (eq? (time-type time-in) time-tai))
(priv:time-error caller 'incompatible-time-types time-in))
(priv:time-error 'time-tai->time-monotonic
'incompatible-time-types time-in))
(let ((ntime (copy-time time-in)))
(set-time-type! ntime time-monotonic)
ntime))
(define (time-tai->time-monotonic! time-in)
(if (not (eq? (time-type time-in) time-tai))
(priv:time-error caller 'incompatible-time-types time-in))
(priv:time-error 'time-tai->time-monotonic!
'incompatible-time-types time-in))
(set-time-type! time-in time-monotonic)
time-in)
@ -741,7 +750,7 @@
(define (priv:year-day day month year)
(let ((days-pr (assoc month priv:month-assoc)))
(if (not days-pr)
(priv:error 'date-year-day 'invalid-month-specification month))
(priv:time-error 'date-year-day 'invalid-month-specification month))
(if (and (priv:leap-year? year) (> month 2))
(+ day (cdr days-pr) 1)
(+ day (cdr days-pr)))))
@ -1216,7 +1225,7 @@
((#\8) 8)
((#\9) 9)
(else (priv:time-error 'bad-date-template-string
(list "Non-integer character" ch i)))))
(list "Non-integer character" ch)))))
;; read an integer upto n characters long on port; upto -> #f is any length
(define (priv:integer-reader upto port)

View file

@ -267,16 +267,16 @@ Import modules / List those imported."
(for-each puts (map module-name (module-uses (current-module))))
(for-each use args))))
(define guile:load load)
(define-meta-command (load repl file . opts)
"load FILE
Load a file in the current module.
-f Load source file (see `compile')"
(let* ((file (->string file))
(objcode (if (memq #:f opts)
(apply load-source-file file opts)
(apply load-file file opts))))
(vm-load (repl-vm repl) objcode)))
(let ((file (->string file)))
(if (memq #:f opts)
(primitive-load file)
(guile:load file))))
(define-meta-command (binding repl)
"binding

View file

@ -1,7 +1,6 @@
;;; Guile VM frame functions
;;; Copyright (C) 2001, 2009 Free Software Foundation, Inc.
;;; Copyright (C) 2005 Ludovic Courtès <ludovic.courtes@laas.fr>
;;; Copyright (C) 2001, 2005, 2009 Free Software Foundation, Inc.
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
@ -22,6 +21,7 @@
(define-module (system vm frame)
#:use-module (system vm program)
#:use-module (system vm instruction)
#:use-module (system vm objcode)
#:use-module ((srfi srfi-1) #:select (fold))
#:export (vm-frame?
vm-frame-program

View file

@ -59,7 +59,7 @@
(cdddr source))
(define (program-property prog prop)
(assq-ref (program-properties proc) prop))
(assq-ref (program-properties prog) prop))
(define (program-documentation prog)
(assq-ref (program-properties prog) 'documentation))