Re: What are AST Macros?

2018-04-13 Thread David Bennett via Digitalmars-d
On Friday, 13 April 2018 at 11:54:12 UTC, David Bennett wrote: Also the other idea I had was to have mixin functions that only take compiletime args (they are UFCS-able though, unlike templates) and mixin themselves when called like: --- mixin add1Xtimes(alias int a, alias int t){ uint i=t

Re: What are AST Macros?

2018-04-13 Thread David Bennett via Digitalmars-d
On Friday, 6 April 2018 at 20:33:10 UTC, Chris Katko wrote: Sorry if this is "re-opening" an old thread, but did anything come from this and DIP50? It seems like a really interesting concept and this thread was one of the first results for a Google search. Thanks. Thanks for reminding me ab

Re: What are AST Macros?

2018-04-12 Thread Stefan Koch via Digitalmars-d
On Friday, 13 April 2018 at 00:37:39 UTC, jmh530 wrote: Could AST macros replace things like @safe/@nogc and enable the user to create their own (like a @supersafe that disallows @trusted)? Short Answer: Yes. If the AST-Macro facilities are built with that use in mind.

Re: What are AST Macros?

2018-04-12 Thread jmh530 via Digitalmars-d
On Monday, 9 April 2018 at 15:30:33 UTC, Stefan Koch wrote: [snip] Using templates to introspect and manipulate types is like using a hammmer's flat back to remove a nail. It _can_ be done but with an absurd amount of work. You just have to remove all of the wall around the nail by pounding i

Re: What are AST Macros?

2018-04-10 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-09 18:39, Cym13 wrote: On Monday, 9 April 2018 at 15:30:33 UTC, Stefan Koch wrote: On Friday, 6 April 2018 at 21:45:45 UTC, Zach Tollen wrote: I think Walter's reason was that such macros would hide too many idiosyncrasies in how they were programmed, such that a lot of code which

Re: What are AST Macros?

2018-04-09 Thread Cym13 via Digitalmars-d
On Monday, 9 April 2018 at 15:30:33 UTC, Stefan Koch wrote: On Friday, 6 April 2018 at 21:45:45 UTC, Zach Tollen wrote: I think Walter's reason was that such macros would hide too many idiosyncrasies in how they were programmed, such that a lot of code which seems simple on the surface will a

Re: What are AST Macros?

2018-04-09 Thread Stefan Koch via Digitalmars-d
On Friday, 6 April 2018 at 21:45:45 UTC, Zach Tollen wrote: I think Walter's reason was that such macros would hide too many idiosyncrasies in how they were programmed, such that a lot of code which seems simple on the surface will actually obfuscate complicated and arbitrary macro-programmin

Re: What are AST Macros?

2018-04-06 Thread Zach Tollen via Digitalmars-d
On Friday, 6 April 2018 at 21:23:00 UTC, Jonathan M Davis wrote: D does not have any kind of AST macros and likely never will. Walter is completely against the idea - though I'd have to go digging through newsgroup's history to find posts where he talked about it to give the exact reasons. It's

Re: What are AST Macros?

2018-04-06 Thread Jonathan M Davis via Digitalmars-d
On Friday, April 06, 2018 20:33:10 Chris Katko via Digitalmars-d wrote: > Sorry if this is "re-opening" an old thread, but did anything > come from this and DIP50? It seems like a really interesting > concept and this thread was one of the first results for a Google > search. D does not have any k

Re: What are AST Macros?

2018-04-06 Thread Chris Katko via Digitalmars-d
Sorry if this is "re-opening" an old thread, but did anything come from this and DIP50? It seems like a really interesting concept and this thread was one of the first results for a Google search. Thanks.

Re: What are AST Macros?

2010-07-19 Thread Bruno Medeiros
On 13/07/2010 19:00, Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:i1i332$19j...@digitalmars.com... On 07/13/2010 10:48 AM, retard wrote: Facebook. Nothing personal, but I wouldn't consider any of those social networking sites to be remotely "serious". They're like the

Re: What are AST Macros?

2010-07-14 Thread Johan Granberg
Justin Johansson wrote: > Johan Granberg wrote: >> Nick Sabalausky wrote: >>> Plus, there's the whole duplication of code: D parser in C++, plus a D >>> parser in D CTFE. >> >> On the other hand this would give us an D parser in D that might help in >> making D self hosting. > > Not a chance --

Re: What are AST Macros?

2010-07-14 Thread Andrei Alexandrescu
On 07/14/2010 12:07 PM, retard wrote: Tue, 13 Jul 2010 13:30:43 -0500, Andrei Alexandrescu wrote: On 07/13/2010 01:00 PM, Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:i1i332$19j...@digitalmars.com... On 07/13/2010 10:48 AM, retard wrote: Mon, 12 Jul 2010 16:53:12 -040

Re: What are AST Macros?

2010-07-14 Thread retard
Tue, 13 Jul 2010 13:30:43 -0500, Andrei Alexandrescu wrote: > On 07/13/2010 01:00 PM, Nick Sabalausky wrote: >> "Andrei Alexandrescu" wrote in message >> news:i1i332$19j...@digitalmars.com... >>> On 07/13/2010 10:48 AM, retard wrote: Mon, 12 Jul 2010 16:53:12 -0400, Steven Schveighoffer wrot

Re: What are AST Macros?

2010-07-14 Thread Justin Johansson
Johan Granberg wrote: Nick Sabalausky wrote: Plus, there's the whole duplication of code: D parser in C++, plus a D parser in D CTFE. On the other hand this would give us an D parser in D that might help in making D self hosting. Not a chance -- pigs will fly before that and before that that

Re: What are AST Macros?

2010-07-14 Thread Clemens
Johan Granberg Wrote: > Nick Sabalausky wrote: > > Plus, there's the whole duplication of code: D parser in C++, plus a D > > parser in D CTFE. > > On the other hand this would give us an D parser in D that might help in > making D self hosting. > http://code.google.com/p/dil/ "Dil is a hand-c

Re: What are AST Macros?

2010-07-14 Thread Johan Granberg
Nick Sabalausky wrote: > Plus, there's the whole duplication of code: D parser in C++, plus a D > parser in D CTFE. On the other hand this would give us an D parser in D that might help in making D self hosting.

Re: What are AST Macros?

2010-07-13 Thread retard
Wed, 14 Jul 2010 07:45:18 +0930, Justin Johansson wrote: > Nick Sabalausky wrote: >> "retard" wrote in message >> news:i1i1se$or...@digitalmars.com... >>> Php is basically a toy example of a language. Nobody uses it for >>> serious work. You just think your work is serious, but it isn't. Php >>>

Re: What are AST Macros?

2010-07-13 Thread Jonathan M Davis
On Tuesday, July 13, 2010 12:00:45 Nick Sabalausky wrote: > "Steven Schveighoffer" wrote in message > news:op.vfsn2hvweav...@localhost.localdomain... > > > Just for fun, how would you define a serious language? > > > > 1. Major major websites use it (facebook is one example, there are many > > m

Re: What are AST Macros?

2010-07-13 Thread Justin Johansson
Nick Sabalausky wrote: "retard" wrote in message news:i1i1se$or...@digitalmars.com... Php is basically a toy example of a language. Nobody uses it for serious work. You just think your work is serious, but it isn't. Php shows what the world would look like if it was created by an "intelligent

Re: What are AST Macros?

2010-07-13 Thread Justin Johansson
retard wrote: Mon, 12 Jul 2010 16:53:12 -0400, Steven Schveighoffer wrote: Brainfuck is basically a toy example of a language. Nobody uses it for serious work. Having used php for the last year in my job, there is one thing I appreciate: with a language that is focused on string manipulat

Re: What are AST Macros?

2010-07-13 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:i1ihke$253...@digitalmars.com... > On 07/13/2010 02:00 PM, Nick Sabalausky wrote: >> "Steven Schveighoffer" wrote in message >> news:op.vfsn2hvweav...@localhost.localdomain... >>> >>> Just for fun, how would you define a serious language? >>> >>> 1. Ma

Re: What are AST Macros?

2010-07-13 Thread Andrei Alexandrescu
On 07/13/2010 02:00 PM, Nick Sabalausky wrote: "Steven Schveighoffer" wrote in message news:op.vfsn2hvweav...@localhost.localdomain... Just for fun, how would you define a serious language? 1. Major major websites use it (facebook is one example, there are many more). 2. There are lots of boo

Re: What are AST Macros?

2010-07-13 Thread Nick Sabalausky
"Steven Schveighoffer" wrote in message news:op.vfsn2hvweav...@localhost.localdomain... > > Just for fun, how would you define a serious language? > > 1. Major major websites use it (facebook is one example, there are many > more). > 2. There are lots of books about it. > 3. people make serious

Re: What are AST Macros?

2010-07-13 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:i1ibci$1om...@digitalmars.com... > On 07/13/2010 01:00 PM, Nick Sabalausky wrote: >> >> Nothing personal, but I wouldn't consider any of those social networking >> sites to be remotely "serious". > > Me neither until I started working for them. Facebook

Re: What are AST Macros?

2010-07-13 Thread Andrei Alexandrescu
On 07/13/2010 01:00 PM, Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:i1i332$19j...@digitalmars.com... On 07/13/2010 10:48 AM, retard wrote: Mon, 12 Jul 2010 16:53:12 -0400, Steven Schveighoffer wrote: Brainfuck is basically a toy example of a language. Nobody uses it f

Re: What are AST Macros?

2010-07-13 Thread Steven Schveighoffer
On Tue, 13 Jul 2010 14:08:15 -0400, Nick Sabalausky wrote: "retard" wrote in message news:i1i1se$or...@digitalmars.com... Php is basically a toy example of a language. Nobody uses it for serious work. You just think your work is serious, but it isn't. Php shows what the world would look

Re: What are AST Macros?

2010-07-13 Thread Nick Sabalausky
"retard" wrote in message news:i1i1se$or...@digitalmars.com... > > Php is basically a toy example of a language. Nobody uses it for serious > work. You just think your work is serious, but it isn't. Php shows what > the world would look like if it was created by an "intelligent designer". > I w

Re: What are AST Macros?

2010-07-13 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:i1i332$19j...@digitalmars.com... > On 07/13/2010 10:48 AM, retard wrote: >> Mon, 12 Jul 2010 16:53:12 -0400, Steven Schveighoffer wrote: >> >>> Brainfuck is basically a toy example of a language. Nobody uses it for >>> serious work. >> >>> Having used

Re: What are AST Macros?

2010-07-13 Thread Nick Sabalausky
"Steven Schveighoffer" wrote in message news:op.vfr7dti0eav...@localhost.localdomain... > > Pulling apart an expression and reassmbling it can solve some problems, > but the majority of the reason to need macros is to generate code, not to > read it and rewrite it. > I can't help wondering

Re: What are AST Macros?

2010-07-13 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:i1i8o8$1kb...@digitalmars.com... > "Don" wrote in message > news:i1h6br$2ng...@digitalmars.com... >> Rainer Deyke wrote: >>> On 7/13/2010 01:03, Nick Sabalausky wrote: "Rainer Deyke" wrote in message news:i1gs16$1oj...@digitalmars.com... >

Re: What are AST Macros?

2010-07-13 Thread Nick Sabalausky
"Don" wrote in message news:i1h6br$2ng...@digitalmars.com... > Rainer Deyke wrote: >> On 7/13/2010 01:03, Nick Sabalausky wrote: >>> "Rainer Deyke" wrote in message >>> news:i1gs16$1oj...@digitalmars.com... The great strength of string mixins is that you can use them to add the AST ma

Re: What are AST Macros?

2010-07-13 Thread retard
Tue, 13 Jul 2010 13:30:19 -0400, Steven Schveighoffer wrote: > On Tue, 13 Jul 2010 13:20:03 -0400, retard wrote: > >> It doesn't matter what language you use. The concepts are the same >> regardless of the syntax. If I liked the parenthesis hell, I'd probably >> use Lisp. But it's still not a go

Re: What are AST Macros?

2010-07-13 Thread Steven Schveighoffer
On Tue, 13 Jul 2010 13:20:03 -0400, retard wrote: It doesn't matter what language you use. The concepts are the same regardless of the syntax. If I liked the parenthesis hell, I'd probably use Lisp. But it's still not a good argument to bring up every time Lisp is being discussed. You're dismis

Re: What are AST Macros?

2010-07-13 Thread retard
Tue, 13 Jul 2010 13:09:08 -0400, Steven Schveighoffer wrote: > On Tue, 13 Jul 2010 11:48:30 -0400, retard wrote: > >> Mon, 12 Jul 2010 16:53:12 -0400, Steven Schveighoffer wrote: >> >>> Brainfuck is basically a toy example of a language. Nobody uses it >>> for serious work. >> >>> Having used p

Re: What are AST Macros?

2010-07-13 Thread retard
Tue, 13 Jul 2010 11:09:07 -0500, Andrei Alexandrescu wrote: > On 07/13/2010 10:48 AM, retard wrote: >> Mon, 12 Jul 2010 16:53:12 -0400, Steven Schveighoffer wrote: >> >>> Brainfuck is basically a toy example of a language. Nobody uses it >>> for serious work. >> >>> Having used php for the last y

Re: What are AST Macros?

2010-07-13 Thread Steven Schveighoffer
On Tue, 13 Jul 2010 11:48:30 -0400, retard wrote: Mon, 12 Jul 2010 16:53:12 -0400, Steven Schveighoffer wrote: Brainfuck is basically a toy example of a language. Nobody uses it for serious work. Having used php for the last year in my job, there is one thing I appreciate: with a language

Re: What are AST Macros?

2010-07-13 Thread retard
Tue, 13 Jul 2010 04:58:04 -0400, bearophile wrote: > Don: >> CTFE isn't intrinsically slow. The reason it's so slow in DMD right now >> is that the treatment of CTFE variables is done in an absurdly >> inefficient way. > > Are those arrays managed like immutable arrays in a functional language? >

Re: What are AST Macros?

2010-07-13 Thread Ellery Newcomer
On 07/13/2010 11:09 AM, Andrei Alexandrescu wrote: On 07/13/2010 10:48 AM, retard wrote: Php is basically a toy example of a language. Nobody uses it for serious work. Facebook. Andrei Wait, which side are you arguing for?

Re: What are AST Macros?

2010-07-13 Thread Andrei Alexandrescu
On 07/13/2010 10:48 AM, retard wrote: Mon, 12 Jul 2010 16:53:12 -0400, Steven Schveighoffer wrote: Brainfuck is basically a toy example of a language. Nobody uses it for serious work. Having used php for the last year in my job, there is one thing I appreciate: with a language that is focus

Re: What are AST Macros?

2010-07-13 Thread Andrei Alexandrescu
On 07/13/2010 10:43 AM, retard wrote: Yes, this would be possible if the dmd compiler didn't crash, leak memory etc. The quality is so shitty that I'd say that implementing a compile time AST parser for D 2 is almost impossible. Well it should be said that the quality of the compiler has dramat

Re: What are AST Macros?

2010-07-13 Thread retard
Mon, 12 Jul 2010 16:53:12 -0400, Steven Schveighoffer wrote: > Brainfuck is basically a toy example of a language. Nobody uses it for > serious work. > Having used php for the last year in my job, there is one thing I > appreciate: with a language that is focused on string manipulation, it > i

Re: What are AST Macros?

2010-07-13 Thread retard
Mon, 12 Jul 2010 14:57:35 +, pillsy wrote: > == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article >> On Mon, 12 Jul 2010 09:33:34 -0400, Ellery Newcomer >> wrote: > [...] >> > I think the big thing about macros is you don't have to worry about >> > lexing and parsing. > >> > if

Re: What are AST Macros?

2010-07-13 Thread Steven Schveighoffer
On Mon, 12 Jul 2010 20:00:12 -0400, pillsy wrote: == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article: On Mon, 12 Jul 2010 16:22:28 -0400, bearophile wrote: [...] > In my opinion the std.bitmanip.bitfields souce code is already past the > decency limit for string mixins,

Re: What are AST Macros?

2010-07-13 Thread Steven Schveighoffer
On Mon, 12 Jul 2010 19:21:08 -0400, Nick Sabalausky wrote: "Steven Schveighoffer" wrote in message news:op.vfq0aydoeav...@localhost.localdomain... On Mon, 12 Jul 2010 16:22:28 -0400, bearophile wrote: Steven Schveighoffer: bearophile: > String mixins are a hack, just a bit better than C

Re: What are AST Macros?

2010-07-13 Thread Don
bearophile wrote: Don: CTFE isn't intrinsically slow. The reason it's so slow in DMD right now is that the treatment of CTFE variables is done in an absurdly inefficient way. Are those arrays managed like immutable arrays in a functional language? :-) *Everything* is done with copy-on-write

Re: What are AST Macros?

2010-07-13 Thread bearophile
Don: > CTFE isn't intrinsically slow. The reason it's so slow in DMD right now > is that the treatment of CTFE variables is done in an absurdly > inefficient way. Are those arrays managed like immutable arrays in a functional language? :-) To implement mutable arrays with an immutable data struc

