Why I'm hesitating to switch to D

Walter Bright newshound2 at digitalmars.com
Sat Jul 2 21:39:23 PDT 2011


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, $+))


More information about the Digitalmars-d mailing list