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: Hobittable but nonexecutable code


>>>>> "Alexander" == Alexander Asteroth <alexander.asteroth@informatik.uni-bonn.de> writes:

    Alexander> The following simple program:

    Alexander> (define-module (std io)) (define-public println
    Alexander> println) ; because of non-hobbitability of ;
    Alexander> (define-public (sum . args) (apply + args))

    Alexander> (define (println . args) (for-each display args) ;;;;
    Alexander> this line produces the error (newline) (force-output) )

    Alexander> (display "ready\n")

    Alexander> Compiles without warning but when executed produces the
    Alexander> following error message:

    >> a.out
    Alexander> ERROR: In procedure apply: ERROR: Wrong type argument
    Alexander> in position 1: %S

Don't fotget that define-module and define-public are macros, which
definitions are unknown to hobbit. So, put the relevant macros on
top of your file. The simplest way to do this 
is to include file hobbit4d/module.scm from the distribution.

(as the use of define-module may break in some cases, this inclusion
is currently desactivated)

Secondly, don't forget to compile with the -m flag !!!
(this will be the default in next release)

With these modifications, I can compile and run your program
correctly, even when adding after:
(display "ready\n")
the line:
(println 456 'ert "ertg")

--

B. Urban