February 16, 2007 Re: Motivation for compile time function execution | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
>
>
> The tradeoff is you won't be able to generate tuples with functions, but you will be able to handle a couple orders of magnitude larger datasets to work on.
That's something I'm wondering about: how to get static foreach from a compile time function?
One option that would be nice is to give static foreach full status as a static operator. This would require the static keyword (at least in some cases) but allow it in all the same places static if is allowed. Also this could allow const arrays to be used just like tuples
static foreach(char[] string; strings(some, const, data))
{
callMe!(string)();
}
|
February 16, 2007 Re: Motivation for compile time function execution | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pragma | Pragma wrote: > > > Fantastic. D is starting to look like one of those all-in-one Swiss army knives. > http://img.timeinc.net/popsci/images/2006/08/giantknife_485.jpg <G> |
February 16, 2007 Re: Motivation for compile time function execution | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | BCS wrote: > Pragma wrote: >> >> >> Fantastic. D is starting to look like one of those all-in-one Swiss army knives. >> > > > http://img.timeinc.net/popsci/images/2006/08/giantknife_485.jpg > > <G> Thank you! That's *exactly* the knife I was thinking of. D - Before you get around to shooting yourself in the foot, you manage to lop your fingers off with the 99 other attachments on your gun. -- - EricAnderton at yahoo |
February 16, 2007 Re: Motivation for compile time function execution | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pragma | Pragma wrote:
> Walter Bright wrote:
>> To someone who is comfortable with Lisp, I agree that 1, 2, and 3 are moot. But most of us aren't, and a very common request I'd get is to make metaprogramming look "like normal D code." The eventual metaprogramming goal is to get the power of Lisp expressible in the "normal D" syntax.
>
> Actually, FWIW, I'm not comfortable with Lisp. D template coding is just "noisy" enough for me to grok as a list processing grammar. In contrast, my comprehension of Lisp breaks down after about three or four nestings. Yea, I'm probably a huge weirdo in that respect. ;p
>
> But I'm all for the changes and improvements. Your rationale for adding to things is dead on.
You'll have to thank Andrei and Bartosz for that; they kept hating my proposals for new syntax to support metaprogramming <g>. They kept sending me back until I understood the obvious.
|
Copyright © 1999-2021 by the D Language Foundation