Re: The amazing template which does nothing

2015-04-30 Thread John Colvin via Digitalmars-d
On Wednesday, 29 April 2015 at 14:18:49 UTC, Iain Buclaw wrote: On 29 April 2015 at 14:50, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Wednesday, 29 April 2015 at 12:07:58 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 07:00:15 UTC, John Colvin wrote:

Re: The amazing template which does nothing

2015-04-30 Thread Iain Buclaw via Digitalmars-d
On 30 April 2015 at 15:01, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Wednesday, 29 April 2015 at 14:18:49 UTC, Iain Buclaw wrote: On 29 April 2015 at 14:50, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Wednesday, 29 April 2015 at 12:07:58 UTC,

Re: Spelling and phonetics (Was: The amazing template which does nothing)

2015-04-29 Thread Chris via Digitalmars-d
On Wednesday, 29 April 2015 at 10:15:52 UTC, Marc Schütz wrote: On Wednesday, 29 April 2015 at 10:09:39 UTC, Chris wrote: On Wednesday, 29 April 2015 at 09:57:01 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 09:44:27 UTC, Chris wrote: Just follow your natural way of speaking

Re: The amazing template which does nothing

2015-04-29 Thread Chris via Digitalmars-d
-template-which-does-nothing/ Very cool. Just a grammar nit, an UFCS should be a UFCS. Fixed, thanks. (I always found this rule counter-intuitive... u is a vowel dangit!) And in most cases, 'an' is correct. It's only when it makes a you sound (and if you spell out your acronyms, 'U' does

Re: The amazing template which does nothing

2015-04-29 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 29 April 2015 at 06:56:37 UTC, Nikolay wrote: On Tuesday, 28 April 2015 at 02:36:38 UTC, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ Thanks for good article little mistake: return from void function: /// Search

Re: The amazing template which does nothing

2015-04-29 Thread Nikolay via Digitalmars-d
On Tuesday, 28 April 2015 at 02:36:38 UTC, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ Thanks for good article little mistake: return from void function: /// Search a website for something, and parse the /// first search

Re: The amazing template which does nothing

