Email list hosting service & mailing list manager

Problem of implicit quasiquote Shiro Kawai (27 Jun 2020 18:08 UTC)
Re: Problem of implicit quasiquote Marc Nieper-Wißkirchen (27 Jun 2020 20:54 UTC)
Re: Problem of implicit quasiquote Shiro Kawai (28 Jun 2020 02:09 UTC)
Re: Problem of implicit quasiquote Shiro Kawai (28 Jun 2020 02:10 UTC)
Re: Problem of implicit quasiquote Marc Nieper-Wißkirchen (28 Jun 2020 08:14 UTC)
Re: Problem of implicit quasiquote Shiro Kawai (28 Jun 2020 09:34 UTC)
Re: Problem of implicit quasiquote Marc Nieper-Wißkirchen (28 Jun 2020 10:34 UTC)
Re: Problem of implicit quasiquote Shiro Kawai (28 Jun 2020 11:00 UTC)
Re: Problem of implicit quasiquote Shiro Kawai (28 Jun 2020 11:16 UTC)
Re: Problem of implicit quasiquote Marc Nieper-Wißkirchen (28 Jun 2020 12:50 UTC)
Re: Problem of implicit quasiquote Shiro Kawai (28 Jun 2020 20:45 UTC)
Re: Problem of implicit quasiquote Marc Nieper-Wißkirchen (28 Jun 2020 21:01 UTC)
Re: Problem of implicit quasiquote Shiro Kawai (28 Jun 2020 21:08 UTC)
Re: Problem of implicit quasiquote Marc Nieper-Wißkirchen (28 Jun 2020 21:14 UTC)
Re: Problem of implicit quasiquote Shiro Kawai (28 Jun 2020 21:42 UTC)
Re: Problem of implicit quasiquote Shiro Kawai (28 Jun 2020 21:52 UTC)
Re: Problem of implicit quasiquote Marc Nieper-Wißkirchen (29 Jun 2020 06:31 UTC)
Re: Problem of implicit quasiquote Shiro Kawai (29 Jun 2020 20:27 UTC)
Re: Problem of implicit quasiquote Marc Nieper-Wißkirchen (30 Jun 2020 13:11 UTC)
Re: Problem of implicit quasiquote Marc Nieper-Wißkirchen (04 Jul 2020 09:09 UTC)

Re: Problem of implicit quasiquote Marc Nieper-Wißkirchen 04 Jul 2020 09:08 UTC

If we add an explicit quasiquote to the FHD matcher, we have to decide whether

(match in
  (x ---))

means the same as

(match in
  (`,x ---))

This is probably what one would expect naively. However, `x' may not
only be a variable but could be (a b), which would invoke the
catamorphism feature of the FHD matcher. Now if `a' happens to be the
quasiquote, we have an ambiguity that hasn't been there before. The
point is that without the explicit quasiquote, the quasiquote was no
special syntax for the FHD matcher.

A solution would be to make the first version an error so that
patterns *always* have to start with a quasiquote. (This also allows
the match form to rebind the quasiquote on the right-hand side as I
mentioned earlier.) In fact, this solution would mean that each
pattern has to be of the form (qq X), where qq takes over the meaning
of the quasiquote.

Am Di., 30. Juni 2020 um 15:11 Uhr schrieb Marc Nieper-Wißkirchen
<xxxxxx@nieper-wisskirchen.de>:
>
> Am Mo., 29. Juni 2020 um 22:27 Uhr schrieb Shiro Kawai <xxxxxx@gmail.com>:
>
> > So, the most flexible interpretation is that (quasiquote x) and (unquote x) are just another syntax or macro call and the programmer can freely give semantics to each separately by defining macros, and it shouldn't be limited by the default semantics.  Marc's position is closer to this, I think.
>
> Yes, I guess my position is closer to this. `quasiquote' and `unquote'
> are very precious macro names (or very precious names for auxiliary
> syntax) because they are treated specially by the reader. Thus, more
> than one macro wants to make use of it at least as auxiliary syntax.
>
> > What I feel is that having a shorthand notation does give them a slightly special position rather than other built-in syntaxes such as 'lambda' or 'if'.  Having a special syntax is to give a visual cue for the reader's benefit, and in the quasiquote case, a reader naturally seeks for quasiquote-unquote correspondence, since it's the convention.  Scheme won't force the programmer to follow it, meaning you can define your own macro to use unpaired unquotes, but I feel it needs a legitimate reason strong enough to break the convention and reader's expectation.
>
> There is actually one completely different advantage when quasiquote
> is specified explicitly: It allows us to hygienically rebind the
> quasiquote identifier in the matching clauses so that, for example,
> the following is possible:
>
> (match in
>   (`(,x ...) `(foo ,x ...)))
>
> (Note the use of ellipsis, which needs a simple extension of the qq
> syntax. See http://snow-fort.org/s/rapid-scheme.org/marc/rapid/quasiquote/0.1.1/index.html.