Re: What are AST Macros?

2010-07-13 Thread Don
Rainer Deyke wrote: On 7/13/2010 01:03, Nick Sabalausky wrote: "Rainer Deyke" wrote in message news:i1gs16$1oj...@digitalmars.com... The great strength of string mixins is that you can use them to add the AST macros to D. The great weakness of string mixins is that doing so requires a full (a

Re: What are AST Macros?

2010-07-13 Thread Nick Sabalausky
"Rainer Deyke" wrote in message news:i1h52o$2kb...@digitalmars.com... > On 7/13/2010 01:03, Nick Sabalausky wrote: >> "Rainer Deyke" wrote in message >> news:i1gs16$1oj...@digitalmars.com... >>> The great strength of string mixins is that you can use them to add the >>> AST macros to D. The gre

Re: What are AST Macros?

2010-07-13 Thread Rainer Deyke
On 7/13/2010 01:03, Nick Sabalausky wrote: > "Rainer Deyke" wrote in message > news:i1gs16$1oj...@digitalmars.com... >> The great strength of string mixins is that you can use them to add the >> AST macros to D. The great weakness of string mixins is that doing so >> requires a full (and extenda

Re: What are AST Macros?

2010-07-13 Thread Nick Sabalausky
"Rainer Deyke" wrote in message news:i1gs16$1oj...@digitalmars.com... > On 7/12/2010 19:41, Nick Sabalausky wrote: >> I already agreed to that part ("For writing, yes..."). But there are >> other >> uses that *do* parse, and others that do both. The point is NOT that >> string >> mixins are *al

Re: What are AST Macros?

2010-07-12 Thread Rainer Deyke
On 7/12/2010 19:41, Nick Sabalausky wrote: > I already agreed to that part ("For writing, yes..."). But there are other > uses that *do* parse, and others that do both. The point is NOT that string > mixins are *always* unsatisfactory as a replacement for AST macros. The > point is that *there a

Re: What are AST Macros?

2010-07-12 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:i1ge6c$c9...@digitalmars.com... > On 07/12/2010 06:21 PM, Nick Sabalausky wrote: >> "Steven Schveighoffer" wrote in message >>> >>> Brainfuck is basically a toy example of a language. Nobody uses it for >>> serious work. Mixins are much better than a

Re: What are AST Macros?

2010-07-12 Thread Andrei Alexandrescu
On 07/12/2010 06:21 PM, Nick Sabalausky wrote: "Steven Schveighoffer" wrote in message news:op.vfq0aydoeav...@localhost.localdomain... On Mon, 12 Jul 2010 16:22:28 -0400, bearophile wrote: Steven Schveighoffer: bearophile: String mixins are a hack, just a bit better than C preprocessor (be

Re: What are AST Macros?

2010-07-12 Thread pillsy
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article: > On Mon, 12 Jul 2010 16:22:28 -0400, bearophile > wrote: [...] > > In my opinion the std.bitmanip.bitfields souce code is already past the > > decency limit for string mixins, and I hope they will be replaced by > > something be

Re: What are AST Macros?

2010-07-12 Thread bearophile
Andrei Alexandrescu: > Back on topic: http://www.apl.jhu.edu/~hall/Lisp-Notes/Macros.html. > Compare the simple macro in the beginning and the correct macro at the end. CLisp macros are messy, they can be not easy to read and understand, and worse of all they can fragment the community because e

Re: What are AST Macros?

2010-07-12 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:i1g5aq$2vk...@digitalmars.com... > > Back on topic: http://www.apl.jhu.edu/~hall/Lisp-Notes/Macros.html. > Compare the simple macro in the beginning and the correct macro at the > end. > I can't read ordinary lisp, but Nemerle's macros seem pretty da

Re: What are AST Macros?

2010-07-12 Thread Nick Sabalausky
"Steven Schveighoffer" wrote in message news:op.vfq0aydoeav...@localhost.localdomain... > On Mon, 12 Jul 2010 16:22:28 -0400, bearophile > wrote: > >> Steven Schveighoffer: >>> bearophile: >>> > String mixins are a hack, just a bit better than C preprocessor >>> (because >>> > they are scoped),

Re: What are AST Macros?

2010-07-12 Thread Andrei Alexandrescu
On 07/12/2010 03:22 PM, bearophile wrote: Steven Schveighoffer: bearophile: String mixins are a hack, just a bit better than C preprocessor (because they are scoped), they are not a replacement of clean macros. Interesting statement, can you back it up? :) What can you do with a macro that y

Re: What are AST Macros?

2010-07-12 Thread Steven Schveighoffer
On Mon, 12 Jul 2010 16:22:28 -0400, bearophile wrote: Steven Schveighoffer: bearophile: > String mixins are a hack, just a bit better than C preprocessor (because > they are scoped), they are not a replacement of clean macros. Interesting statement, can you back it up? :) What can you d

Re: What are AST Macros?

2010-07-12 Thread bearophile
Steven Schveighoffer: > bearophile: > > String mixins are a hack, just a bit better than C preprocessor (because > > they are scoped), they are not a replacement of clean macros. > > Interesting statement, can you back it up? :) What can you do with a > macro that you can't do with a mixin?

