guile-user
[Top][All Lists]
Advanced

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

Re: Strange error from %search-load-path via include-from-path when para


From: Ian Hulin
Subject: Re: Strange error from %search-load-path via include-from-path when parameter is not a literal string
Date: Wed, 19 Oct 2011 15:43:39 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

Hi Andy and Mark,
Many thanks for the info.

Also thanks for the catch re using modules and portability, I'll have
to address the issue of the tidying up what definitions need to be
loaded into the main (lily) module from other files, and which of
those need to be modules, which was work I had been hoping to defer :-{.

Cheers,

Ian Hulin

On 17/10/11 22:36, Andy Wingo wrote:
> Hi,
> 
> On Mon 17 Oct 2011 20:20, Ian Hulin <address@hidden> writes:
> 
>> I'm trying to write a V2/V1 compatible function like the
>> following:
>> 
>> (define (ly:include the-file) (if (string>? (version) "1.9.10") 
>> (include-from-path the-file) (load-from-path the-file)))
>> 
>> I get ERROR in procedure %search-load-path: Wrong type to apply
>> in position 1 (expecting string): the-file.
>> 
>> Bug or user error?
> 
> User error, unfortunately.  `include' is a macro that expects a
> literal string, not a procedure that expects an expression that
> evaluates to a string.  For this to work, ly:include would also
> need to be a macro.
> 
> How about:
> 
> (cond-expand (guile-2 (define-syntax ly:include (syntax-rules () 
> ((_ the-file) (include-from-path the-file))))) (else (define
> (ly:include the-file) (load-from-path the-file))))
> 
> Assuming of course that you really need it to be ly:include.  The 
> portable (1.8/2.0) option is to use modules instead of
> load-from-path.
> 
> Regards,
> 
> Andy




reply via email to

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