Re: [Scheme-reports] auxiliary syntax

2013-01-16 Thread Alex Shinn
On Wed, Jan 16, 2013 at 11:29 PM, Eli Barzilay wrote: > 10 minutes ago, Alex Shinn wrote: > > > > I've started to list some examples of sexp-based > > pure data languages at: > > > > http://community.schemewiki.org/?sexp-language > > > > None of these examples are macros (although some > > prov

Re: [Scheme-reports] auxiliary syntax

2013-01-16 Thread Eli Barzilay
10 minutes ago, Alex Shinn wrote: > > I've started to list some examples of sexp-based > pure data languages at: > >   http://community.schemewiki.org/?sexp-language > > None of these examples are macros (although some > provide convenience syntax wrappers). I'm assuming that you don't really w

Re: [Scheme-reports] auxiliary syntax

2013-01-16 Thread Alex Shinn
On Wed, Jan 16, 2013 at 5:27 PM, Eli Barzilay wrote: > A few minutes ago, Alex Shinn wrote: > > > > Not that I'm accusing you of doing this (at least in the post I'm > > replying to) but I'm wary of such a situation occurring, so I'm not > > going to address the rest of your post via mail. Rathe

Re: [Scheme-reports] auxiliary syntax

2013-01-16 Thread Eli Barzilay
A few minutes ago, Alex Shinn wrote: > > Not that I'm accusing you of doing this (at least in the post I'm > replying to) but I'm wary of such a situation occurring, so I'm not > going to address the rest of your post via mail.  Rather I'll > summarize the issues as best I see it for both sides vi

Re: [Scheme-reports] auxiliary syntax

2013-01-16 Thread Alex Shinn
On Wed, Jan 16, 2013 at 4:11 PM, Eli Barzilay wrote: > On Friday, Alex Shinn wrote: > > I've implemented several hygienic macro systems from scratch and > > studied several others. I program exclusively with hygienic macros, > > and for a long time have been advocating people switch as well sinc

Re: [Scheme-reports] auxiliary syntax

2013-01-15 Thread Eli Barzilay
On Friday, Alex Shinn wrote: > On Sat, Jan 12, 2013 at 11:15 AM, Eli Barzilay wrote: > > Just now, Alex Shinn wrote: > > I never thought I'd have to explain this on a Scheme or Lisp > > related list, > > I never thought that I'd need to explan hygiene or its benefits > or how

Re: [Scheme-reports] auxiliary syntax

2013-01-15 Thread Aaron W. Hsu
On Saturday, January 12, 2013 08:32:18 PM you wrote: > The point is to be aware that auxiliary syntax is not a silver > bullet, and that if you're using a macro system > which allows it there is a place for selective raw symbol > matching (though the macro itself must be hygienic). > If you're just

Re: [Scheme-reports] auxiliary syntax

