Re: How do I find the arity of an Expression? (dmd hacking)

2009-12-03 Thread Don
Ellery Newcomer wrote: On 12/01/2009 02:35 PM, Chad J wrote: No guarantees, but a lot of promise. http://erdani.com/d/thermopylae.pdf On page 114 of the draft, 14 of the pdf, in section 4.1.10, at the bottom: notice how Andrei seems to be hedging on properties working correctly. Oh goodie.

Re: How do I find the arity of an Expression? (dmd hacking)

2009-12-01 Thread Chad J
Ellery Newcomer wrote: On 11/30/2009 07:59 PM, Chad J wrote: This is about the property expression rewrite of course. I'd love to just use the current convention in dmd and write the rewrite as a non-recursive function that gets called at every point in the tree whenever

Re: How do I find the arity of an Expression? (dmd hacking)

2009-12-01 Thread Ellery Newcomer
On 12/01/2009 02:35 PM, Chad J wrote: No guarantees, but a lot of promise. http://erdani.com/d/thermopylae.pdf On page 114 of the draft, 14 of the pdf, in section 4.1.10, at the bottom: notice how Andrei seems to be hedging on properties working correctly. Oh goodie. We're going to get

Re: How do I find the arity of an Expression? (dmd hacking)

2009-11-30 Thread Ary Borenszweig
Chad J wrote: Given an Expression object in dmd, I'd like to know how many subexpressions it contains and, even better, iterate over them. I'd like to do this in a general way, without having to create cases for all of the different kinds of Expressions. Is there some way to do this that I've

Re: How do I find the arity of an Expression? (dmd hacking)

2009-11-30 Thread Ellery Newcomer
On 11/30/2009 03:53 AM, Ary Borenszweig wrote: Chad J wrote: Given an Expression object in dmd, I'd like to know how many subexpressions it contains and, even better, iterate over them. I'd like to do this in a general way, without having to create cases for all of the different kinds of

Re: How do I find the arity of an Expression? (dmd hacking)

2009-11-30 Thread Chad J
Ellery Newcomer wrote: On 11/30/2009 03:53 AM, Ary Borenszweig wrote: Chad J wrote: Given an Expression object in dmd, I'd like to know how many subexpressions it contains and, even better, iterate over them. I'd like to do this in a general way, without having to create cases for all of the

Re: How do I find the arity of an Expression? (dmd hacking)

2009-11-30 Thread Ellery Newcomer
On 11/30/2009 12:32 PM, Chad J wrote: Ellery Newcomer wrote: On 11/30/2009 03:53 AM, Ary Borenszweig wrote: Chad J wrote: Given an Expression object in dmd, I'd like to know how many subexpressions it contains and, even better, iterate over them. I'd like to do this in a general way, without

Re: How do I find the arity of an Expression? (dmd hacking)

2009-11-30 Thread Ary Borenszweig
Ellery Newcomer wrote: On 11/30/2009 12:32 PM, Chad J wrote: Ellery Newcomer wrote: On 11/30/2009 03:53 AM, Ary Borenszweig wrote: Chad J wrote: Given an Expression object in dmd, I'd like to know how many subexpressions it contains and, even better, iterate over them. I'd like to do this in

Re: How do I find the arity of an Expression? (dmd hacking)

2009-11-30 Thread Chad J
I think I'll reply to both of you in one post since the thoughts are related. Ary Borenszweig wrote: Ellery Newcomer wrote: Not that I know anything about DMD outside parse.c, but in expression.h, there be decls along the lines of struct UnaExp{ Expression* e1; } struct BinExp{

Re: How do I find the arity of an Expression? (dmd hacking)

2009-11-30 Thread Ellery Newcomer
On 11/30/2009 07:59 PM, Chad J wrote: If you care for a bit of reading, I'll tell you my story and ping an idea. This is about the property expression rewrite of course. I'd love to just use the current convention in dmd and write the rewrite as a non-recursive function that gets called at

How do I find the arity of an Expression? (dmd hacking)

2009-11-29 Thread Chad J
Given an Expression object in dmd, I'd like to know how many subexpressions it contains and, even better, iterate over them. I'd like to do this in a general way, without having to create cases for all of the different kinds of Expressions. Is there some way to do this that I've been missing?