From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: Strange error from %search-load-path via include-from-path when parameter is not a literal string Date: Mon, 17 Oct 2011 23:36:27 +0200 Message-ID: <877h439u78.fsf@pobox.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1318887409 16688 80.91.229.12 (17 Oct 2011 21:36:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2011 21:36:49 +0000 (UTC) Cc: guile-user@gnu.org To: Ian Hulin Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Oct 17 23:36:45 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RFurU-0005wx-Qt for guile-user@m.gmane.org; Mon, 17 Oct 2011 23:36:44 +0200 Original-Received: from localhost ([::1]:53733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFurT-0000kH-Qg for guile-user@m.gmane.org; Mon, 17 Oct 2011 17:36:43 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:45442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFurO-0000jr-US for guile-user@gnu.org; Mon, 17 Oct 2011 17:36:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFurN-00041X-3M for guile-user@gnu.org; Mon, 17 Oct 2011 17:36:38 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:57158 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFurM-00041Q-Tz for guile-user@gnu.org; Mon, 17 Oct 2011 17:36:37 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id A4A0A8309; Mon, 17 Oct 2011 17:36:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=6QmBEmuTevdxHuUJynX/G4oULtA=; b=VoTSFa fvXVNiV4t4/iU2NHUCHPdJrJvb0fDtgDBMrhbvYM2jD65WYZwwG1P+uTdJ25tKpa kARttTb3PMQ6e4/3eit6/brfQrRe8xJfhjcxvDxPCoulkB6rAXt2MevSUSVd7q/e iZms8740i+a8LP0wPx0xBMsRse8l2hp0vHKL4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=wiNpfuHkLcWJD+zt6ORydmCXs9zLwMLd skUzDfGTUsZFwhEi5y4fL9kua6PyZgYijAHOIe8EA1qjaYv7ay+Um33+eib4+iNq A7ORmgRGBowO/xjUfTdMpfEQD95H8eP3AM0GqV5x3mSJOuvylYceO0fm0+FSbGHe pLFB3SwlSyo= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 9E3AC8308; Mon, 17 Oct 2011 17:36:32 -0400 (EDT) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 19BB88307; Mon, 17 Oct 2011 17:36:31 -0400 (EDT) In-Reply-To: (Ian Hulin's message of "Mon, 17 Oct 2011 19:20:45 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: 14A57F9C-F908-11E0-8D15-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8898 Archived-At: Hi, On Mon 17 Oct 2011 20:20, Ian Hulin 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/