Re: Embrace the from template?

2018-08-25 Thread Jonathan Marler via Digitalmars-d
On Saturday, 25 August 2018 at 09:30:27 UTC, Jonathan M Davis wrote: On Saturday, August 25, 2018 2:02:51 AM MDT Jonathan Marler via Digitalmars- d wrote: [...] Honestly, I don't want to be doing _anything_ like from with _any_ syntax. It's not just a question of from itself being too long.

Re: Embrace the from template?

2018-08-25 Thread Basile B. via Digitalmars-d
On Friday, 24 August 2018 at 10:58:29 UTC, aliak wrote: On Friday, 24 August 2018 at 06:41:35 UTC, Jonathan Marler wrote: Ever since I read https://dlang.org/blog/2017/02/13/a-new-import-idiom/ I've very much enjoyed using the new `from` template. [...] Of course, if we don't want to encourage

Re: Embrace the from template?

2018-08-25 Thread Jonathan M Davis via Digitalmars-d
On Saturday, August 25, 2018 3:30:27 AM MDT Jonathan M Davis via Digitalmars-d wrote: > from is not the entire problem, but IMHO, it's definitely the straw that > breaks the camel's back. It's taking all of this specificity way too far. > I don't want to have to write or read code that's

Re: Embrace the from template?

2018-08-25 Thread Jonathan M Davis via Digitalmars-d
On Saturday, August 25, 2018 2:02:51 AM MDT Jonathan Marler via Digitalmars- d wrote: > So assuming we're on the same page, you mentioned that the `from` > template is too verbose. I can see this point. To measure this I > consider the least verbose syntax for achieving the semantics of > the

Re: Embrace the from template?

2018-08-25 Thread Daniel N via Digitalmars-d
On Saturday, 25 August 2018 at 08:02:51 UTC, Jonathan Marler wrote: If we defined ':' as the special "from operator" then the following would be equivalent: foo.bar:baz from!"foo.bar".baz I agree with almost everything you wrote, but I think it would have to be double :: foo.bar::baz

Re: Embrace the from template?

2018-08-25 Thread Jonathan Marler via Digitalmars-d
On Saturday, 25 August 2018 at 04:25:56 UTC, Jonathan M Davis wrote: On Friday, August 24, 2018 7:03:37 PM MDT Jonathan Marler via Digitalmars-d wrote: > What uses does this actually have, I only see one example > from the article and it is an oversimplistic example that > effectively

Re: Embrace the from template?

2018-08-24 Thread Jonathan M Davis via Digitalmars-d
On Friday, August 24, 2018 7:03:37 PM MDT Jonathan Marler via Digitalmars-d wrote: > > What uses does this actually have, I only see one example from > > the article and it is an oversimplistic example that > > effectively translates to either phobos being used or not being > > used. All the

Re: Embrace the from template?

2018-08-24 Thread Jonathan Marler via Digitalmars-d
On Saturday, 25 August 2018 at 00:40:54 UTC, tide wrote: On Friday, 24 August 2018 at 06:41:35 UTC, Jonathan Marler wrote: Ever since I read https://dlang.org/blog/2017/02/13/a-new-import-idiom/ I've very much enjoyed using the new `from` template. It unlocks new idioms in D and have been so

Re: Embrace the from template?

2018-08-24 Thread tide via Digitalmars-d
On Friday, 24 August 2018 at 06:41:35 UTC, Jonathan Marler wrote: Ever since I read https://dlang.org/blog/2017/02/13/a-new-import-idiom/ I've very much enjoyed using the new `from` template. It unlocks new idioms in D and have been so useful that I thought it might be a good addition to the

Re: Embrace the from template?

2018-08-24 Thread Steven Schveighoffer via Digitalmars-d
On 8/24/18 6:29 PM, Jonathan Marler wrote: On Friday, 24 August 2018 at 20:36:06 UTC, Seb wrote: On Friday, 24 August 2018 at 20:04:22 UTC, Jonathan Marler wrote: I'd gladly fix it but alas, my pull requests are ignored :( They aren't! It's just that sometimes the review queue is pretty

Re: Embrace the from template?

2018-08-24 Thread Jonathan Marler via Digitalmars-d
On Friday, 24 August 2018 at 20:36:06 UTC, Seb wrote: On Friday, 24 August 2018 at 20:04:22 UTC, Jonathan Marler wrote: I'd gladly fix it but alas, my pull requests are ignored :( They aren't! It's just that sometimes the review queue is pretty full. I have told you before that your

Re: Embrace the from template?

