From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joel James Adamson Newsgroups: gmane.lisp.guile.user Subject: Loading a module from the current-working-directory Date: Wed, 21 Jul 2010 16:27:54 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: dough.gmane.org 1279744131 32327 80.91.229.12 (21 Jul 2010 20:28:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Jul 2010 20:28:51 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Jul 21 22:28:50 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ObfuI-00069T-8J for guile-user@m.gmane.org; Wed, 21 Jul 2010 22:28:49 +0200 Original-Received: from localhost ([127.0.0.1]:39474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObfuC-0002AB-U9 for guile-user@m.gmane.org; Wed, 21 Jul 2010 16:28:40 -0400 Original-Received: from [140.186.70.92] (port=36349 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Obfu4-00027I-SO for guile-user@gnu.org; Wed, 21 Jul 2010 16:28:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Obftg-0007Tl-Es for guile-user@gnu.org; Wed, 21 Jul 2010 16:28:09 -0400 Original-Received: from chondestes.bio.unc.edu ([152.2.67.61]:58513) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Obftg-0007SF-BA for guile-user@gnu.org; Wed, 21 Jul 2010 16:28:08 -0400 Original-Received: from chondestes.bio.unc.edu (chondestes.bio.unc.edu [127.0.0.1]) by chondestes.bio.unc.edu (8.14.4/8.14.3) with ESMTP id o6LKRtaY015168 for ; Wed, 21 Jul 2010 16:27:55 -0400 Original-Received: (from joel@localhost) by chondestes.bio.unc.edu (8.14.4/8.14.4/Submit) id o6LKRthX015166; Wed, 21 Jul 2010 16:27:55 -0400 X-Authentication-Warning: chondestes.bio.unc.edu: joel set sender to adamsonj@email.unc.edu using -f User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7998 Archived-At: --=-=-= Content-Transfer-Encoding: quoted-printable 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/g= uile/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)))] : In procedure process-use-modules in expression (process-use= -modules (list #)): : no code for module (popgen popgen) ABORT: (misc-error) Where am I going wrong? Thanks, Joel =2D-=20 Joel J. Adamson Servedio Lab University of North Carolina at Chapel Hill FSF Member #8164 http://www.unc.edu/~adamsonj --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iF4EAREIAAYFAkxHWEsACgkQp61eY7lvATK7wAD9F7s9EKJ5D0cWTg/2HV7u55kg cT43He1fEq+cG5yJEToA/3N68jHV2i5vee76t+HIV6SNDJcE9cEFjqCAazFpap6x =hsCk -----END PGP SIGNATURE----- --=-=-=--