On Saturday, October 7, 2023 10:59:47 AM MDT claptrap via Digitalmars-d-learn
wrote:
> On Saturday, 7 October 2023 at 00:49:39 UTC, H. S. Teoh wrote:
> > On Sat, Oct 07, 2023 at 12:00:48AM +, claptrap via
> > Digitalmars-d-learn wrote:
> >
> >
> > When you write `foo[]` you're taking a slice
On Saturday, 7 October 2023 at 19:30:23 UTC, mw wrote:
On Saturday, 7 October 2023 at 19:25:51 UTC, mw wrote:
Or how can I get the `tag` and `storage` myself?
https://github.com/dlang/phobos/blob/a3f22129dd2a134338ca02b79ff0de242d7f016e/std/sumtype.d#L310
If I add this line to the above
On Saturday, 7 October 2023 at 19:25:51 UTC, mw wrote:
Or how can I get the `tag` and `storage` myself?
https://github.com/dlang/phobos/blob/a3f22129dd2a134338ca02b79ff0de242d7f016e/std/sumtype.d#L310
If I add this line to the above func `isF`:
```
writeln(t.tag);
```
it won't compile:
https://dlang.org/library/std/sumtype.html
seems right now the `match!(...)` template only generate a
delegate, e.g. suppose the following (silly) code:
```
bool isF(Temperature t) {
while (true) {
t.match!(
(Fahrenheit f) {return true;},
(_) {return false;} // I want to
Recently I wanted to wrap a small d program around an external
process and stream its stdout/stderr to the original
stdout/stderr of the d program (no other output while the
external process is running).
I first tried to implement this with vibe's fibers, but after
failing first try, I
On Saturday, 7 October 2023 at 17:23:40 UTC, ryuukk_ wrote:
On Saturday, 7 October 2023 at 07:31:45 UTC, mw wrote:
https://stackoverflow.com/questions/47046850/is-there-any-way-to-assign-multiple-variable-at-once-with-dlang
How to do this Python code in D:
```
s = "1 2 3"
A,B,C = map(int,
On Saturday, 7 October 2023 at 07:31:45 UTC, mw wrote:
https://stackoverflow.com/questions/47046850/is-there-any-way-to-assign-multiple-variable-at-once-with-dlang
How to do this Python code in D:
```
s = "1 2 3"
A,B,C = map(int, s.split(" "))
A,B,C
(1, 2, 3)
```
Is there a better way
On Saturday, 7 October 2023 at 00:49:39 UTC, H. S. Teoh wrote:
On Sat, Oct 07, 2023 at 12:00:48AM +, claptrap via
Digitalmars-d-learn wrote:
When you write `foo[]` you're taking a slice of the array, and
in that case if the lengths of both sides of the assignment
don't match, you'll
On Saturday, 7 October 2023 at 16:12:47 UTC, mw wrote:
Interesting: in terms of easy of coding, clarity and future
maintenance, which one is superior?
There is no superior languages. They can successfully co-exist
and play in different areas.
The one liner in Python, or your "solution" with
Interesting: in terms of easy of coding, clarity and future
maintenance, which one is superior?
The one liner in Python, or your "solution" with dozen lines of
code? BTW, is that a solution at all? Did it achieved what the
original goal asked in the OP question?
So, who should learn from
On Saturday, 7 October 2023 at 07:31:45 UTC, mw wrote:
https://stackoverflow.com/questions/47046850/is-there-any-way-to-assign-multiple-variable-at-once-with-dlang
How to do this Python code in D:
```
s = "1 2 3"
A,B,C = map(int, s.split(" "))
A,B,C
(1, 2, 3)
```
Is there a better way
On Saturday, 7 October 2023 at 07:31:45 UTC, mw wrote:
https://stackoverflow.com/questions/47046850/is-there-any-way-to-assign-multiple-variable-at-once-with-dlang
How to do this Python code in D:
```
s = "1 2 3"
A,B,C = map(int, s.split(" "))
A,B,C
(1, 2, 3)
```
Is there a better way
12 matches
Mail list logo