Re: What are AST Macros?

2010-07-12 Thread Andrei Alexandrescu
On 07/12/2010 09:57 AM, pillsy wrote: == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article On Mon, 12 Jul 2010 09:33:34 -0400, Ellery Newcomer wrote: [...] I think the big thing about macros is you don't have to worry about lexing and parsing. if is of the form (Assignable,

Re: What are AST Macros?

2010-07-12 Thread pillsy
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article > On Mon, 12 Jul 2010 09:33:34 -0400, Ellery Newcomer > wrote: [...] > > I think the big thing about macros is you don't have to > > worry about lexing and parsing. > > if is of the form (Assignable, Assignable, ... ), > > and o

Re: What are AST Macros?

2010-07-12 Thread Steven Schveighoffer
On Mon, 12 Jul 2010 09:33:34 -0400, Ellery Newcomer wrote: On 07/12/2010 07:30 AM, Steven Schveighoffer wrote: On Mon, 12 Jul 2010 08:12:31 -0400, bearophile wrote: Steven Schveighoffer: If people agree that AST macros are superseded by mixins, String mixins are a hack, just a bit bett

Re: What are AST Macros?

2010-07-12 Thread Ellery Newcomer
On 07/12/2010 07:30 AM, Steven Schveighoffer wrote: On Mon, 12 Jul 2010 08:12:31 -0400, bearophile wrote: Steven Schveighoffer: If people agree that AST macros are superseded by mixins, String mixins are a hack, just a bit better than C preprocessor (because they are scoped), they are not a

