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 <i...@hulin.org.uk> 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