2015-04-29 Thread John Colvin via Digitalmars-d
On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote: Trying on d.godbolt.com it seems a lot of extra-code is generated for the first version. d.godbolt.com is dead, use asm.dlang.org d.godbolt.org (note .org

Re: The amazing template which does nothing

2015-04-29 Thread Iain Buclaw via Digitalmars-d
On 29 Apr 2015 09:05, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote: Trying on d.godbolt.com it seems a lot of extra-code is generated for

Re: The amazing template which does nothing

2015-04-29 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 29 April 2015 at 07:00:15 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote: Trying on d.godbolt.com it seems a lot of extra-code is generated for the first version.

Re: The amazing template which does nothing

2015-04-29 Thread Iain Buclaw via Digitalmars-d
On 29 April 2015 at 14:07, Vladimir Panteleev via Digitalmars-d digitalmars-d@puremagic.com wrote: On Wednesday, 29 April 2015 at 07:00:15 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana

Re: The amazing template which does nothing

2015-04-29 Thread John Colvin via Digitalmars-d
On Wednesday, 29 April 2015 at 12:07:58 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 07:00:15 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote: Trying on d.godbolt.com

Re: Spelling and phonetics (Was: The amazing template which does nothing)

2015-04-29 Thread via Digitalmars-d
On Wednesday, 29 April 2015 at 10:09:39 UTC, Chris wrote: On Wednesday, 29 April 2015 at 09:57:01 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 09:44:27 UTC, Chris wrote: Just follow your natural way of speaking and you'll be fine. Read it out to yourself. And let's be honest,

Re: The amazing template which does nothing

2015-04-29 Thread Iain Buclaw via Digitalmars-d
On 29 April 2015 at 12:16, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Wednesday, 29 April 2015 at 07:49:34 UTC, Iain Buclaw wrote: On 29 Apr 2015 09:05, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC,

Re: Spelling and phonetics (Was: The amazing template which does nothing)

2015-04-29 Thread Chris via Digitalmars-d
On Wednesday, 29 April 2015 at 09:57:01 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 09:44:27 UTC, Chris wrote: Just follow your natural way of speaking and you'll be fine. Read it out to yourself. And let's be honest, it sounds really crap when you read an UFCS, bahhh! Yes,

Re: The amazing template which does nothing

2015-04-29 Thread John Colvin via Digitalmars-d
On Wednesday, 29 April 2015 at 07:49:34 UTC, Iain Buclaw wrote: On 29 Apr 2015 09:05, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote:

Spelling and phonetics (Was: The amazing template which does nothing)

2015-04-29 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 29 April 2015 at 09:44:27 UTC, Chris wrote: Just follow your natural way of speaking and you'll be fine. Read it out to yourself. And let's be honest, it sounds really crap when you read an UFCS, bahhh! Yes, well, the problem is that an U sounds completely fine in my head!

Re: The amazing template which does nothing

2015-04-29 Thread Iain Buclaw via Digitalmars-d
On 29 April 2015 at 14:50, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Wednesday, 29 April 2015 at 12:07:58 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 07:00:15 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev

Re: The amazing template which does nothing

2015-04-28 Thread John Colvin via Digitalmars-d
On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote: On Tuesday, 28 April 2015 at 10:18:49 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 10:18:12 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 10:07:43 UTC, Andrea Fontana wrote: On Tuesday, 28 April 2015 at 09:23:53

Re: The amazing template which does nothing

2015-04-28 Thread Dicebot via Digitalmars-d
On Tuesday, 28 April 2015 at 22:24:53 UTC, Max Samukha wrote: On Tuesday, 28 April 2015 at 02:36:38 UTC, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ A truly polymorphic identity function in D would be more involved: template

Re: The amazing template which does nothing

2015-04-28 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 28 April 2015 at 19:32:40 UTC, Andrei Alexandrescu wrote: On 4/27/15 7:36 PM, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ Went to post on reddit, was there already: http://www.reddit.com/r/programming/comments

Re: The amazing template which does nothing

2015-04-28 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote: Trying on d.godbolt.com it seems a lot of extra-code is generated for the first version. d.godbolt.com is dead, use asm.dlang.org

Re: The amazing template which does nothing

2015-04-28 Thread Max Samukha via Digitalmars-d
On Tuesday, 28 April 2015 at 02:36:38 UTC, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ A truly polymorphic identity function in D would be more involved: template id(a...) if (a.length == 1) { static if (__traits(compiles

Re: The amazing template which does nothing

2015-04-28 Thread Steven Schveighoffer via Digitalmars-d
On 4/28/15 6:00 PM, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 21:42:04 UTC, Steven Schveighoffer wrote: On 4/27/15 10:36 PM, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ Very cool. Just a grammar nit, an UFCS

Re: The amazing template which does nothing

2015-04-28 Thread Steven Schveighoffer via Digitalmars-d
On 4/27/15 10:36 PM, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ Very cool. Just a grammar nit, an UFCS should be a UFCS. -Steve

Re: The amazing template which does nothing

2015-04-28 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 28 April 2015 at 21:42:04 UTC, Steven Schveighoffer wrote: On 4/27/15 10:36 PM, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ Very cool. Just a grammar nit, an UFCS should be a UFCS. Fixed, thanks. (I always found

Re: The amazing template which does nothing

2015-04-28 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 28 April 2015 at 06:10:28 UTC, Andrei Alexandrescu wrote: On 4/27/15 7:36 PM, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ s/which/that/ Simple rule of thumb: if there's no comma before which, consider replacing

Re: The amazing template which does nothing

2015-04-28 Thread Andrei Alexandrescu via Digitalmars-d
On 4/27/15 7:36 PM, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ s/which/that/ Simple rule of thumb: if there's no comma before which, consider replacing with that. -- Andrei

Re: The amazing template which does nothing

2015-04-28 Thread Andrea Fontana via Digitalmars-d
On Tuesday, 28 April 2015 at 09:23:53 UTC, Chris wrote: And this has happened to me many times. The solution Break the UFCS chain and use a local temporary variable makes me angry, because by having to do so all the beauty of chaining is lost. A very slow (i guess) workaround could be:

Re: The amazing template which does nothing

2015-04-28 Thread John Colvin via Digitalmars-d
On Tuesday, 28 April 2015 at 10:18:12 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 10:07:43 UTC, Andrea Fontana wrote: On Tuesday, 28 April 2015 at 09:23:53 UTC, Chris wrote: And this has happened to me many times. The solution Break the UFCS chain and use a local temporary variable

Re: The amazing template which does nothing

2015-04-28 Thread John Colvin via Digitalmars-d
On Tuesday, 28 April 2015 at 10:07:43 UTC, Andrea Fontana wrote: On Tuesday, 28 April 2015 at 09:23:53 UTC, Chris wrote: And this has happened to me many times. The solution Break the UFCS chain and use a local temporary variable makes me angry, because by having to do so all the beauty of

Re: The amazing template which does nothing

2015-04-28 Thread Andrea Fontana via Digitalmars-d
On Tuesday, 28 April 2015 at 10:18:49 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 10:18:12 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 10:07:43 UTC, Andrea Fontana wrote: On Tuesday, 28 April 2015 at 09:23:53 UTC, Chris wrote: And this has happened to me many times. The

Re: The amazing template which does nothing

2015-04-28 Thread Dicebot via Digitalmars-d
On Tuesday, 28 April 2015 at 02:36:38 UTC, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ Very nice. There is also a similar package protected template in std.typetuple, `Alias`. I used it a lot but last applicability case

Re: The amazing template which does nothing

2015-04-28 Thread Andrea Fontana via Digitalmars-d
On Tuesday, 28 April 2015 at 10:07:43 UTC, Andrea Fontana wrote: On Tuesday, 28 April 2015 at 09:23:53 UTC, Chris wrote: And this has happened to me many times. The solution Break the UFCS chain and use a local temporary variable makes me angry, because by having to do so all the beauty of

Re: The amazing template which does nothing

2015-04-28 Thread Chris via Digitalmars-d
On Tuesday, 28 April 2015 at 02:36:38 UTC, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ Thanks for this little piece of information! Great stuff. You wrote When building an UFCS chain (in the style of component programming

Re: The amazing template which does nothing

2015-04-28 Thread Andrei Alexandrescu via Digitalmars-d
On 4/27/15 7:36 PM, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ Went to post on reddit, was there already: http://www.reddit.com/r/programming/comments/345zw3/the_amazing_template_that_does_nothing/ I've also posted

The amazing template which does nothing

2015-04-27 Thread Vladimir Panteleev via Digitalmars-d
http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/