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


First a general comment: This is the wrong forum for bug-reports.
Please send bug-reports to bug-guile.

Chris Wedgwood <chris@cyphercom.com> writes:

> I use the above, only after (slib:load "jacal/math.scm") I added (slib:load
> "slib/arraymap.scm") - if I don't things fail with "array-map!" being
> unbound.

Array support is implemented in C in Guile.  `array-map!' exists but
is named `array-map'.  I've now added the name `array-map!' to the
distribution.  Meanwhile, you can add a line defining this name to
jacal.scm (see below).

> The (define horner #f) also doesn't seem to hold, so I have to do this
> manually.

You used the first version of jacal.scm which was broken.  (Note that
this was just something I quickly wrote down to illustrate the idea of
a jacal hook.)  Please try the new version included below.

[...]

> e0 : b:[2,4];
> 
> ERROR: In procedure error in expression (slib:error (quote display-line)
> line):
> ERROR: display-line (14 BREAK 14 "4" 15 "]" 16 ")")
> define(b, [2, ABORT: (misc-error)

I don't know yet what the problem is here.  What you see above is
jacal itself reporting an error using slib:error.  This may be a bug
in jacal.  We have to track this one down.

> Type "(backtrace)" to get more information.
> guile> (backtrace)
> 
> Backtrace:
>  0* [math]
>  1* [batch1]
> ERROR: In procedure backtrace in expression (backtrace):
> ERROR: Bad memory access (Segmentation violation)
>  2  ABORT: (signal)
> guile>

This is a serious bug in Guile's unmemoization code.  Thanks for
finding it!  It will hopefully be gone in next Guile snapshot.

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)
----------------------------------------------------------------------