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 -- http://wingolog.org/