May 27, 2015
On Wednesday, 27 May 2015 at 11:53:00 UTC, Jacob Carlborg wrote:
> I have thought of that too. But I haven't been able to come up with a syntax that looks good and doesn't conflict with any existing syntax/symbol. The above syntax is already used for template instantiation.

What if use the symbol '#' ?
May 27, 2015
On Wednesday, 27 May 2015 at 11:53:00 UTC, Jacob Carlborg wrote:
> DIP50 would require a minimal amount of syntax change, the only thing is prefixing a function with the "macro" keyword. DIP78 on the other hand, it's not so easy to see that a function declaration is actual a macro declaration.

Well, that's the point: the function is a normal function, only some of its parameters require specially prepared arguments, this can't be missed as soon as arguments are passed to the respective parameters.

> In that case I would prefer the "macro" keyword. It's already a reserved, for exactly this purpose, so it will be backwards compatible.

Well, maybe, I just didn't need the keyword.

> One thing that would be more complex in DIP50 would be the "Context" class. Although I'm not sure if that's needed in DIP78 as well.

No, passing of Context is not proposed.

>> Maybe a macro should be called with a special syntax,
>> e.g. myAssert!(a==b);
>
> I have thought of that too. But I haven't been able to come up with a syntax that looks good and doesn't conflict with any existing syntax/symbol. The above syntax is already used for template instantiation.

I mean, the template instantiation syntax can inform the compiler that the expression is evaluated at compile time with possible code generation, so that the compiler is prepared to what macro will do. This resembles similarity between macros and templates. If macros can use existing syntax of a function call, I see no problem if they use another existing syntax.
May 27, 2015
On Wed, 27 May 2015 12:07:09 +0000
Dennis Ritchie via Digitalmars-d <digitalmars-d@puremagic.com> wrote:

> On Wednesday, 27 May 2015 at 11:53:00 UTC, Jacob Carlborg wrote:
> > I have thought of that too. But I haven't been able to come up with a syntax that looks good and doesn't conflict with any existing syntax/symbol. The above syntax is already used for template instantiation.
> 
> What if use the symbol '#' ?

Yep, I like this symbol for macro too.
May 27, 2015
On Wednesday, 27 May 2015 at 12:34:49 UTC, Daniel Kozák wrote:
>> What if use the symbol '#' ?
>
> Yep, I like this symbol for macro too.

https://issues.dlang.org/show_bug.cgi?id=2660
May 27, 2015
On Wednesday, 27 May 2015 at 12:34:49 UTC, Daniel Kozák wrote:
>
> On Wed, 27 May 2015 12:07:09 +0000
> Dennis Ritchie via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
>> On Wednesday, 27 May 2015 at 11:53:00 UTC, Jacob Carlborg wrote:
>> > I have thought of that too. But I haven't been able to come up with a syntax that looks good and doesn't conflict with any existing syntax/symbol. The above syntax is already used for template instantiation.
>> 
>> What if use the symbol '#' ?
>
> Yep, I like this symbol for macro too.

What's wrong with using the word macro? We don't want symbol soup.
May 27, 2015
On Wednesday, 27 May 2015 at 12:37:51 UTC, Kagamin wrote:
> On Wednesday, 27 May 2015 at 12:34:49 UTC, Daniel Kozák wrote:
>>> What if use the symbol '#' ?
>>
>> Yep, I like this symbol for macro too.
>
> https://issues.dlang.org/show_bug.cgi?id=2660

OK. This symbol is already used in a wrong place :)

http://dlang.org/lex.html#special-token-sequence

You can still use `:`. The colon is used even to refer to some Lisp macros, for example:

(loop :for key :in keys
    :collect (cons key 0))

Still, as an option, you can use the `'` . This symbol is also used in Lisp, in some places, for example:

(key-weight 'sweet)

Or apostrophes, too, somewhere involved in the D?
May 27, 2015
On Wednesday, 27 May 2015 at 12:55:05 UTC, Dennis Ritchie wrote:
> Or apostrophes, too, somewhere involved in the D?

Similarly, this option is no longer, as is used as:
char c = 'c';

Though...
May 27, 2015
On Wednesday, 27 May 2015 at 12:55:05 UTC, Dennis Ritchie wrote:
> On Wednesday, 27 May 2015 at 12:37:51 UTC, Kagamin wrote:
>> On Wednesday, 27 May 2015 at 12:34:49 UTC, Daniel Kozák wrote:
>>>> What if use the symbol '#' ?
>>>
>>> Yep, I like this symbol for macro too.
>>
>> https://issues.dlang.org/show_bug.cgi?id=2660
>
> OK. This symbol is already used in a wrong place :)
>
> http://dlang.org/lex.html#special-token-sequence
>
> You can still use `:`. The colon is used even to refer to some Lisp macros, for example:
>
> (loop :for key :in keys
>     :collect (cons key 0))
>
> Still, as an option, you can use the `'` . This symbol is also used in Lisp, in some places, for example:
>
> (key-weight 'sweet)
>
> Or apostrophes, too, somewhere involved in the D?

As far as I know, the : and ' symbols in Lisp don't have anything to do with macros. : is for keyword arguments and ' is for creating AST literals. It makes sense that these would be heavily used with macros, of course, but they are not part of Lisp's macro system.
May 27, 2015
On Wednesday, 27 May 2015 at 13:12:05 UTC, Meta wrote:
> As far as I know, the : and ' symbols in Lisp don't have anything to do with macros. : is for keyword arguments and ' is for creating AST literals. It makes sense that these would be heavily used with macros, of course, but they are not part of Lisp's macro system.

Yes, but IMO, these symbols can be activated in the future macrosystem D.
May 27, 2015
On Wednesday, 27 May 2015 at 12:39:52 UTC, ixid wrote:
> On Wednesday, 27 May 2015 at 12:34:49 UTC, Daniel Kozák wrote:
>>
>> On Wed, 27 May 2015 12:07:09 +0000
>> Dennis Ritchie via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>>
>>> On Wednesday, 27 May 2015 at 11:53:00 UTC, Jacob Carlborg wrote:
>>> > I have thought of that too. But I haven't been able to come up with a syntax that looks good and doesn't conflict with any existing syntax/symbol. The above syntax is already used for template instantiation.
>>> 
>>> What if use the symbol '#' ?
>>
>> Yep, I like this symbol for macro too.
>
> What's wrong with using the word macro? We don't want symbol soup.

this, there's a reason people don't use lisp.