On Monday, 3 December 2018 at 23:32:10 UTC, Anonymouse wrote:
I have a fifo that I want to read lines from, but everything is
blocking.
[...]
How can I go about doing this to get non-blocking reads? Or
perhaps a way to test whether there is text waiting in the
fifo? File.eof is not it.
[...]
On Mon, Dec 03, 2018 at 11:32:10PM +, Anonymouse via Digitalmars-d-learn
wrote:
> I have a fifo that I want to read lines from, but everything is
> blocking.
>
> execute([ "mkfifo", filename ]);
> File fifo = File(filename, "r"); // blocks already
> immutable input = fifo.readln(); // block
I have a fifo that I want to read lines from, but everything is
blocking.
execute([ "mkfifo", filename ]);
File fifo = File(filename, "r"); // blocks already
immutable input = fifo.readln(); // blocks
foreach (line; fifo.byLineCopy) { /* blocks */ }
How can I go about doing this to get non-bl
On Monday, 3 December 2018 at 22:04:25 UTC, Neia Neutuladh wrote:
On Mon, 03 Dec 2018 21:27:52 +, faissaloo wrote:
Then shouldn't the following output false, false, true?
An object reference is a pointer value. The pointer values are
copied. The pointed-at objects are not copied.
Furthe
On Mon, 03 Dec 2018 21:27:52 +, faissaloo wrote:
> Then shouldn't the following output false, false, true?
An object reference is a pointer value. The pointer values are copied. The
pointed-at objects are not copied.
Furthermore, the syntax
Object[6] array = new Object();
only allocate
On Monday, 3 December 2018 at 20:37:22 UTC, Jonathan M Davis
wrote:
On Monday, December 3, 2018 1:07:24 PM MST Goksan via
Digitalmars-d-learn wrote:
Are there any differences between these 2 methods of copying
elements?
double[] array = [ 1, 20, 2, 30, 7, 11 ];
// Non dup
double[6] bracket_sy
On Monday, December 3, 2018 1:07:24 PM MST Goksan via Digitalmars-d-learn
wrote:
> Are there any differences between these 2 methods of copying
> elements?
>
> double[] array = [ 1, 20, 2, 30, 7, 11 ];
>
> // Non dup
> double[6] bracket_syntax_dup = array;
> bracket_syntax_dup[] = array;
> bracket
Yes it is. The dup version just make an extra copy of array for no reason.
po 3. 12. 2018 21:10 odesílatel Goksan via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> napsal:
> Are there any differences between these 2 methods of copying
> elements?
>
> double[] array = [ 1, 20, 2, 30,
Are there any differences between these 2 methods of copying
elements?
double[] array = [ 1, 20, 2, 30, 7, 11 ];
// Non dup
double[6] bracket_syntax_dup = array;
bracket_syntax_dup[] = array;
bracket_syntax_dup[0] = 50;
// Dup
double[6] normal_dup = array.dup;
normal_dup[0] = 100;
OUTPUT: (ar
On 12/3/18 2:03 AM, Joel wrote:
On Monday, 3 December 2018 at 06:55:50 UTC, Nicholas Wilson wrote:
On Monday, 3 December 2018 at 06:09:21 UTC, Joel wrote:
[...]
https://run.dlang.io/is/h0ArAB
works for me. If you want it as a string not char[] then byLineCopy
should work, if not just `.idu
On Monday, 3 December 2018 at 12:19:26 UTC, Dennis wrote:
On Monday, 3 December 2018 at 10:00:31 UTC, Simen Kjærås wrote:
However, it's easy to implement in a library:
It even is in phobos:
https://dlang.org/phobos/std_array.html#.staticArray
```
import std.array: staticArray;
auto a = [0, 1,
On Monday, 3 December 2018 at 10:00:31 UTC, Simen Kjærås wrote:
However, it's easy to implement in a library:
It even is in phobos:
https://dlang.org/phobos/std_array.html#.staticArray
```
import std.array: staticArray;
auto a = [0, 1, 2].staticArray;
```
On 22.11.18 16:19, Steven Schveighoffer wrote:
In terms of language semantics, I don't know what the right answer is.
If we want to say that if an optimizer changes program behavior, the
code must be UB, then this would have to be UB.
But I would prefer saying something like -- if a segfault
On Monday, 3 December 2018 at 09:51:45 UTC, Andrey wrote:
Hi,
I want to create a static array and immediately init it with
values:
uint[x] data = [1,3,10,44,0,5000];
I don't want to set the length of it explicitly (x in
square brackets). I want that compiler itself counted number of
Hi,
I want to create a static array and immediately init it with
values:
uint[x] data = [1,3,10,44,0,5000];
I don't want to set the length of it explicitly (x in square
brackets). I want that compiler itself counted number of values
(in example it is 6).
What should be a right synt
15 matches
Mail list logo