unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Ian Hulin <ian@hulin.org.uk>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-user@gnu.org
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	[thread overview]
Message-ID: <4E9EE21B.3080803@hulin.org.uk> (raw)
In-Reply-To: <877h439u78.fsf@pobox.com>

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 <ian@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




  reply	other threads:[~2011-10-19 14:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-17 18:20 Strange error from %search-load-path via include-from-path when parameter is not a literal string Ian Hulin
2011-10-17 21:36 ` Andy Wingo
2011-10-19 14:43   ` Ian Hulin [this message]
2011-10-17 21:54 ` Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E9EE21B.3080803@hulin.org.uk \
    --to=ian@hulin.org.uk \
    --cc=guile-user@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).