Re: What type does byGrapheme() return?

2020-01-04 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Jan 04, 2020 at 08:19:14PM +0100, Robert M. Münch via Digitalmars-d-learn wrote: > On 2019-12-31 21:36:56 +, Steven Schveighoffer said: > > > The fact that a Grapheme's return requires you keep the grapheme in > > scope for operations seems completely incorrect and dangerous IMO > >

Re: Multi-threaded sorting of text file

2020-01-04 Thread Ali Çehreli via Digitalmars-d-learn
On 1/3/20 11:51 PM, MGW wrote: Need help: There' s a large text file (hundreds of thousands of lines). How long are the lines? If 1K bytes, 100M would fit in memory just fine. There is a parallel quick sort example on the std.parallelism page: https://dlang.org/phobos/std_parallelism.html

Re: decodeGrapheme & static array

2020-01-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 4 January 2020 at 19:56:54 UTC, Robert M. Münch wrote: But it doesn't seem to be an L-value... which I don't understand. I thought buf[] returns a temporary dynamic array initialized with the buf content. The problem here is indeed ref, the function there tries to update the

decodeGrapheme & static array

2020-01-04 Thread Robert M. Münch via Digitalmars-d-learn
I have: Grapheme[] gr; dchar[1] buf; encode(buf, cast(dchar)myData); gr =~ decodeGrapheme(buf[]); Which gives: Error: template std.uni.decodeGrapheme cannot deduce function from argument types !()(dchar[]), candidates are: C:\D\dmd2\windows\bin\..\..\src\phobos\std\uni.d(7164,10):

Re: What type does byGrapheme() return?

2020-01-04 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-12-31 21:36:56 +, Steven Schveighoffer said: The fact that a Grapheme's return requires you keep the grapheme in scope for operations seems completely incorrect and dangerous IMO (note that operators are going to always have a ref this, even when called on an rvalue). So even

Re: Project setup for DUB

2020-01-04 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 1 January 2020 at 13:19:20 UTC, Andre Pany wrote: In addition to that, there are different ways how you can contribute to Dub: - enhancing the dub help on code.dlang.org Does anyone know dub well enough to do this? :)

Re: Project setup for DUB

2020-01-04 Thread Ankush Bhardwaj via Digitalmars-d-learn
On Wednesday, 1 January 2020 at 13:19:20 UTC, Andre Pany wrote: On Wednesday, 1 January 2020 at 08:37:43 UTC, rikki cattermole wrote: In addition to that, there are different ways how you can contribute to Dub: - enhancing the dub help on code.dlang.org - finding duplicate/already solved

Re: Mimicking a shell

2020-01-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 4 January 2020 at 18:43:13 UTC, Jan wrote: I am using Linux (Fedora). ok, the starting point is `openpty` which gives you a communication pipe that the other program sees as a terminal. from there if you are just forwarding you can perhaps shoot bytes to and from without

Re: Project setup for DUB

2020-01-04 Thread Ankush Bhardwaj via Digitalmars-d-learn
On Wednesday, 1 January 2020 at 08:37:43 UTC, rikki cattermole wrote: On 01/01/2020 9:11 PM, Ankush Bhardwaj wrote: I am now stuck here not knowing what should I do next or how should I compile. Compile what? You successfully compiled and ran your dub build. Please note the default action is

Re: Mimicking a shell

2020-01-04 Thread Jan via Digitalmars-d-learn
On Sunday, 29 December 2019 at 19:21:53 UTC, Adam D. Ruppe wrote: On Sunday, 29 December 2019 at 17:03:14 UTC, Jan wrote: Is there a way to forward all input and output from a shell? yes, but it is platform specific and can be a decent amount of code. what OS are you on? I am using Linux

Re: Using tasks without GC?

2020-01-04 Thread dwdv via Digitalmars-d-learn
Creates a Task on the GC heap that calls an alias. If possible, there's also scopedTask, which allocates on the stack: https://dlang.org/phobos/std_parallelism.html#.scopedTask So my question is: Has anyone done any analysis over how "dangerous" it is to use GC'd tasks for _small_ tasks (in

Re: Multi-threaded sorting of text file

2020-01-04 Thread Alex via Digitalmars-d-learn
On Saturday, 4 January 2020 at 07:51:49 UTC, MGW wrote: Need help: There' s a large text file (hundreds of thousands of lines). The structure is as follows: 2345|wedwededwedwedwe .. 872625|rfrferwewweww . 23|rergrferfefer It is necessary to sort this file by the