Re: Tips on TCP socket to postgresql middleware

2022-02-22 Thread Chris Piker via Digitalmars-d-learn
On Monday, 21 February 2022 at 07:00:52 UTC, eugene wrote: On Monday, 21 February 2022 at 04:46:53 UTC, Chris Piker wrote: On Sunday, 20 February 2022 at 18:00:26 UTC, eugene wrote: I'm adverse to reading it closely since there was no license file and don't want to accidentally violate

Re: how to return map(fn)

2022-02-22 Thread Ali Çehreli via Digitalmars-d-learn
On 2/22/22 05:53, steve wrote: > What I was trying > to return is function that can then be applied to e.g. an array. I think an eponymous template that defines an alias as in your original post can be used as well: template mappified(alias func) { import std.algorithm : map; alias

Re: Odd behaviour of std.range

2022-02-22 Thread Ali Çehreli via Digitalmars-d-learn
On 2/22/22 09:25, frame wrote: > Well, I think it's ok for strings but it shouldn't do it for simple > arrays string is a simple array as well just with immutable(char) as elements. It is just an alias: alias string = immutable(char)[]; > where it's intentional that I want to process the

Re: Odd behaviour of std.range

2022-02-22 Thread frame via Digitalmars-d-learn
On Tuesday, 22 February 2022 at 17:33:18 UTC, H. S. Teoh wrote: On Tue, Feb 22, 2022 at 05:25:18PM +, frame via Digitalmars-d-learn wrote: On Tuesday, 22 February 2022 at 13:25:16 UTC, bauss wrote: > Welcome to the world of auto decoding, D's million dollar > mistake. Well, I think it's

Re: Odd behaviour of std.range

2022-02-22 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Feb 22, 2022 at 05:25:18PM +, frame via Digitalmars-d-learn wrote: > On Tuesday, 22 February 2022 at 13:25:16 UTC, bauss wrote: > > > Welcome to the world of auto decoding, D's million dollar mistake. > > Well, I think it's ok for strings but it shouldn't do it for simple > arrays

Re: Odd behaviour of std.range

2022-02-22 Thread frame via Digitalmars-d-learn
On Tuesday, 22 February 2022 at 13:25:16 UTC, bauss wrote: Welcome to the world of auto decoding, D's million dollar mistake. Well, I think it's ok for strings but it shouldn't do it for simple arrays where it's intentional that I want to process the character and not a UTF-8 codepoint.

Re: Odd behaviour of std.range

2022-02-22 Thread frame via Digitalmars-d-learn
On Tuesday, 22 February 2022 at 12:53:03 UTC, Adam D Ruppe wrote: On Tuesday, 22 February 2022 at 12:48:21 UTC, frame wrote: What am I missing here? Is this some UTF conversion issue? `front` is a phobos function. Phobos treats char as special than all other arrays. Ah, ok. It directly

Re: how to return map(fn)

2022-02-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On Tuesday, 22 February 2022 at 13:53:34 UTC, steve wrote: On Monday, 21 February 2022 at 23:07:44 UTC, Ali Çehreli wrote: On 2/21/22 12:44, steve wrote: ... thanks for your help. I'm unfortunately still a bit confused. Maybe I wasn't clear or maybe I'm just missing something here. What I

Re: how to return map(fn)

2022-02-22 Thread steve via Digitalmars-d-learn
On Monday, 21 February 2022 at 23:07:44 UTC, Ali Çehreli wrote: On 2/21/22 12:44, steve wrote: ... thanks for your help. I'm unfortunately still a bit confused. Maybe I wasn't clear or maybe I'm just missing something here. What I was trying to return is function that can then be applied

Re: Odd behaviour of std.range

2022-02-22 Thread bauss via Digitalmars-d-learn
On Tuesday, 22 February 2022 at 12:48:21 UTC, frame wrote: What am I missing here? Is this some UTF conversion issue? ```d string a; char[] b; pragma(msg, typeof(a.take(1).front)); // dchar pragma(msg, typeof(b.take(1).front)); // dchar ``` Welcome to the world of auto decoding, D's million

Re: Odd behaviour of std.range

2022-02-22 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 22 February 2022 at 12:48:21 UTC, frame wrote: What am I missing here? Is this some UTF conversion issue? ```d string a; char[] b; pragma(msg, typeof(a.take(1).front)); // dchar pragma(msg, typeof(b.take(1).front)); // dchar ``` This is a feature of the D standard library known

Re: Odd behaviour of std.range

2022-02-22 Thread Adam D Ruppe via Digitalmars-d-learn
On Tuesday, 22 February 2022 at 12:48:21 UTC, frame wrote: What am I missing here? Is this some UTF conversion issue? `front` is a phobos function. Phobos treats char as special than all other arrays. It was a naive design flaw that nobody has the courage to fix. Either just don't use

Odd behaviour of std.range

2022-02-22 Thread frame via Digitalmars-d-learn
What am I missing here? Is this some UTF conversion issue? ```d string a; char[] b; pragma(msg, typeof(a.take(1).front)); // dchar pragma(msg, typeof(b.take(1).front)); // dchar ```