Re: What are AST Macros?

2010-07-12 Thread Steven Schveighoffer
On Mon, 12 Jul 2010 08:12:31 -0400, bearophile wrote: Steven Schveighoffer: If people agree that AST macros are superseded by mixins, String mixins are a hack, just a bit better than C preprocessor (because they are scoped), they are not a replacement of clean macros. Interesting state

Re: What are AST Macros?

2010-07-12 Thread bearophile
Steven Schveighoffer: > If people agree that AST macros are superseded by mixins, String mixins are a hack, just a bit better than C preprocessor (because they are scoped), they are not a replacement of clean macros. Bye, bearophile

Re: What are AST Macros?

2010-07-12 Thread Steven Schveighoffer
On Sun, 11 Jul 2010 07:01:49 -0400, Don wrote: retard wrote: Thu, 08 Jul 2010 21:43:57 -0400, Robert Jacques wrote: Check out Walter's slides and/or talk from the D conference. (http://www.digitalmars.com/webnews/newsgroups.php? art_group=digitalmars.D.announce&article_id=12555) AST does st

Re: What are AST Macros?

2010-07-12 Thread Don
Ellery Newcomer wrote: On 07/11/2010 06:57 PM, retard wrote: Sun, 11 Jul 2010 22:03:56 +, pillsy wrote: == Quote from Don (nos...@nospam.com)'s article Philippe Sigaud wrote: [...] String mixins sure are powerful, but I can't get ird of a feeling of 'cheating' when using them. Maybe wi

