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...@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

Reply via email to