[racket] Another Canonical Use of Macros?

2013-11-22 Thread John Clements
I'm preparing a 10-minute lightning talk on hygienic macros in rust (preview: I'm barely going to *mention* hygiene), and in the process, I've been surveying some of the Rust macros, and roughly categorizing them in terms of the "three canonical categories" that Matthias described--apologies if

[racket] Another Canonical Use of Macros?

2013-11-22 Thread Konrad Hinsen
John Clements writes: > categorizing them in terms of the "three canonical categories" that > Matthias described--apologies if I'm misrepresenting him/you: > - changing evaluation order, > - implementing a data sublanguage, and > - creating new binding forms. > > Some of the Rust macros se

Re: [racket] Another Canonical Use of Macros?

2013-11-23 Thread Matthias Felleisen
On Nov 23, 2013, at 1:46 AM, John Clements wrote: > I'm preparing a 10-minute lightning talk on hygienic macros in rust (preview: > I'm barely going to *mention* hygiene), and in the process, I've been > surveying some of the Rust macros, and roughly categorizing them in terms of > the "three

Re: [racket] Another Canonical Use of Macros?

2013-11-25 Thread Ben Duan
> - changing evaluation order, > - implementing a data sublanguage, and > - creating new binding forms. Thanks for the insights. But what does "data sublanguage" mean? On Sat, Nov 23, 2013 at 2:46 PM, John Clements wrote: > I'm preparing a 10-minute lightning talk on hygienic macros in rust > (

Re: [racket] Another Canonical Use of Macros?

2013-11-25 Thread Matthias Felleisen
Say you want a three-state machine where the states are labeled 'go, 'stop, 'warning and you use a stream of signals to switch between states say 'button-down 'x 'y, you can eliminate the quotes from the surface syntax with macros that place the quotes on the right pieces. Instead of symbols yo

Re: [racket] Another Canonical Use of Macros?

2013-11-25 Thread Greg Hendershott
>> Thanks for the insights. But what does "data sublanguage" mean? >> > Say you want a three-state machine where the states are labeled 'go, 'stop, > 'warning and you use a stream of signals to switch between states say > 'button-down 'x 'y, you can eliminate the quotes from the surface syntax wi

Re: [racket] Another Canonical Use of Macros?

2013-11-25 Thread Matthias Felleisen
Yes! On Nov 25, 2013, at 11:31 AM, Greg Hendershott wrote: >>> Thanks for the insights. But what does "data sublanguage" mean? >>> >> Say you want a three-state machine where the states are labeled 'go, 'stop, >> 'warning and you use a stream of signals to switch between states say >> 'b

Re: [racket] Another Canonical Use of Macros?

2013-11-25 Thread John Clements
On Nov 23, 2013, at 5:46 AM, Matthias Felleisen wrote: >> - abstracting over things that are not expressions. >> >> For instance: >> >> cmp_impl!(impl Eq, eq, ne) >> cmp_impl!(impl TotalEq, equals) >> cmp_impl!(impl Ord, lt, gt, le, ge) >> cmp_impl!(impl TotalOrd, cmp -> cmp::Ordering) >> >> Ea

Re: [racket] Another Canonical Use of Macros?

2013-11-25 Thread Matthias Felleisen
On Nov 25, 2013, at 12:54 PM, John Clements wrote: > they're not binding any new identifiers; they're just declaring that this > type implements this trait. Thanks for the clarification. I still think this category and binding should be merged into 'says something about an identifier' --

Re: [racket] Another Canonical Use of Macros?

2013-11-25 Thread Carl Eastlund
I agree. It doesn't bind in the sense of extending an environment, but it does in the sense of causing a new set of references to be resolved, e.g. x.method_name() for any x that now implements the trait in question. Carl Eastlund On Mon, Nov 25, 2013 at 4:35 PM, Matthias Felleisen wrote: > >

Re: [racket] Another Canonical Use of Macros?

2013-11-26 Thread Ben Duan
Great example. It all clicked to me now. Thanks On Tue, Nov 26, 2013 at 12:31 AM, Greg Hendershott < greghendersh...@gmail.com> wrote: > >> Thanks for the insights. But what does "data sublanguage" mean? > >> > > Say you want a three-state machine where the states are labeled 'go, > 'stop, 'war

Re: [racket] Another Canonical Use of Macros?

2013-11-26 Thread John Clements
On Nov 25, 2013, at 3:25 PM, Carl Eastlund wrote: > I agree. It doesn't bind in the sense of extending an environment, but it > does in the sense of causing a new set of references to be resolved, e.g. > x.method_name() for any x that now implements the trait in question. Hmm... It's not real

Re: [racket] Another Canonical Use of Macros?

2014-01-08 Thread Ben Duan
What is the source of "three canonical categories"? Thanks, Ben On Sat, Nov 23, 2013 at 2:46 PM, John Clements wrote: > I'm preparing a 10-minute lightning talk on hygienic macros in rust > (preview: I'm barely going to *mention* hygiene), and in the process, I've > been surveying some of the

Re: [racket] Another Canonical Use of Macros?

2014-01-09 Thread Matthias Felleisen
The Indiana school of macrology in the early 1980s. Eugene, Bruce, and I used this to teach macros to undergrads but Dan Friedman may have implicitly formulated them before Eugene sketched them out and Bruce and I wrote them down. On Jan 9, 2014, at 1:45 AM, Ben Duan wrote: > What is the so