String Interpolation
Walter Bright
newshound2 at digitalmars.com
Wed Oct 25 19:24:19 UTC 2023
On 10/25/2023 4:29 AM, Jonathan M Davis wrote:
> IMHO, mixins should be explicit, obvious, and greppable, and adding a
> separate syntax for them which tries to hide them is going to make the
> language worse. However a string is generated, if the programmer wants to
> turn it into code, they should just use mixin, and if it's ugly, it's ugly,
> but at least it's clear what's going on.
Yes, that was and remains the rationale for mixin. We have plenty of experience
with it now, and it's been good.
Trying to hide this stuff away is also what macros do, and every language that
supports macros winds up with hellish incomprehensible code (that the authors of
such insist is beautiful!).
And lastly, the discomfort with this seems to be related to discomfort with
tuples. D doesn't support tuples as well as it should, which results in people
not using tuples where tuples are appropriate, and hence unfamiliarity with them.
D is going to get better tuple support (like having functions able to return
tuples), and when we do, I expect using tuples will become natural for D
programming.
More information about the Digitalmars-d
mailing list