September 05, 2007
Jari-Matti Mäkelä wrote:
> Robert Fraser wrote:
>> Jari-Matti Mäkelä Wrote:
> 
>>> If I understood it correctly, the macros only do a simple substitution
>>> using their parameters, hide symbols when necessary (hygiene) and then
>>> attach the generated code to the AST.
>> I think that's about right, but remember that their parameters can
>> specialize on any pattern and extract parts of the expression, which I
>> think is the most exciting feature.
> 
> Ah, good point. That would make overloading and recursive calls the primary
> control flow constructs then. 

Such an environment is not pleasant as it involves large code overheads. It's what's required in C++ template metaprogramming; D made this *much* nicer by introducing static if. Please don't take a step backwards with macros.

   -- Reiner
September 06, 2007
Reiner Pope wrote:
> Jari-Matti Mäkelä wrote:
>> Robert Fraser wrote:
>>> Jari-Matti Mäkelä Wrote:
>>
>>>> If I understood it correctly, the macros only do a simple substitution
>>>> using their parameters, hide symbols when necessary (hygiene) and then
>>>> attach the generated code to the AST.
>>> I think that's about right, but remember that their parameters can
>>> specialize on any pattern and extract parts of the expression, which I
>>> think is the most exciting feature.
>>
>> Ah, good point. That would make overloading and recursive calls the primary
>> control flow constructs then. 
> 
> Such an environment is not pleasant as it involves large code overheads. It's what's required in C++ template metaprogramming; D made this *much* nicer by introducing static if. 

And even better (perfect in many cases) with CTFE.

> Please don't take a step backwards with macros.

This was the reaction I had too. There's really no need for macros to provide new functionality, they just need to provide syntax sugar for what we can already do with string mixins.
September 06, 2007
Don Clugston wrote:
> Reiner Pope wrote:
>> Jari-Matti Mäkelä wrote:
>>> Robert Fraser wrote:
>>>> Jari-Matti Mäkelä Wrote:
>>>
>>>>> If I understood it correctly, the macros only do a simple substitution
>>>>> using their parameters, hide symbols when necessary (hygiene) and then
>>>>> attach the generated code to the AST.
>>>> I think that's about right, but remember that their parameters can
>>>> specialize on any pattern and extract parts of the expression, which I
>>>> think is the most exciting feature.
>>>
>>> Ah, good point. That would make overloading and recursive calls the primary
>>> control flow constructs then. 
>>
>> Such an environment is not pleasant as it involves large code overheads. It's what's required in C++ template metaprogramming; D made this *much* nicer by introducing static if. 
> 
> And even better (perfect in many cases) with CTFE.
> 
>> Please don't take a step backwards with macros.
> 
> This was the reaction I had too. There's really no need for macros to provide new functionality, they just need to provide syntax sugar for what we can already do with string mixins.

But the hygiene of macros is certainly appealing, no?
September 07, 2007
Reiner Pope wrote:
> Don Clugston wrote:
>> Reiner Pope wrote:
>>> Jari-Matti Mäkelä wrote:
>>>> Robert Fraser wrote:
>>>>> Jari-Matti Mäkelä Wrote:
>>>>
>>>>>> If I understood it correctly, the macros only do a simple substitution
>>>>>> using their parameters, hide symbols when necessary (hygiene) and then
>>>>>> attach the generated code to the AST.
>>>>> I think that's about right, but remember that their parameters can
>>>>> specialize on any pattern and extract parts of the expression, which I
>>>>> think is the most exciting feature.
>>>>
>>>> Ah, good point. That would make overloading and recursive calls the primary
>>>> control flow constructs then. 
>>>
>>> Such an environment is not pleasant as it involves large code overheads. It's what's required in C++ template metaprogramming; D made this *much* nicer by introducing static if. 
>>
>> And even better (perfect in many cases) with CTFE.
>>
>>> Please don't take a step backwards with macros.
>>
>> This was the reaction I had too. There's really no need for macros to provide new functionality, they just need to provide syntax sugar for what we can already do with string mixins.
> 
> But the hygiene of macros is certainly appealing, no?

Definitely. But I was hoping that the inability to have hygienic string mixins was a temporary aberration.
1 2
Next ›   Last »