[OT] Generating ddili.org with ddoc

Ali Çehreli acehreli at yahoo.com
Sun Nov 3 22:51:14 PST 2013


On 11/03/2013 09:44 PM, Philippe Sigaud wrote:

 >>    COMMA = ,
 >>    DOLLAR = $
 >
 >
 > I saw these and wondered what they were for. Why comma and dollar?

Actual comma inside a macro is taken as argument separator. From 
src/ders/d.en/operator_overloading.d:

$(ROW3 slice to some elements, opSlice, collection[i$(VIRGUL) j])

(Note: VIRGUL is COMMA)

If I used actual comma, " j]" would be taken as an unused extra 
parameter to ROW3.

Dollar sign appears in dlang forum links. The only occurrence so far has 
been inside the Turkish translation of David Nadlinger's purity article, 
src/makale/saflik.d:

$(LINK2 
http://forum.dlang.org/thread/i7bp8o$(DOLAR)6po$(DOLAR)1 at digitalmars.com, son 
değişikleri de getirmiş olan tartışma)

Otherwise, the $ character would be parsed as the beginning of a macro. 
(Perhaps there is some sort of escaping but I just used the DOLAR macro. 
:-/)

Ali



More information about the Digitalmars-d-learn mailing list