November 07, 2017 Re: What are the unused but useful feature you know in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to aberba | On Sunday, 25 June 2017 at 23:21:25 UTC, aberba wrote:
> Can you share feature(s) in D people are not talking about which you've found very useful?
I see none.
¯\_(ツ)_/¯
Everything is more or less discussed and known. I was not surprised when i saw that the topic went OT since (almost) the beginning.
|
November 07, 2017 Re: What are the unused but useful feature you know in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to aberba | On Sunday, 25 June 2017 at 23:21:25 UTC, aberba wrote: > Can you share feature(s) in D people are not talking about which you've found very useful? Some of the best features are in the standard library. I've written about them here: http://nomad.so/2014/08/hidden-treasure-in-the-d-standard-library/ http://nomad.so/2015/08/more-hidden-treasure-in-the-d-standard-library/ |
November 07, 2017 Re: What are the unused but useful feature you know in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On Tuesday, 7 November 2017 at 17:15:02 UTC, Gary Willoughby wrote:
> On Sunday, 25 June 2017 at 23:21:25 UTC, aberba wrote:
>> Can you share feature(s) in D people are not talking about which you've found very useful?
>
> Some of the best features are in the standard library. I've written about them here:
>
> http://nomad.so/2014/08/hidden-treasure-in-the-d-standard-library/
> http://nomad.so/2015/08/more-hidden-treasure-in-the-d-standard-library/
It's mentioned in Gary's articles, but std.conv.to is fantastic.
|
November 08, 2017 Re: What are the unused but useful feature you know in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to aberba | On Sunday, 25 June 2017 at 23:21:25 UTC, aberba wrote: > Can you share feature(s) in D people are not talking about which you've found very useful? How about this feature: i.e. it actually compiles just fine ;-) //------------------------------------------------------------ module test; void main() { void main() { void main() { void main() { void main() { void main() { void main() { //and so on... and so on....and so on.... } } } } } } } //------------------------------------------------------------ |
November 08, 2017 Re: What are the unused but useful feature you know in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to codephantom | On Wednesday, 8 November 2017 at 01:24:57 UTC, codephantom wrote:
> On Sunday, 25 June 2017 at 23:21:25 UTC, aberba wrote:
>> Can you share feature(s) in D people are not talking about which you've found very useful?
>
> How about this feature: i.e. it actually compiles just fine ;-)
>
> //------------------------------------------------------------
>
> module test;
>
> void main()
> {
> void main()
> {
> void main()
> {
> void main()
> {
> void main()
> {
> void main()
> {
> void main()
> {
> //and so on... and so on....and so on....
> }
> }
> }
> }
>
> }
> }
> }
>
> //------------------------------------------------------------
I laughed.
At it's even funnier when you realize that there's actually generated assembly code for the nested main functions:
```
void test.main().main():
push %rbp
mov %rsp,%rbp
sub $0x10,%rsp
mov %rdi,-0x8(%rbp)
leaveq
retq
xchg %ax,%ax
```
However as you can see it only generates for one of the nested functions, the rest are omitted.
You can never call the function though :p
|
Copyright © 1999-2021 by the D Language Foundation