Re: What are AST Macros?

2010-07-11 Thread Ellery Newcomer
On 07/11/2010 06:57 PM, retard wrote: Sun, 11 Jul 2010 22:03:56 +, pillsy wrote: == Quote from Don (nos...@nospam.com)'s article Philippe Sigaud wrote: [...] String mixins sure are powerful, but I can't get ird of a feeling of 'cheating' when using them. Maybe with some kind of string i

Re: What are AST Macros?

2010-07-11 Thread retard
Sun, 11 Jul 2010 22:03:56 +, pillsy wrote: > == Quote from Don (nos...@nospam.com)'s article > >> Philippe Sigaud wrote: > [...] >> > String mixins sure are powerful, but I can't get ird of a feeling of >> > 'cheating' when using them. Maybe with some kind of string >> > interpolation they co

Re: What are AST Macros?

2010-07-11 Thread pillsy
== Quote from Don (nos...@nospam.com)'s article > Philippe Sigaud wrote: [...] > > String mixins sure are powerful, but I can't get ird of a feeling of > > 'cheating' when using them. Maybe with some kind of string interpolation > > they could be made more palatable to some? > There's little doub

Re: What are AST Macros?

2010-07-11 Thread Nick Sabalausky
"Chad J" wrote in message news:i1d8j4$134...@digitalmars.com... > On 07/11/2010 12:58 PM, Rory McGuire wrote: >> On Sun, 11 Jul 2010 15:29:36 +0200, Michel Fortin >> wrote: >>> int num = 1; >>> string result = substitute!"Number: $num"; >>> assert(result == "Number: 1"); >>> >> >> so

