[Feature Request] Keywords for symbol operators
user1234
user1234 at 12.de
Mon Feb 26 10:40:27 UTC 2024
On Monday, 26 February 2024 at 10:13:15 UTC, Danilo wrote:
> ```d
> module app;
>
> import std;
>
> alias and = (X,lazy Y) => X && Y;
> alias or = (X,lazy Y) => X || Y;
> alias not = (X) => !X;
>
``
Small advice for this particular case: you should specify the
type of the lambda parameters, so that `and`, `or`, and `not`
dont become templates. That way errors will occur earlier, for
example if something that's not evaluable to bool is passed by
error.
More information about the Digitalmars-d
mailing list