Is it possible to escape a reserved keyword in Import/module?
Basile B.
b2.temp at gmx.com
Wed Jun 19 21:48:59 UTC 2019
On Wednesday, 19 June 2019 at 21:21:53 UTC, XavierAP wrote:
> On Wednesday, 19 June 2019 at 18:56:57 UTC, BoQsc wrote:
>> I would like to make sure that my modules do not interfere
>> with d lang. Is there any way to escape reserved words?
>
> The only reason C# allows this is for interop or code
> generation for other languages that use the same keyword. For
> example "class" is an HTML attribute.
>
> There is no excuse to do this for any other reason -- and C#
> gurus would also agree.
>
>> I would like to make sure that my modules do not interfere
>
> Then don't name them as keywords :)
I used twice a similar system (&<keyword>) that exists in ObjFPC.
The context was a RTTI inspector and allowed to have enum members
displayed without using a prefix or a translation table. Just to
say, it's rarely useful but nice to have.
I would have preferred #<keyword> so much more that the "body" ->
"do" change, which was a bad decision because focused on a
detail. You mentioned "class"...
More information about the Digitalmars-d-learn
mailing list