Re: What are AST Macros?

2010-07-11 Thread Chad J
On 07/11/2010 12:58 PM, Rory McGuire wrote: > On Sun, 11 Jul 2010 15:29:36 +0200, Michel Fortin > wrote: > >> On 2010-07-11 08:47:26 -0400, "Lars T. Kyllingstad" >> said: >> >>> On Sun, 11 Jul 2010 14:26:51 +0200, Philippe Sigaud wrote: >>> That's interesting. Do you have a link or any text

Re: What are AST Macros?

2010-07-11 Thread Rory McGuire
On Sun, 11 Jul 2010 21:55:30 +0200, Philippe Sigaud wrote:On Sun, Jul 11, 2010 at 18:58, Rory McGuire wrote: On Sun, 11 Jul 2010 15:29:36 +0200, Michel Fortin wrote:        int num = 1;        string result = substitute!"Number: $num";  

Re: What are AST Macros?

2010-07-11 Thread Philippe Sigaud
On Sun, Jul 11, 2010 at 18:58, Rory McGuire wrote: > On Sun, 11 Jul 2010 15:29:36 +0200, Michel Fortin < > michel.for...@michelf.com> wrote: > >> >>int num = 1; >>string result = substitute!"Number: $num"; >>assert(result == "Number: 1"); >> >> > someone already made somet

