1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-09 15:10:29 +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 ;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public ;;;; 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) (= (length name) 2)
(eq? (car name) 'unquote)) (eq? (car name) 'unquote))
(let ((doc (try-value-help (cadr name) (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))) (cond ((not doc) (not-found 'documentation (cadr name)))
((eq? doc #t)) ;; pass ((eq? doc #t)) ;; pass
(else (write-line doc))))) (else (write-line doc)))))

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
;;; srfi-18.scm --- Multithreading support ;;; 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 ;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public ;; modify it under the terms of the GNU Lesser General Public
@ -232,7 +232,7 @@
(let* ((ct (time->seconds (current-time))) (let* ((ct (time->seconds (current-time)))
(t (cond ((time? timeout) (- (time->seconds timeout) ct)) (t (cond ((time? timeout) (- (time->seconds timeout) ct))
((number? timeout) (- 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" "Wrong type argument: ~S"
(list timeout) (list timeout)
'())))) '()))))

View file

@ -42,6 +42,7 @@
:use-module (srfi srfi-6) :use-module (srfi srfi-6)
:use-module (srfi srfi-8) :use-module (srfi srfi-8)
:use-module (srfi srfi-9) :use-module (srfi srfi-9)
:autoload (ice-9 rdelim) (read-line)
:use-module (ice-9 i18n)) :use-module (ice-9 i18n))
(begin-deprecated (begin-deprecated
@ -300,7 +301,7 @@
(set-tm:hour result (date-hour date)) (set-tm:hour result (date-hour date))
;; FIXME: SRFI day ranges from 0-31. (not compatible with set-tm:mday). ;; FIXME: SRFI day ranges from 0-31. (not compatible with set-tm:mday).
(set-tm:mday result (date-day date)) (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. ;; FIXME: need to signal error on range violation.
(set-tm:year result (+ 1900 (date-year date))) (set-tm:year result (+ 1900 (date-year date)))
(set-tm:isdst result -1) (set-tm:isdst result -1)
@ -489,33 +490,38 @@
;; -- these depend on time-monotonic having the same definition as time-tai! ;; -- these depend on time-monotonic having the same definition as time-tai!
(define (time-monotonic->time-utc time-in) (define (time-monotonic->time-utc time-in)
(if (not (eq? (time-type time-in) time-monotonic)) (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))) (let ((ntime (copy-time time-in)))
(set-time-type! ntime time-tai) (set-time-type! ntime time-tai)
(priv:time-tai->time-utc! ntime ntime 'time-monotonic->time-utc))) (priv:time-tai->time-utc! ntime ntime 'time-monotonic->time-utc)))
(define (time-monotonic->time-utc! time-in) (define (time-monotonic->time-utc! time-in)
(if (not (eq? (time-type time-in) time-monotonic)) (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) (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) (define (time-monotonic->time-tai time-in)
(if (not (eq? (time-type time-in) time-monotonic)) (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))) (let ((ntime (copy-time time-in)))
(set-time-type! ntime time-tai) (set-time-type! ntime time-tai)
ntime)) ntime))
(define (time-monotonic->time-tai! time-in) (define (time-monotonic->time-tai! time-in)
(if (not (eq? (time-type time-in) time-monotonic)) (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) (set-time-type! time-in time-tai)
time-in) time-in)
(define (time-utc->time-monotonic time-in) (define (time-utc->time-monotonic time-in)
(if (not (eq? (time-type time-in) time-utc)) (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) (let ((ntime (priv:time-utc->time-tai! time-in (make-time-unnormalized #f #f #f)
'time-utc->time-monotonic))) 'time-utc->time-monotonic)))
(set-time-type! ntime time-monotonic) (set-time-type! ntime time-monotonic)
@ -523,7 +529,8 @@
(define (time-utc->time-monotonic! time-in) (define (time-utc->time-monotonic! time-in)
(if (not (eq? (time-type time-in) time-utc)) (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 (let ((ntime (priv:time-utc->time-tai! time-in time-in
'time-utc->time-monotonic!))) 'time-utc->time-monotonic!)))
(set-time-type! ntime time-monotonic) (set-time-type! ntime time-monotonic)
@ -531,14 +538,16 @@
(define (time-tai->time-monotonic time-in) (define (time-tai->time-monotonic time-in)
(if (not (eq? (time-type time-in) time-tai)) (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))) (let ((ntime (copy-time time-in)))
(set-time-type! ntime time-monotonic) (set-time-type! ntime time-monotonic)
ntime)) ntime))
(define (time-tai->time-monotonic! time-in) (define (time-tai->time-monotonic! time-in)
(if (not (eq? (time-type time-in) time-tai)) (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) (set-time-type! time-in time-monotonic)
time-in) time-in)
@ -741,7 +750,7 @@
(define (priv:year-day day month year) (define (priv:year-day day month year)
(let ((days-pr (assoc month priv:month-assoc))) (let ((days-pr (assoc month priv:month-assoc)))
(if (not days-pr) (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)) (if (and (priv:leap-year? year) (> month 2))
(+ day (cdr days-pr) 1) (+ day (cdr days-pr) 1)
(+ day (cdr days-pr))))) (+ day (cdr days-pr)))))
@ -1216,7 +1225,7 @@
((#\8) 8) ((#\8) 8)
((#\9) 9) ((#\9) 9)
(else (priv:time-error 'bad-date-template-string (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 ;; read an integer upto n characters long on port; upto -> #f is any length
(define (priv:integer-reader upto port) (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 puts (map module-name (module-uses (current-module))))
(for-each use args)))) (for-each use args))))
(define guile:load load)
(define-meta-command (load repl file . opts) (define-meta-command (load repl file . opts)
"load FILE "load FILE
Load a file in the current module. Load a file in the current module.
-f Load source file (see `compile')" -f Load source file (see `compile')"
(let* ((file (->string file)) (let ((file (->string file)))
(objcode (if (memq #:f opts) (if (memq #:f opts)
(apply load-source-file file opts) (primitive-load file)
(apply load-file file opts)))) (guile:load file))))
(vm-load (repl-vm repl) objcode)))
(define-meta-command (binding repl) (define-meta-command (binding repl)
"binding "binding

View file

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

View file

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