Language Reference

user1234 user1234 at 12.de
Mon Aug 19 20:17:58 UTC 2024


On Monday, 19 August 2024 at 19:14:19 UTC, monkyyy wrote:
> On Monday, 19 August 2024 at 06:47:10 UTC, Ron Tarrant wrote:
>> The Book
>> If you're new to computer science, it covers basics I first 
>> learned back in the mid-1980's,
>
> Which is terrible
>
> No one needs yet another explanation on what floats are
>
> The core d languge should be a light 50 pages; templates can 
> then be dense 500 pages

So much less is required. Templates are much more easy to get 
that you think. A single page is enough. To be a bit provocative 
it's jut about filling the holes.
Then it becomes a bit more complex when it's about overloading... 
but essentially templates are incomplete syntax trees that you 
complete with arguments. Dead stupid.

Now sure D adds a bit of complexity over that simple concept. How 
?
1. constraints. Well well well, isn't that thing just made to 
deal with overloading ;)
2. eponymous declarations

Otherwise, the other big thing to get is that template instances 
can insert new things in the AST. The compiler deals with that 
quite nicely because it's "multi-pass".




More information about the Digitalmars-d mailing list