2013-01-12 Thread Alex Shinn
On Sat, Jan 12, 2013 at 12:37 PM, Aaron W. Hsu wrote: > On Sat, 2013-01-12 at 11:48 +0900, Alex Shinn wrote: > > Rather, it's a type of low-level macro that looks at symbol names, and > > how we could potentially do the same thing with high-level macros. > > Okay, I was holding off until now, but

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Aaron W. Hsu
On Sat, 2013-01-12 at 11:48 +0900, Alex Shinn wrote: > Rather, it's a type of low-level macro that looks at symbol names, and > how we could potentially do the same thing with high-level macros. Okay, I was holding off until now, but now I think I gotta say that this has already been done and has

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Alex Shinn
On Sat, Jan 12, 2013 at 11:15 AM, Eli Barzilay wrote: > Just now, Alex Shinn wrote: > > I never thought I'd have to explain this on a Scheme or Lisp related > > list, > > I never thought that I'd need to explan hygiene or its benefits or how > scope works on a Scheme related list, let alone the l

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Eli Barzilay
Just now, Alex Shinn wrote: > On Sat, Jan 12, 2013 at 12:06 AM, Eli Barzilay wrote: > > Just now, Alex Shinn wrote: > > > It's equivalent to writing a macro which can parse and optimize > > literal PCRE regex strings, > > Absolutely, but that doesn't bother me because with

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Alex Shinn
On Sat, Jan 12, 2013 at 12:06 AM, Eli Barzilay wrote: > Just now, Alex Shinn wrote: > > > It's equivalent to writing a macro which can parse and optimize > > literal PCRE regex strings, > > Absolutely, but that doesn't bother me because with the above `let' I > don't expect whatever to affect the

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Alex Shinn
On Sat, Jan 12, 2013 at 12:19 AM, John Cowan wrote: > Alaric Snell-Pym scripsit: > > > Alex wants to see symbols rather than identifiers. A macro is free to > > interpret cons cells, numbers, strings, and so on found in its body as > > it sees fit, so why can't it interpret symbols outside of the

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread John Cowan
Alaric Snell-Pym scripsit: > This, I think, is really just a matter of degree. As much as the bodies > of let and cond deviate from normal scheme in that they contain lists > whose first member is not a procedure to apply to something, At the end of the day, that only works because the syntax exp

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Eli Barzilay
A few minutes ago, Alaric Snell-Pym wrote: > > Well, his goal is perhaps a little higher level; he wants to write a > macro that interprets the body of the macro invocation in a certain > way, namely as just a datum rather than with the emotional baggage > of Scheme source code. See other reply.

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Eli Barzilay
Just now, Alex Shinn wrote: > I'm not proposing an unhygienic macro, but rather a macro that can > match identifiers by their unhygienic symbol name (e.g. via > syntactic-closure-expr or syntax->datum). Yes, that's what I guessed on your behalf. > This will never break. Obviously this depends o

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Alaric Snell-Pym
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/11/2013 02:29 PM, Eli Barzilay wrote: > Here's a quick demonstration of how it gets broken. Assume that the > macros in question want to match two keywords: `+' and `?'. The first > is bound, the second isn't. Alex wants to write some "portab

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Alex Shinn
On Fri, Jan 11, 2013 at 11:29 PM, Eli Barzilay wrote: > > Alex Shinn wrote: > > > > Syntactic closures would make it easy to implement unhygienic > > parameters, but I guess that's not possible with syntax-case. > > This doesn't make any sense. Any macro facility is still something > that works

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Eli Barzilay
Alex Shinn wrote: > > Ah, indeed - I forgot the parameters need to be bound globally as > syntax parameters, and these still need to match hygienically. No, syntax parameters are unrelated here. They're used when you want a specific binding to have a different meaning in the context of some macr

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Alex Shinn
On Fri, Jan 11, 2013 at 11:43 AM, Noah Lavine wrote: > > On Mon, Jan 7, 2013 at 8:33 PM, Alex Shinn wrote: >> >> (If so, it sounds like syntax parameters may be the solution. But at >>> this point I'm just trying to make sure I understand the problem.) >>> >> >> Yes, I believe syntax-parameters

Re: [Scheme-reports] auxiliary syntax

2013-01-11 Thread Alaric Snell-Pym
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/11/2013 02:43 AM, Noah Lavine wrote: > It really seems like your goal is explicitly unhygienic - the same > symbol has a different meaning inside certain macros, even though the > user didn't every bind it differently. AIUI, Alex's goal is to h

Re: [Scheme-reports] auxiliary syntax

2013-01-10 Thread Noah Lavine
Hello, On Mon, Jan 7, 2013 at 8:33 PM, Alex Shinn wrote: > > (If so, it sounds like syntax parameters may be the solution. But at this >> point I'm just trying to make sure I understand the problem.) >> > > Yes, I believe syntax-parameters could be used. It would be clumsy, since > the > macros

Re: [Scheme-reports] auxiliary syntax

2013-01-07 Thread Alex Shinn
On Tue, Jan 8, 2013 at 7:39 AM, Noah Lavine wrote: > Hello, > > I'm still trying to understand the problem here, so please bear with me if > this is incorrect. > > In a nutshell, this seems to be the issue: Alex wants to distribute an SRE > library. This library uses certain symbols as syntax for

Re: [Scheme-reports] auxiliary syntax

2013-01-07 Thread Noah Lavine
Hello, I'm still trying to understand the problem here, so please bear with me if this is incorrect. In a nutshell, this seems to be the issue: Alex wants to distribute an SRE library. This library uses certain symbols as syntax for regular expressions. This library may analyze regular expression

Re: [Scheme-reports] auxiliary syntax

2013-01-07 Thread John Cowan
Alex Shinn scripsit: > Really, when you want to wrap macros on top of a non-macro-based DSL, > the only solution is to use unhygienic matching. But there's no way > to do this with syntax-rules, which is all we have in both R5RS and > R7RS small. > > This is a SERIOUS problem. I'm still unaware

Re: [Scheme-reports] auxiliary syntax

2013-01-07 Thread Eli Barzilay
10 minutes ago, Alex Shinn wrote: > On Tue, Jan 8, 2013 at 12:09 AM, Eli Barzilay wrote: > > > The solution some suggest is just to using renaming. [...] I could > > try to prefix the SRE identifiers consistently, e.g. `rx:' and > > `rx?', except oops, the underlying SRE engine doesn'

Re: [Scheme-reports] auxiliary syntax

2013-01-07 Thread Alex Shinn
On Tue, Jan 8, 2013 at 12:09 AM, Eli Barzilay wrote: > > > The solution some suggest is just to using renaming. [...] I could > > try to prefix the SRE identifiers consistently, e.g. `rx:' and > > `rx?', except oops, the underlying SRE engine doesn't know these > > names! > > If it's hygienic --

Re: [Scheme-reports] auxiliary syntax

2013-01-07 Thread Eli Barzilay
A few minutes ago, Alex Shinn wrote: > There are basically two things you may be trying to do when matching > an identifier - match a binding or match that identifier by name. Identifiers have no specific names, that's the whole point of hygiene. > So in the upcoming R7RS community, how am I to

Re: [Scheme-reports] auxiliary syntax

2013-01-07 Thread Alex Shinn
On Mon, Jan 7, 2013 at 8:28 PM, Andy Wingo wrote: > On Sun 06 Jan 2013 19:56, Peter Bex writes: > > > The second form in the following returns 1 in Chibi, Chicken, Gambit, > > MIT Scheme and Gauche: > > > > (define else #f) > > (cond (else 1)) > > Q: Why is this? A: Because all identifiers are

Re: [Scheme-reports] auxiliary syntax

2013-01-07 Thread Eli Barzilay
Just now, Eli Barzilay wrote: > > +1, except that it's even simpler than that -- there are some common > names that are often used in multiple places as is (for example, `+' > or `if'), no need for escapes. (Forgot a smiley here -- obviously you'd have to be insane to have a library define `+' an

Re: [Scheme-reports] auxiliary syntax

2013-01-07 Thread Eli Barzilay
11 hours ago, Alex Shinn wrote: > On Mon, Jan 7, 2013 at 11:45 AM, John Cowan wrote: > > I don't actually consider this a bug.  By the same token, it is > impossible for library A to use macros from libraries B and C > which happen to have chosen the same *primary* syntax keyword:

Re: [Scheme-reports] auxiliary syntax

2013-01-07 Thread Andy Wingo
On Sun 06 Jan 2013 19:56, Peter Bex writes: > The second form in the following returns 1 in Chibi, Chicken, Gambit, > MIT Scheme and Gauche: > > (define else #f) > (cond (else 1)) Q: Why is this? A: Because all identifiers are present in the initial environment in these implementations, so "def

Re: [Scheme-reports] auxiliary syntax

2013-01-07 Thread Peter Bex
On Sun, Jan 06, 2013 at 10:20:41PM -0500, John Cowan wrote: > Peter Bex scripsit: > > > This looks interesting, but will require some more experimentation > > before being generally acceptable, I think. I'm wary of things like > > this, as it seems a lot like the unholy idea that all DSSSL-style

Re: [Scheme-reports] auxiliary syntax

2013-01-06 Thread John Cowan
Peter Bex scripsit: > This looks interesting, but will require some more experimentation > before being generally acceptable, I think. I'm wary of things like > this, as it seems a lot like the unholy idea that all DSSSL-style > keywords must be bound. Apropos that, you might want to look at Key

Re: [Scheme-reports] auxiliary syntax

2013-01-06 Thread Alex Shinn
On Mon, Jan 7, 2013 at 11:45 AM, John Cowan wrote: > Alex Shinn scripsit: > > > Notably, it's otherwise impossible for library A to use macros from > > unrelated libraries B and C which happen to have chosen the same > > keyword. > > I don't actually consider this a bug. By the same token, it is

Re: [Scheme-reports] auxiliary syntax

2013-01-06 Thread John Cowan
Alex Shinn scripsit: > Notably, it's otherwise impossible for library A to use macros from > unrelated libraries B and C which happen to have chosen the same > keyword. I don't actually consider this a bug. By the same token, it is impossible for library A to use macros from libraries B and C wh

Re: [Scheme-reports] auxiliary syntax

2013-01-06 Thread Alex Shinn
On Mon, Jan 7, 2013 at 3:56 AM, Peter Bex wrote: > On Sun, Jan 06, 2013 at 12:37:18PM -0500, John Cowan wrote: > > Peter Bex scripsit: > > > I think trying to catch these things is misguided. It's fine if an > > > implementation like Racket does this to guide students, but seasoned > > > Scheme

Re: [Scheme-reports] auxiliary syntax

2013-01-06 Thread Peter Bex
On Sun, Jan 06, 2013 at 12:37:18PM -0500, John Cowan wrote: > Peter Bex scripsit: > > I think trying to catch these things is misguided. It's fine if an > > implementation like Racket does this to guide students, but seasoned > > Scheme programmers don't need this kind of hand-holding. > > On the

Re: [Scheme-reports] auxiliary syntax

2013-01-06 Thread John Cowan
Peter Bex scripsit: > I think trying to catch these things is misguided. It's fine if an > implementation like Racket does this to guide students, but seasoned > Scheme programmers don't need this kind of hand-holding. On the contrary. The whole point of binding them by default is so that they

Re: [Scheme-reports] auxiliary syntax

2013-01-06 Thread Peter Bex
On Sat, Jan 05, 2013 at 08:28:09PM +0100, Andy Wingo wrote: > I see that the report decided that the `_', `else', `...', etc auxiliary > syntaxes are to be bound in (scheme base). That's probably a good > thing. Good job. I guess they'd be bound like: > > (define-syntax else (syntax-rules ())

Re: [Scheme-reports] auxiliary syntax

2013-01-05 Thread John Cowan
Andy Wingo scripsit: > (define-syntax else (syntax-rules ()) It would be just as good or even better to say (define-syntax else (syntax-rules () ((else expr ...) (syntax-error "bad use of else" IMHO it is a great mistake to specify via code, as people take the code to be the One Tru

Re: [Scheme-reports] auxiliary syntax

2013-01-05 Thread Alex Shinn
On Sun, Jan 6, 2013 at 4:28 AM, Andy Wingo wrote: > I see that the report decided that the `_', `else', `...', etc auxiliary > syntaxes are to be bound in (scheme base). That's probably a good > thing. Good job. I guess they'd be bound like: > > (define-syntax else (syntax-rules ()) > > Does

[Scheme-reports] auxiliary syntax

2013-01-05 Thread Andy Wingo
I see that the report decided that the `_', `else', `...', etc auxiliary syntaxes are to be bound in (scheme base). That's probably a good thing. Good job. I guess they'd be bound like: (define-syntax else (syntax-rules ()) Does that definition need to go in the report, along with the defini