This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gak! slib


    OK, poor guy.  Do you dare to try it again after finding three
    independent bugs?  Here's the new jacal.scm:

    jacal.scm:
    ----------------------------------------------------------------------
    (define-module (jacal) :use-module (ice-9 slib))

    (define-module (ice-9 slib))
    (if (defined? 'array-map) ; Workaround for Guile-slib incompatibility
        (define-public array-map! array-map))
    (define horner #f) ; Workaround for a bug in Jacal
    (define-module (jacal))

    (slib:load "jacal/math.scm")

    (define-public math math)
    ----------------------------------------------------------------------

It must be me. I must be doing something funny...

This is using (as before) guile 970922: (some space added for clarity)

x:~$ for i in `guile -c "(display %load-path)" | tr "()" " " ; do find $i -name jacal.scm -print ; done
./jacal.scm




x:~$ guile
guile> (system "cat jacal.scm")
(define-module (jacal) :use-module (ice-9 slib))

(define-module (ice-9 slib))
(if (defined? 'array-map) ; Workaround for Guile-slib incompatibility
    (define-public array-map! array-map))
(define horner #f) ; Workaround for a bug in Jacal
(define-module (jacal))

(slib:load "jacal/math.scm")

(define-public math math)
0




guile> (use-modules (jacal))
............
JACAL version 1a7, Copyright 1989-1997 Aubrey Jaffer
JACAL comes with ABSOLUTELY NO WARRANTY; for details type (terms)'.
This is free software, and you are welcome to redistribute it
under certain conditions; type (terms)' for details.
;;; Type (math) to begin.
guile> horner
ERROR: In expression horner:
ERROR: Unbound variable: horner
ABORT: (misc-error)

Type "(backtrace)" to get more information.
guile> arrap-map!
ERROR: In expression arrap-map!:
ERROR: Unbound variable: arrap-map!
ABORT: (misc-error)



So the (define horner #f) (and similar for array-map!) doesn't seem to
'stick' outside of jacal.scm. 



I'm fairly sure it me doing something wrong. I don't know sheme beyond the
r4rs document which I read on the subway a few weeks back the and small
'fac.scm' toy I wrote a little before that.


-Chris

P.S. There must be something deeply distrubing in the factorial function. 
     It seems to be one of the first this people write in any language new
     to them... even before the read the docs abd see it done there. 
     Spooky.