Re: What are AST Macros?

2010-07-11 Thread Rory McGuire
On Sun, 11 Jul 2010 15:29:36 +0200, Michel Fortin wrote: On 2010-07-11 08:47:26 -0400, "Lars T. Kyllingstad" said: On Sun, 11 Jul 2010 14:26:51 +0200, Philippe Sigaud wrote: That's interesting. Do you have a link or any text I could read on that? String mixins sure are powerful, but

Re: What are AST Macros?

2010-07-11 Thread Michel Fortin
On 2010-07-11 08:47:26 -0400, "Lars T. Kyllingstad" said: On Sun, 11 Jul 2010 14:26:51 +0200, Philippe Sigaud wrote: That's interesting. Do you have a link or any text I could read on that? String mixins sure are powerful, but I can't get ird of a feeling of 'cheating' when using them. Maybe

Re: What are AST Macros?

2010-07-11 Thread Don
Philippe Sigaud wrote: Don wrote: Part of what happened was that at the conference, I showed that the functionality of string mixins was a superset of what was planned for AST macros. Since that time, there has not been any kind of proposal, or even a concept. So it's a bit mean

Re: What are AST Macros?

2010-07-11 Thread Lars T. Kyllingstad
On Sun, 11 Jul 2010 14:26:51 +0200, Philippe Sigaud wrote: > Don wrote: > > >> Part of what happened was that at the conference, I showed that the >> functionality of string mixins was a superset of what was planned for >> AST macros. Since that time, there has not been any kind of proposal, >>

