Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D?
Salih Dincer
salihdb at hotmail.com
Thu Sep 12 09:32:58 UTC 2024
On Wednesday, 11 September 2024 at 22:06:54 UTC, WB wrote:
>
> Honestly, D, does not really need it, and most of solutions
> (like above) do have one or few limitations and drawbacks. Some
> will be acceptable in some projects, some not.
>
> There is plenty of stuff in language and library already,
> adding small things like that are not really the best thing.
> There is plenty of very successful languages, that do not offer
> this (Go, C++, Python 3.5 and earlier, Lua, older JavaScript,
> etc) and just adding it will not make D automatically more
> successful. I feel there is too much already in D and standard
> library, and things are added to quickly and eagerly, and years
> later we end up in a mess that cannot be solved (because of
> compatibility).
Yes, I agree; what I see is a very complicated Phobos2. Because
it has become like this over time and submodules have been
developed to eliminate the confusion. For example, there are
things in std.math that we do not use often, a very basic
algorithm like gcd() is expected to be written in std.numeric or
the factorial() function by you.
In short, Phobos3 will adapt better to the language for beginners
if it is written systematically from the beginning; std.math
should be reorganized from scratch.
SDB at 79
More information about the Digitalmars-d-learn
mailing list