bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #30169] Auto-compilation failure of a module doesn't lead to a


From: Andy Wingo
Subject: Re: [bug #30169] Auto-compilation failure of a module doesn't lead to a failure [1.9.11]
Date: Fri, 18 Jun 2010 19:03:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

On Fri 18 Jun 2010 16:52, address@hidden (Ludovic Courtès) writes:

> Andy Wingo <address@hidden> writes:
>
>> On Thu 17 Jun 2010 15:06, Ludovic Courtès <address@hidden> writes:
>>
>>> Guile should instead abort as soon as auto-compilation fails.
>>
>> Guile can fail autocompilation due to eval-when issues for syntax
>> helpers. Do you want to make Guile fail in this case?
>
> Sorry, I don’t understand.  I want Guile to fail in the example I gave.

Some files may be interpreted, but fail to compile. They will cause
autocompilation to fail. To be specific, from NEWS:

    ** Functions needed by macros at expand-time need to be present at
       expand-time.

    For example, this code will work at the REPL:

      (define (double-helper x) (* x x))
      (define-macro (double-literal x) (double-helper x))
      (double-literal 2) => 4

    But it will not work when a file is compiled, because the definition of
    `double-helper' is not present at expand-time. The solution is to wrap
    the definition of `double-helper' in `eval-when':

      (eval-when (load compile eval)
        (define (double-helper x) (* x x)))
      (define-macro (double-literal x) (double-helper x))
      (double-literal 2) => 4

    See the documentation for eval-when for more information.

So, you want Guile to fail faster for this error; how do you distinguish
it from eval-when errors as above? Or would you prefer that eval-when
errors lead to failures as well?

Andy
-- 
http://wingolog.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]