On Thursday, 29 June 2023 at 18:27:22 UTC, Cecil Ward wrote:
I’m trying to debug my D program with old-fashioned printfs
stuck in various strategic places, actually using writefln().
My problem is that the addition of printf fights with the
existing declarations for pure nothrow @nogc @safe
On Thursday, 29 June 2023 at 19:19:21 UTC, Adam D Ruppe wrote:
On Thursday, 29 June 2023 at 18:47:48 UTC, Josh Holtrop wrote:
$ ldc2 -of environment environment.d
Since you named the file `environment.d` and didn't use an
explicit `module name.thing;` declaration, the compiler assumes
it
On Thursday, 29 June 2023 at 18:47:48 UTC, Josh Holtrop wrote:
$ ldc2 -of environment environment.d
Since you named the file `environment.d` and didn't use an
explicit `module name.thing;` declaration, the compiler assumes
it should match the filename.
So it injects an implicit `module
I am trying to use `std.process.environment.get()` as described
here: https://dlang.org/library/std/process/environment.get.html
I wrote this program to test it:
```d
import std.stdio;
import std.process;
int main(string[] args)
{
string home = environment.get("HOME");
writeln("home
```d
debug {
writeln("text");
}
```
```d
writeln(__MODULE__, ":", __LINE__, " ", "stuff");
```
You'll need to wrap try/catch for flushing stdout however.
```d
debug writeln(__MODULE__, ":", __LINE__, " ", "stuff");
```
Opps missed the debug.
I’m trying to debug my D program with old-fashioned printfs stuck
in various strategic places, actually using writefln(). My
problem is that the addition of printf fights with the existing
declarations for pure nothrow @nogc @safe and I have to adjust
them, then put them back correctly when
On Thursday, 29 June 2023 at 15:19:45 UTC, Paul Backus wrote:
On Thursday, 29 June 2023 at 14:18:05 UTC, kiriakov wrote:
struct Option(T)
{
SumType!(None, Some!T) data;
alias data this;
this(Value)(Value value) { data = value; }
}
On Thursday, 29 June 2023 at 14:18:05 UTC, kiriakov wrote:
How to create option type over std.sumtype ?
```
enum None;
struct Some(T) { T x; }
alias Option = SumType!(Some!T, None);
```
I get
Error: undefined identifier `T`
Try
```d
alias Option(T) = SumType!(Some!T, None);
```
Your version
On Thursday, 29 June 2023 at 14:18:05 UTC, kiriakov wrote:
How to create option type over std.sumtype ?
```
enum None;
struct Some(T) { T x; }
alias Option = SumType!(Some!T, None);
```
I get
Error: undefined identifier `T`
Looks like you meant to type
alias Option(T) = SumType!(Some!T,
How to create option type over std.sumtype ?
```
enum None;
struct Some(T) { T x; }
alias Option = SumType!(Some!T, None);
```
I get
Error: undefined identifier `T`
On Wednesday, 28 June 2023 at 23:46:17 UTC, Cecil Ward wrote:
If your program is such that one process will never ever
involve multiple threads, because it simply doesn’t apply in
your situation, then would it be worthwhile to have a "version
(D_SingleThread)" which would get rid of the
On Friday, 23 June 2023 at 23:37:29 UTC, Vinod K Chandran wrote:
Hi all,
I am trying to create a program which burns time codes to a
video. I am using ffmpeg for this. So far, I can successfully
start ffmpeg in another thread and stop it when I need. But I
can't read the live outputs from
13 matches
Mail list logo