From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.user Subject: Re: and-let* is not composable? Date: Sat, 5 Oct 2013 00:27:27 +0200 Message-ID: References: <87li34mue7.fsf@Kagami.home> <8761u7o3n3.fsf@Kagami.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b6d93b8b6bd0f04e7f1ce1b X-Trace: ger.gmane.org 1380925652 15238 80.91.229.3 (4 Oct 2013 22:27:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Oct 2013 22:27:32 +0000 (UTC) To: Panicz Maciej Godek , "guile-user@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Oct 05 00:27:39 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VSDqV-0000UF-Hy for guile-user@m.gmane.org; Sat, 05 Oct 2013 00:27:39 +0200 Original-Received: from localhost ([::1]:49810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSDqV-0005wy-5s for guile-user@m.gmane.org; Fri, 04 Oct 2013 18:27:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSDqM-0005wq-7j for guile-user@gnu.org; Fri, 04 Oct 2013 18:27:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSDqL-0006DF-4e for guile-user@gnu.org; Fri, 04 Oct 2013 18:27:30 -0400 Original-Received: from mail-vb0-x22a.google.com ([2607:f8b0:400c:c02::22a]:62063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSDqK-0006DB-Uq for guile-user@gnu.org; Fri, 04 Oct 2013 18:27:29 -0400 Original-Received: by mail-vb0-f42.google.com with SMTP id e12so2592276vbg.15 for ; Fri, 04 Oct 2013 15:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Ss1AvokXK+Mnq7kICVBT7b4ABdBtxULrJckT6WkU/CM=; b=A9oHhulJnRpVPYQNvidd1j9kcEugzU1dcllF0qjDYuenCeqTBrXvwCqH0f23vk+oOv Yn0YzBC40d1YlS3CCSOyJf42QUdSOrgZuALHQbcXyGM35S4wXZrDBnaXhnvoR9RNdydI 2Q5/so2D+tJEZHIUUblETBR0GFIeKmeh+BWYdzwxApjGWJT52H0MZRoWSNDtCHgsHgvW SRVv4gw8KiBrGQe0X8C2OkPK+wFzw3Glh06eneP6LEg9NVIApEMg+i78l8vUGtI7mzq1 IQ6FYR+Nl0Ot8MyT5ok5+3hR89BTDg3+lxJU3+g8e0pjCwaY/sGXBS3riv/GVfcE5lGR jSTA== X-Received: by 10.58.117.71 with SMTP id kc7mr14272691veb.16.1380925648053; Fri, 04 Oct 2013 15:27:28 -0700 (PDT) Original-Received: by 10.221.45.135 with HTTP; Fri, 4 Oct 2013 15:27:27 -0700 (PDT) In-Reply-To: <8761u7o3n3.fsf@Kagami.home> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c02::22a 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:10836 Archived-At: --047d7b6d93b8b6bd0f04e7f1ce1b Content-Type: text/plain; charset=ISO-8859-1 > > If you, or the other people who are confused by syntax-case, can point > to the parts of the manual that confuse you, so we can clear them up, I > think we'd all appreciate it. > > Fundamentally, syntax-case shouldn't be harder to use than define-macro > 99% of the time, if you remember > As a little addendum to that topic, I just ran across Matthew Flatt's presentation of Racket macro system, http://www.infoq.com/presentations/racket, where he points to a quite good introduction to "define-syntax" macros by Greg Hendershott: http://www.greghendershott.com/fear-of-macros/ And now that my head is clearer on this regard, I think it is confusing to call them "syntax-case" macros, because "syntax-case" is rather auxiliary than essential for defining that sort of macro. The order of presentation in the manual resembles the one that Hendershott criticises, namely: first, the syntax-rules macros are presented, which are an epiphany once you comprehend them, and then syntax-case is presented as a different type of macro. However, syntax-case is only a pleasant way to destructure syntactic information passed to a transformer, and the same effect could be achieved without using it, by using some more explicit procedures like syntax->datum. (Furthermore, Hendershott explains more specifically how do the syntax objects differ from raw scheme forms). So I believe that at least placing a link to than explanation in the manual could be a great help for beginners. Best regards, M. --047d7b6d93b8b6bd0f04e7f1ce1b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
If you, or the other people who are confused by syntax-case, can point
to the parts of the manual that confuse you, so we can clear them up, I
think we'd all appreciate it.

Fundamentally, syntax-case shouldn't be harder to use than define-macro=
99% of the time, if you remember

As a l= ittle addendum to that topic, I just ran across Matthew Flatt's
presentation of Racket macro system,=A0http://www.infoq.com/presentations/racket,
where he points to a quite good introduction to "define-syntax&qu= ot; macros

And now that my head is clearer on this regard, I think= it is confusing
to call them "syntax-case" macros, bec= ause "syntax-case" is rather
auxiliary than essential f= or defining that sort of macro.

The order of presentation in the manual resembles the o= ne that Hendershott
criticises, namely: first, the syntax-rules m= acros are presented, which are an
epiphany once you comprehend th= em, and then syntax-case is presented as
a different type of macro. However, syntax-case is only a pleasant way= to
destructure syntactic information passed to a transformer, an= d the same
effect could be achieved without using it, by using so= me more explicit=A0
procedures like syntax->datum. (Furthermore, Hendershott explains
more specifically how do the syntax objects differ from raw scheme= forms).
So I believe that at least placing a link to than explan= ation in the manual
could be a great help for beginners.

Best reg= ards,
M.

--047d7b6d93b8b6bd0f04e7f1ce1b--