Why I'm hesitating to switch to D

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Jul 2 22:34:04 PDT 2011


On 7/2/11 11:39 PM, Walter Bright wrote:
> On 6/30/2011 7:31 AM, Adam Ruppe wrote:
>> Macros:
>> TABLE=<table>$0</table>
>>
>> TH=<th>$1</th>$(TH $+)
>> HEADERS=<tr>$(TH $1, $+)</tr>
>>
>> TD=<td>$1</td>$(TD $+)
>> ROW=<tr>$(TD $1, $+)</tr>
>
>
> Your idea also works for lists:
>
> $(UL
> $(LI item 1)
> $(LI item 2)
> )
>
> now becomes:
>
> $(LIST
> item 1,
> item 2
> )
>
> where:
>
> LI=<li>$1</li>$(LI $+)
> LIST=$(UL $(LI $1, $+))

Excellent idea. To complement it, we need a "text with commas" kind of 
thing so we don't need to insert $(COMMA) in longer list items:

TXT = $0

$(LIST
$(TXT stuff, with, commas),
stuff without commas,
$(TXT got, the, idea)
)

Works?

Andrei


More information about the Digitalmars-d mailing list