From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: Panicz Maciej Godek <godek.maciek@gmail.com>,
"guile-user@gnu.org" <guile-user@gnu.org>,
Ian Price <ianprice90@googlemail.com>
Subject: Re: and-let* is not composable?
Date: Wed, 11 Sep 2013 14:25:07 +0200 [thread overview]
Message-ID: <CAMFYt2bYp51FRHKHddTAEuLTZDCsK53TszMe-AzQxSzZXa04OA@mail.gmail.com> (raw)
In-Reply-To: <87li34mue7.fsf@Kagami.home>
[-- Attachment #1: Type: text/plain, Size: 2113 bytes --]
2013/9/10 Ian Price <ianprice90@googlemail.com>
>
> I have a few notes unrelated to those I've already mentioned in the
> thread.
>
> 1. Guile already has curried definitions in (ice-9 curried-definitions)
>
> Yes, but those are completely different. I wouldn't call "define-curried"
a curried definition, but a definition of a curried macro for generating
procedures.
> 2. By turning your functions definitions into a macro, you've lost the
> ability to use them in a first class manner.
>
> That's not entirely true. I just need an extra pair of parentheses
to do so. The semantics is certainly different than the one of
Guile's curried definitions, but that's fine.
> 3. I would strongly recommend _not_ using define-macro, and even more
> so, not mixing define-macro and syntax-rules in a macro. Syntax-case is
> as powerful as defmacro, and in most practical cases, about as much
> writing.
>
Well, while syntax-rules macros are quite easy to understand
(at least from the user's point of view), although sometimes a little
tricky, the syntax-case system I find still too difficult to use.
define-macro, on the other hand, is very easy to explain
even to beginner programmers, although the resulting macros
are much more difficult to analyse.
The main problem with syntax-rules/syntax-case macros is
the treatment of ellipses, which makes it difficult to create
macros that create macros.
Still, I didn't post to comp.lang.scheme for no reason :)
4. What your macro does is not currying, it is partial
> application. Those are different things. Currying refers to the process
> of turning a function of n arguments into an n-nested set of 1 argument
> functions. Partial application is, well, not supplying all the arguments
> to a function. You can have partial application without currying, as
> your macro shows.
>
OK, you got me here. But it's still difficult for me to come up
with a good name for that macro (and if so, the Guile's curried
definitions are not curried either, at least in general: because
you can (define ((f a b) c d) ...), getting a chain of 2-argument
functions)
Thanks,
M.
[-- Attachment #2: Type: text/html, Size: 3415 bytes --]
next prev parent reply other threads:[~2013-09-11 12:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-09 17:35 and-let* is not composable? Panicz Maciej Godek
2013-09-09 20:26 ` Stefan Israelsson Tampe
2013-09-09 21:34 ` Ian Price
2013-09-10 13:42 ` Stefan Israelsson Tampe
2013-09-10 13:51 ` Ian Price
2013-11-02 2:39 ` Ian Price
2013-11-02 19:01 ` Ian Price
2013-09-10 17:57 ` Ian Price
2013-09-11 12:25 ` Panicz Maciej Godek [this message]
2013-09-11 14:05 ` Ian Price
2013-09-13 18:40 ` Panicz Maciej Godek
2013-09-14 8:19 ` Stefan Israelsson Tampe
2013-10-04 22:27 ` Panicz Maciej Godek
2013-10-05 8:00 ` Ian Price
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=CAMFYt2bYp51FRHKHddTAEuLTZDCsK53TszMe-AzQxSzZXa04OA@mail.gmail.com \
--to=godek.maciek@gmail.com \
--cc=guile-user@gnu.org \
--cc=ianprice90@googlemail.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).