2018-08-24 Thread Dominikus Dittes Scherkl via Digitalmars-d
On Friday, 24 August 2018 at 18:34:20 UTC, Daniel N wrote: On Friday, 24 August 2018 at 12:06:15 UTC, Anton Fediushin wrote: I just published it on the dub registry in public domain (I hope Daniel Nielsen is ok with that. After all, it's just 3 lines of code) Package page:

Re: Embrace the from template?

2018-08-24 Thread Seb via Digitalmars-d
On Friday, 24 August 2018 at 20:04:22 UTC, Jonathan Marler wrote: I'd gladly fix it but alas, my pull requests are ignored :( They aren't! It's just that sometimes the review queue is pretty full. I have told you before that your contributions are very welcome (like they are from everyone

Re: Embrace the from template?

2018-08-24 Thread aliak via Digitalmars-d
On Friday, 24 August 2018 at 13:54:51 UTC, Jonathan Marler wrote: Good to know others are using it. Of course making it a core part of the language would mean that IDEs would be free to add support for it, whether it was added to `object.d` or with some other means such as a new syntax,

Re: Embrace the from template?

2018-08-24 Thread Anton Fediushin via Digitalmars-d
On Friday, 24 August 2018 at 18:34:20 UTC, Daniel N wrote: On Friday, 24 August 2018 at 12:06:15 UTC, Anton Fediushin wrote: I just published it on the dub registry in public domain (I hope Daniel Nielsen is ok with that. After all, it's just 3 lines of code) Package page:

Re: Embrace the from template?

2018-08-24 Thread Anton Fediushin via Digitalmars-d
On Friday, 24 August 2018 at 13:48:09 UTC, Jonathan Marler wrote: On Friday, 24 August 2018 at 12:06:15 UTC, Anton Fediushin wrote: On Friday, 24 August 2018 at 06:41:35 UTC, Jonathan Marler wrote: [...] There's no reason to mess with `object.d` or add it to phobos. Just make a dub package

Re: Embrace the from template?

2018-08-24 Thread Jonathan Marler via Digitalmars-d
On Friday, 24 August 2018 at 18:34:20 UTC, Daniel N wrote:I don't use dub myself. On Friday, 24 August 2018 at 18:34:20 UTC, Daniel N wrote: FYI Andrei has an open pull request: https://github.com/dlang/druntime/pull/1756 Oh well I guess great minds think alike :) Too bad it's been stalled

Re: Embrace the from template?

2018-08-24 Thread Daniel N via Digitalmars-d
On Friday, 24 August 2018 at 12:06:15 UTC, Anton Fediushin wrote: I just published it on the dub registry in public domain (I hope Daniel Nielsen is ok with that. After all, it's just 3 lines of code) Package page: https://from.dub.pm/ I'm fine with it, public domain is great! Although I

Re: Embrace the from template?

2018-08-24 Thread Jonathan Marler via Digitalmars-d
On Friday, 24 August 2018 at 10:58:29 UTC, aliak wrote: On Friday, 24 August 2018 at 06:41:35 UTC, Jonathan Marler wrote: Ever since I read https://dlang.org/blog/2017/02/13/a-new-import-idiom/ I've very much enjoyed using the new `from` template. It unlocks new idioms in D and have been so

Re: Embrace the from template?

2018-08-24 Thread Jonathan Marler via Digitalmars-d
On Friday, 24 August 2018 at 12:06:15 UTC, Anton Fediushin wrote: On Friday, 24 August 2018 at 06:41:35 UTC, Jonathan Marler wrote: [...] There's no reason to mess with `object.d` or add it to phobos. Just make a dub package and use it! I just published it on the dub registry in public

Re: Embrace the from template?

2018-08-24 Thread Anton Fediushin via Digitalmars-d
On Friday, 24 August 2018 at 06:41:35 UTC, Jonathan Marler wrote: Ever since I read https://dlang.org/blog/2017/02/13/a-new-import-idiom/ I've very much enjoyed using the new `from` template. It unlocks new idioms in D and have been so useful that I thought it might be a good addition to the

Re: Embrace the from template?

2018-08-24 Thread Mike Franklin via Digitalmars-d
On Friday, 24 August 2018 at 06:41:35 UTC, Jonathan Marler wrote: One idea is we could add this template to `object.d`. This would allow it to be used from any module that uses druntime without having to import it first. The template itself is also very friendly to "bloat" because it only

Re: Embrace the from template?

2018-08-24 Thread aliak via Digitalmars-d
On Friday, 24 August 2018 at 06:41:35 UTC, Jonathan Marler wrote: Ever since I read https://dlang.org/blog/2017/02/13/a-new-import-idiom/ I've very much enjoyed using the new `from` template. It unlocks new idioms in D and have been so useful that I thought it might be a good addition to the

Embrace the from template?

2018-08-24 Thread Jonathan Marler via Digitalmars-d
Ever since I read https://dlang.org/blog/2017/02/13/a-new-import-idiom/ I've very much enjoyed using the new `from` template. It unlocks new idioms in D and have been so useful that I thought it might be a good addition to the core language. I've found that having it in a different place in