Re: What are AST Macros?

2010-07-11 Thread Philippe Sigaud
Don wrote: > > Part of what happened was that at the conference, I showed that the > functionality of string mixins was a superset of what was planned for AST > macros. Since that time, there has not been any kind of proposal, or even a > concept. So it's a bit meaningless to talk about "AST macro

Re: What are AST Macros?

2010-07-11 Thread Don
retard wrote: Thu, 08 Jul 2010 21:43:57 -0400, Robert Jacques wrote: Check out Walter's slides and/or talk from the D conference. (http://www.digitalmars.com/webnews/newsgroups.php? art_group=digitalmars.D.announce&article_id=12555) AST does stand for abstract syntax tree and they are much mo

Re: What are AST Macros?

2010-07-10 Thread retard
Thu, 08 Jul 2010 21:43:57 -0400, Robert Jacques wrote: > Check out Walter's slides and/or talk from the D conference. > (http://www.digitalmars.com/webnews/newsgroups.php? art_group=digitalmars.D.announce&article_id=12555) > AST does stand for abstract syntax tree and they are much more like Lisp

Re: What are AST Macros?

2010-07-08 Thread Nick Sabalausky
"Robert Jacques" wrote in message news:op.vfjy3jlo26s...@sandford... > > Check out Walter's slides and/or talk from the D conference. > (http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.announce&article_id=12555) > AST does stand for abstract syntax tree and they are muc

Re: What are AST Macros?

2010-07-08 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:i15uqd$191...@digitalmars.com... > > > You're right, AST is "Abstract Syntax Tree". As for what that actually Also, I'm very close to a new release of my Goldie language-processing project ( http://www.dsource.org/projects/goldie ). There are some tools i

Re: What are AST Macros?

2010-07-08 Thread Robert Jacques
I've ever seen an actual explanation for what exactly is meant by the term AST macro. This raises two questions 1. What are AST macros and how do they differ from C-style macros? We obviously aren't going to be adding macros like that to D, since that would be dangerous. But what w

Re: What are AST Macros?

2010-07-08 Thread Nick Sabalausky
ible > replacement for template mxins. However, I don't think that I've ever seen > an > actual explanation for what exactly is meant by the term AST macro. This > raises > two questions > > 1. What are AST macros and how do they differ from C-style macros? We > obv

What are AST Macros?

2010-07-08 Thread Jonathan M Davis
ant by the term AST macro. This raises two questions 1. What are AST macros and how do they differ from C-style macros? We obviously aren't going to be adding macros like that to D, since that would be dangerous. But what would a macro be then if it's not a textual replacement? The best I