On 7/4/23 3:19 PM, Cecil Ward wrote:
I have a dynamic array of strings of length zero. When i write to the
first element the program crashes, not surprisingly, but what should I
be doing?
dstring[] arr;
arr[0] = "my string"d; // BANG !!
It depends on the semantic requirement.
If the re
On Tuesday, 4 July 2023 at 17:46:22 UTC, Steven Schveighoffer
wrote:
On 7/4/23 1:01 PM, Cecil Ward wrote:
I have a mutable dynamic array of dchar, grown by successively
appending more and more. When I wish to zap it and hand the
contents to the GC to be cleaned up, what should I do? What
happe
I have a dynamic array of strings of length zero. When i write to
the first element the program crashes, not surprisingly, but what
should I be doing?
dstring[] arr;
arr[0] = "my string"d; // BANG !!
On 7/4/23 1:01 PM, Cecil Ward wrote:
I have a mutable dynamic array of dchar, grown by successively appending
more and more. When I wish to zap it and hand the contents to the GC to
be cleaned up, what should I do? What happens if I set the .length to zero?
If you want to forget it so the GC c
On Tuesday, 4 July 2023 at 17:01:42 UTC, Cecil Ward wrote:
I have a mutable dynamic array of dchar, grown by successively
appending more and more. When I wish to zap it and hand the
contents to the GC to be cleaned up, what should I do? What
happens if I set the .length to zero?
I do want to
Hopefully we'll get tagged union in the future
- no templates
- proper support
- proper error messages
On 7/4/23 11:15 AM, kiriakov wrote:
On Tuesday, 4 July 2023 at 14:42:31 UTC, Steven Schveighoffer wrote:
On 7/4/23 10:19 AM, kiriakov wrote:
On Tuesday, 4 July 2023 at 12:43:19 UTC, Steven Schveighoffer wrote:
On 7/4/23 12:58 AM, kiriakov wrote:
It looks like a type mismatch. The function ac
On Tuesday, 4 July 2023 at 14:42:31 UTC, Steven Schveighoffer
wrote:
On 7/4/23 10:19 AM, kiriakov wrote:
On Tuesday, 4 July 2023 at 12:43:19 UTC, Steven Schveighoffer
wrote:
On 7/4/23 12:58 AM, kiriakov wrote:
It looks like a type mismatch. The function accepted should
return `Result` but it
On 7/4/23 10:19 AM, kiriakov wrote:
On Tuesday, 4 July 2023 at 12:43:19 UTC, Steven Schveighoffer wrote:
On 7/4/23 12:58 AM, kiriakov wrote:
It looks like a type mismatch. The function accepted should return
`Result` but it's returning `ParsResult`.
That's the problem
Result(T) = SumType!
On Tuesday, 4 July 2023 at 12:43:19 UTC, Steven Schveighoffer
wrote:
On 7/4/23 12:58 AM, kiriakov wrote:
It looks like a type mismatch. The function accepted should
return `Result` but it's returning `ParsResult`.
-Steve
That's the problem
Result(T) = SumType!(ParsResult!T, Err!T)
On 7/4/23 12:58 AM, kiriakov wrote:
Hi. I can't handle template. It all looks sad, build ok, test error.
```
struct ParsResult(T) { T[] _in; T[] _out; }
struct Err(T) { T[] x; }
struct Result(T) {
SumType!(ParsResult!T, Err!T) data;
alias data this;
this(Value)(Value value) { dat
11 matches
Mail list logo