From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: Re: [r6rs] probably bad syntax expansion Date: Mon, 21 Jun 2010 21:24:10 +0200 Message-ID: References: <87d3vk4xz7.fsf@rapitore.luna> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1277148294 20595 80.91.229.12 (21 Jun 2010 19:24:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 Jun 2010 19:24:54 +0000 (UTC) Cc: bug-guile@gnu.org To: Marco Maggi Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Jun 21 21:24:51 2010 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OQmbv-0000D1-Iz for guile-bugs@m.gmane.org; Mon, 21 Jun 2010 21:24:51 +0200 Original-Received: from localhost ([127.0.0.1]:55671 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OQmbr-0006Ik-JB for guile-bugs@m.gmane.org; Mon, 21 Jun 2010 15:24:43 -0400 Original-Received: from [140.186.70.92] (port=43055 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OQmbl-0006Fy-NY for bug-guile@gnu.org; Mon, 21 Jun 2010 15:24:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OQmbN-0008Tk-KX for bug-guile@gnu.org; Mon, 21 Jun 2010 15:24:14 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:53756 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OQmbN-0008Tg-F2 for bug-guile@gnu.org; Mon, 21 Jun 2010 15:24:13 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 526C6BDB46; Mon, 21 Jun 2010 15:24:13 -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=dRk2rO1cVFOqJl/6jBNaUlwQubQ=; b=gG4EQP ItMavfQ0WAGdXoX89Jueh116518NRplSnYIqURGPEiP1vBQog5EFObLt2CyYmHrj e7VJJCi3t5eilX/REp2sW15CziIU02pVbbPFCKsftN52wa029/v8jVAipEg4Lk/1 ZbZ2T3TVrsoZwh4I9Px0nk4jbrad9iuZIkK3I= 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=rGC/nREythWsR+NOK5fNipFB6Ua5fIFU XdRMd9xkPchnri6oT+z36YPYJkWzf5AJBgaqxIIjq/9HAv7RHV/Wdxar+qHemdkk vg3UuYp4uOQyT4rj7EPfUqQCrmQNIZWqRgWF7OMCUT6kpZEETJYw1BEgomlXcDtK 91yNsMIXuUs= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 3B4CDBDB45; Mon, 21 Jun 2010 15:24:12 -0400 (EDT) Original-Received: from unquote (unknown [83.32.68.226]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id E0DD9BDB3F; Mon, 21 Jun 2010 15:24:09 -0400 (EDT) In-Reply-To: <87d3vk4xz7.fsf@rapitore.luna> (Marco Maggi's message of "Mon, 21 Jun 2010 09:59:56 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: 9278AFB8-7D6A-11DF-BE38-9056EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4696 Archived-At: Hello, On Mon 21 Jun 2010 09:59, Marco Maggi writes: > (define A ) > (define-syntax B <>) > (A) I have abbreviated your illuminating example. I don't really know what to think of it, except to say that for top-level programs Guile implements "REPL semantics". It would seem that both for toplevel programs and for libraries -- because Guile expands the `library' form to toplevel definitions -- that these REPL semantics do diverge from lexically-nested semantics. It's the difference between: (let () (define even? (lambda (x) (or (= x 0) (odd? (- x 1))))) (define-syntax odd? (syntax-rules () ((odd? x) (not (even? x))))) (even? 10)) => #t and (begin (define even? (lambda (x) (or (= x 0) (odd? (- x 1))))) (define-syntax odd? (syntax-rules () ((odd? x) (not (even? x))))) (even? 10)) ERROR: In procedure vm-debug-engine: ERROR: Wrong type to apply: # It is unfortunate for users that expect R6RS semantics for toplevel and library definitions. I would be happy to accept a well-reasoned patch to letrec-compile the first forms from a file that prove to be definitions, though we cannot remove support for mixed definitions and expressions at the toplevel. However, I don't have the motivation to work on this in the foreseeable future. Thank you for the report, though, and I will document the incompatibility. Andy -- http://wingolog.org/