Hello,

I've written a simple module:

(define-module (popgen popgen))
(export popgen)


(use-modules (ice-9 format))
(define *numprec*  "~10,8,,,0f ")
(define *numformat* (string-append "~{" *numprec* "~}~%"))

(define (popgen popfun data)
  ;; POPFUN is a function that evaluates the vector DATA to yield the
  ;; next generation's data; print the data to the terminal and then
  ;; check the result of evaluating (popfun data); if the new vector
  ;; is close enough to the old one, exit and return #f; otherwise
  ;; call (popgen POPFUN (POPFUN DATA))
  ;;
  ;; First print the data to the current-output-port (user routines
  ;; may want to modify this to send the data down a pipe)

  (format #t "~{~}~%" num-format (vector->list data))
  (let* ((new (popfun data))
         (diff (eudiff (new data))))
    (cond ((< diff 1e-15) #f)
          (else (popgen popfun new)))))

(define (eudiff vec1 vec2)
  (sqrt (apply
         +
         (map (lambda (x y)
                (* (- x y) (- x y)))
              (vector->list vec1)
              (vector->list vec2)))))

I'd like to test its features at the REPL, but I am having serious
trouble loading it.  I'm not sure if the problem is in the definition or
how I'm loading it.

I get the following behavior:

guile> %load-path
("/usr/share/guile/site" "/usr/share/guile/1.8" "/usr/share/guile")
guile> (set! %load-path (cons (getcwd) %load-path))
guile> %load-path
("/home/joel/Documents/ss_theory/scm" "/usr/share/guile/site" 
"/usr/share/guile/1.8" "/usr/share/guile")
guile> (use-modules (popgen popgen))

Backtrace:
In standard input:
  76: 0* (use-modules (popgen popgen))
  76: 1  (eval-case (# # *unspecified*) (else #))
  76: 2  (begin (process-use-modules (list (list #))) *unspecified*)
In unknown file:
   ?: 3* [process-use-modules (((popgen popgen)))]

<unnamed port>: In procedure process-use-modules in expression 
(process-use-modules (list #)):
<unnamed port>: no code for module (popgen popgen)
ABORT: (misc-error)

Where am I going wrong?

Thanks,

Joel
-- 
Joel J. Adamson
Servedio Lab
University of North Carolina at Chapel Hill

FSF Member #8164
http://www.unc.edu/~adamsonj

Attachment: pgpDDKz1WyV5l.pgp
Description: PGP signature

Reply via email to