On Wednesday, 6 April 2022 at 18:10:32 UTC, Guillaume Piolat
wrote:
Any idea how to workaround that? I really need the same UDA in
parent and child class.
Use a frontend >= dmd 2.099, it works according to run.dlang.io.
On Friday, 4 March 2022 at 01:30:00 UTC, Leonardo wrote:
Thanks but not worked here.
```
[leonardo@leonardo-pc dimportc]$ dmd --version
DMD64 D Compiler v2.098.1
```
Please retry with the
[beta](https://dlang.org/download.html#dmd_beta) or [nightly
build](https://github.com/dlang/dmd/release
On Thursday, 3 March 2022 at 07:32:24 UTC, BoQsc wrote:
I tried to use `std.conv.parse(args[2])`,
[...]
But I'm getting this error
The code doesn't declare the type to be parsed, use
`parse!uint(...)`.
But `to!uint` seems more appropriate for your code because
`parse` ignores non-number cha
On Wednesday, 9 February 2022 at 10:03:21 UTC, MichaelBi wrote:
day6 of the advent of code 2021 needs to handle an array of
10^12 length, or even bigger...
As others have mentioned, huge arrays require appropriate memory
/ the use of memory-mapped files to actually store it. But the
calculati
On Sunday, 19 December 2021 at 09:19:31 UTC, D Lark wrote:
Do you know if there's a nightly version I can specify to use
your fix?
Nightly builds are available at
https://github.com/dlang/dmd/releases/tag/nightly.
On Wednesday, 13 October 2021 at 20:02:05 UTC, Vindex wrote:
Is there a decomposition for tuples and other data structures?
No, but you can emulate it, e.g. by using AliasSeq:
```d
import std.meta : AliasSeq;
import std.typecons : tuple;
import std.stdio : writeln;
void main() {
int a;
On Wednesday, 7 July 2021 at 10:27:47 UTC, notna wrote:
On Windows:
[...]
Nice and helpful Error messages is on the top of our desires
list, right?
It's hard to give proper error backtraces without debug
information (-g).
Anyways, I can reproduce the error when compiling with `-m32`
(the def
On Monday, 5 July 2021 at 14:57:20 UTC, BoQsc wrote:
Let's say I can't store information into files.
Is it possible to download a file into an array.
Yes, use [`get`](https://dlang.org/phobos/std_net_curl.html#.get):
```d
import std.net.curl;
void main()
{
char[] content =
get("https://g
On Monday, 7 June 2021 at 19:03:44 UTC, Jack wrote:
actually i didnt so I just added:
```d
shared static this()
{
Runtime.initialize();
}
shared static ~this()
{
Runtime.terminate();
}
```
but it didn't change anything
That doesn't work because `Runtime.initialize()` is respo
On Monday, 7 June 2021 at 02:33:38 UTC, Jack wrote:
What am I missing?
Does your code / `node_dlang` initialize Druntime before calling
`writeln`?
Try replacing the `writeln` with `puts` (from `core.stdc.stdio`)
which doesn't require an initialized runtime.
On Tuesday, 25 May 2021 at 15:54:31 UTC, bharathyes wrote:
I wrote the basic code:
You have a typo in your code, `std.studio` instead of `std.stdio`.
On Saturday, 1 May 2021 at 22:44:34 UTC, Blatnik wrote:
They say to use the digitalmars make tool and not the normal
make that I have installed. Great, no problem, except it didn't
come installed with the compiler as is advertised. I don't have
a make program in D/dmd2/windows/bin and I can't f
On Saturday, 1 May 2021 at 22:44:34 UTC, Blatnik wrote:
I wanna hack on the compiler, but I've spend 3 hours and I
can't get the damned thing to compile!
You probably need to update the VS paths to match your local
installation, Microsoft apparently changed their directory layout
a few years
On Monday, 19 April 2021 at 17:43:34 UTC, evilrat wrote:
On Monday, 19 April 2021 at 17:37:31 UTC, MoonlightSentinel
wrote:
Omit the modules from your blacklist when generating the
header file (allthough that requires rerunning dmd)
Ok thanks, well, time for new dub subconfig.
Or... maybe at l
On Monday, 19 April 2021 at 16:26:20 UTC, evilrat wrote:
Or maybe there is a way to tell it whitelist/blacklist modules?
The header generator only translates modules passed on the
command line, other declarations are omitted unless they are
required by another symbol.
Omit the modules from
On Friday, 9 April 2021 at 11:36:21 UTC, x3g6h7k8 wrote:
The interesting point is this happens only in optimized builds.
In debug builds everything is fine.
Looks like DMD skips the codegen for this template instance
because it erroneously assumes that the template is already
emitted in anoth
On Tuesday, 6 April 2021 at 09:33:32 UTC, cc wrote:
Just encountered this compilation failure in DMD winx64 2.096,
which previously worked in 2.095 and prior versions.
DMD 2.094.2 fails with the same error?
But current master works for me.
Just wondering if it's a bug, or a new issue to keep
On Saturday, 6 March 2021 at 09:38:54 UTC, Ali Çehreli wrote:
Are you getting the same errors with those dmd versions?
My locally installed compiler is dmd 2.094.2, which seems to be
too old for parse's new doCount template parameter. (I look
inside /usr/include/dmd/phobos/std/conv.d on my Lin
On Saturday, 6 March 2021 at 08:15:16 UTC, Imperatorn wrote:
Are you sure? 🤔
I tried switching to dmd-beta, dmd-nightly, ldc and ldc-beta
and none of them worked.
Yes. All of those were stuck at 2.093 due to some issues with
Travis. We've resolved those issues over the last few days and
au
On Friday, 5 March 2021 at 22:01:37 UTC, Imperatorn wrote:
Any idea why?
The examples are compiled using an older host compiler
(__VERSION__ is 2.093) but use features introduced in a later
version. This will be fixed by upgrading the compiler (the
examples are checked using current master I
On Saturday, 6 February 2021 at 14:39:38 UTC, Jeff wrote:
So, I'm guessing there's something going on under-the-hood
using the ~ operator with the enum and I'd like to understand
what it is.
Enum to string conversion is usually implemented using the name
of the enum member, regardless of it's
On Thursday, 22 October 2020 at 04:20:35 UTC, Mathias LANG wrote:
Unfortunately this switch still has some bugs, so you can
easily run into linker errors. I'm hoping to ultimately make it
the default though.
Which is more of a template emission problem because
`-checkaction=context` uses a te
On Monday, 17 August 2020 at 09:59:21 UTC, novice3 wrote:
On Monday, 17 August 2020 at 09:45:55 UTC, novice3 wrote:
access violation occur.
reduced code https://run.dlang.io/is/U58t9R
The wrapper parameters don't inherit the storage classes from
the wrapped function. Try using std.traits.P
On Saturday, 15 August 2020 at 04:09:19 UTC, James Gray wrote:
I am trying to use getopt and would not like the program to
throw an unhandled exception when parsing command line options.
Try passing config.passThrough, it should disable the exception
for unknown arguments.
Currently working on a PlatformIO [1] based project in C++ and
want to throw some D into the mix. Couldn't find an existing
solution and I'm not sure how to implement a proper solution
using PIO's scripting capabilities.
Did somebody try this before and could share his experiences?
[1] https:
On Friday, 31 July 2020 at 23:42:45 UTC, Andy Balba wrote:
How does one initialize c in D ?
ubyte[3][4] c = [ [5, 5, 5], [15, 15,15], [25, 25,25], [35,
35,35] ];
none of the statements below works
c = cast(ubyte) [ [5, 5, 5], [15, 15,15], [25, 25,25], [35,
35,35] ];
This is an invali
On Tuesday, 28 July 2020 at 09:28:27 UTC, wjoe wrote:
It was run on the doc page. I suppose the examples are wrapped
in a unittest block?
Indeed, see
https://github.com/dlang/phobos/blob/cd2ba0d2c378a893ec0eaefc57b87d0770a1990c/std/bitmanip.d#L293-L314
On Monday, 15 June 2020 at 16:55:00 UTC, MoonlightSentinel wrote:
And these unittests trigger the segfault:
https://github.com/nordlow/phobos-next/blob/4a18833e226be0d3363fb07f02a7bcf531892e17/src/nxt/cyclic_array.d#L704-L712
https://github.com/nordlow/phobos-next/blob/4a18833e226be0d3363fb07f0
On Monday, 15 June 2020 at 10:54:47 UTC, Per Nordlöw wrote:
What have I missed?
My mistake, dub dustmite expects a path to an temporary directory
suitable for dustmite (it copies the entire projet + all
dependencies s.t. dustmite sees the entire source code). That
path needs to be somewhere
On Friday, 12 June 2020 at 18:18:25 UTC, Per Nordlöw wrote:
How do I most easily track down which unittest in which file
that causes the crash?
You could try to reduce your code using Dustmite through dub.
This should do the job IIRC:
dub dustmite --compiler=dmd --build=unittest
--compile
On Tuesday, 9 June 2020 at 14:23:34 UTC, Jesse Phillips wrote:
I notice that in the new release for Alpine Linux it mentions
support for D.
Announcement:
https://forum.dlang.org/thread/raue6j$1vp4$2...@digitalmars.com
On Saturday, 6 June 2020 at 08:55:20 UTC, Jack Applegame wrote:
Should it compile?
No, moveEmplace just sees a const reference and doesn't know that
a is void-initialized.
On Wednesday, 13 May 2020 at 13:52:13 UTC, Andrey wrote:
Hi,
I want to sum lengths of all strings in array:
auto data = ["qwerty", "az", ""];
Fold and reduce doesn't work:
auto result = data.fold!`a + b.length`(0U);
gives error:
static assert: "Incompatible function/seed/element:
bina
On Saturday, 4 April 2020 at 09:09:44 UTC, Giovanni Di Maria
wrote:
Why the followin code gives me the error?
Error: only one index allowed to index `int[3][3]`
Use matrix[2][2] instead of matrix[2,2].
On Saturday, 4 April 2020 at 09:25:14 UTC, Giovanni Di Maria
wrote:
Is there a Built-in function (no code, only a built-in function)
that transform a linear array to a Matrix?
You can combine slide [1] and array [2]:
import std;
void main()
{
auto input = [10,20,30,40,50,60,70,80,90,100,1
On Thursday, 26 March 2020 at 19:34:08 UTC, Quantium wrote:
string s="abc";
writeln(s[1]); // Should write 'b' or not???
Is it a legit code or it doesn't work ?
Yes, but keep in mind that char[] implies UTF8. Hence this won't
work if your input contains e.g. chinese characters.
Refer
On Wednesday, 18 March 2020 at 16:23:26 UTC, IGotD- wrote:
you get the idea. So is this possible at all or do you have to
duplicate the code for each version identifier despite they are
equal for many version identifiers?
The usual workaround is to define a common version, e.g.
version(X86)
On Sunday, 8 March 2020 at 20:28:01 UTC, Robert M. MĂĽnch wrote:
You can get rid of the enum [...]
That depends on your use case. You will need enum if you want to
use the value at compile time (e.g. when using it as a template
parameter). Otherwise a normal string will suffice.
und the sta
On Saturday, 7 March 2020 at 16:30:59 UTC, Robert M. MĂĽnch wrote:
Is this possible at all?
You can use an anonymous lambda to build the string in CTFE:
--
struct S {
int a;
bool b;
}
import std;
enum string sql = {
string s = "CREATE TABLE
On Tuesday, 3 March 2020 at 11:04:53 UTC, Saurabh Das wrote:
PS: Any chance this will make it into DMD 2.091.0?
Yes, this fix will be in the upcoming release.
On Tuesday, 3 March 2020 at 09:12:40 UTC, Saurabh Das wrote:
Is this supposed to not work anymore? Or is this a bug?
That is a bug, see https://issues.dlang.org/show_bug.cgi?id=20629
On Thursday, 20 February 2020 at 22:31:16 UTC, aliak wrote:
Is this suppose to give a deprecation error message?
deprecated("a")
alias A(T) = B!T;
template B(T) {
alias B = T;
}
void main() {
A!int a; // should this cause a message "a" ?
}
??
Or am I using it wrong maybe?
It's a bu
On Wednesday, 5 February 2020 at 13:05:59 UTC, Eko Wahyudin wrote:
What is this thread for?
and is it normal in D?
According to the stack trace your applications triggered a GC
cycle. The marking is done in parallel to minimize pause times,
see https://dlang.org/spec/garbage.html
On Monday, 3 February 2020 at 20:41:00 UTC, Anonymouse wrote:
It doesn't seem to include debugging symbols. Does digger not
build its dmds with -g?
The exceptions happens inside of build.d not dmd which wasn't
built with debug informations until recently.
Here's the full log: https://pasteb
On Monday, 3 February 2020 at 16:54:20 UTC, Anonymouse wrote:
It does a `dmd.exe -of..\generated\build.exe`, but then the
immediately following call to `..\generated\build.exe` fails?
What am I doing wrong?
The executable was launched because make would yield a different
error message otherwi
On Sunday, 2 February 2020 at 16:29:34 UTC, bauss wrote:
Since he just edited markdown files then it shouldn't matter.
Why? The grep checks explicitly for trailing whitespace in
markdown files.
On Sunday, 2 February 2020 at 08:54:02 UTC, mark wrote:
However, four have not been accepted, apparently for technical
reasons. But I don't understand what's wrong or what I need to
do to fix them. (I'm not very knowledgeable about github.)
The Travis log suggest that your PRs contain some whi
On Friday, 31 January 2020 at 12:37:43 UTC, Adnan wrote:
What's causing this?
You mixed up the array lengths:
const int[3][2] matA = [[0, -1, 2], [4, 11, 2]];
const int[2][3] matB = [[3, -1], [1, 2], [6, 1]];
matA is an SA containing <2> elements of type int[3].
matB is an SA containing <3> e
On Thursday, 30 January 2020 at 21:09:41 UTC, Simon wrote:
Hi dlang community,
I'm trying to implement a "reset" functionality which should
revert all variables to the program start initial state.
Example:
import Graph;
protected Edge[string] m_string2edge;
int main()
{
// adding some e
On Thursday, 30 January 2020 at 17:00:08 UTC, ShadoLight wrote:
Agreed. My question though is should the 'shorthand' notation
_replace_ the 'longhand' notation, or be available _in
addition_ to the 'longhand' notation in the eponymous case (so
the eponymous notation is just 'syntax sugar' if yo
On Thursday, 30 January 2020 at 15:14:43 UTC, ShadoLight wrote:
Is there a technical reason for this limitation? Why are the
'classical' invocation style not allowed for eponymous
templates as well?
It seems somewhat arbitrary - note that inner/outer functions
does not have this limitation -
On Thursday, 30 January 2020 at 13:05:05 UTC, drug wrote:
That's probably triggered by some constraints. I had the issue
like this with Nullable:
https://github.com/dlang/phobos/pull/7324
The core problem here stems from the fact that templates are
always instantiated in the scope of the temp
On Tuesday, 7 January 2020 at 15:40:58 UTC, Taylor Hillegeist
wrote:
but I can't get it to work. it says its an Error: non-constant
expression.
I imagine this has to do with the ctRegex template or
something. maybe there is a better way? Does anyone know?
This issue is unrelated to ctRegex,
On Monday, 30 December 2019 at 23:15:48 UTC, JN wrote:
I also had to ask because I couldn't find it. In other
languages it's named "index()", "indexOf()" or "find()". D is
the only language I know which uses the "countUntil" scheme.
And even so it's not obvious from the name if it's the index o
On Monday, 30 December 2019 at 18:18:49 UTC, uranuz wrote:
So as you see I have added a lot of enforce to test if all
variables are not null. But nothing was null and the reason of
segfault were unclear.
What about moduleName, mod and the return value of
mod.toStdJSON()?
And whats the retur
On Monday, 30 December 2019 at 14:30:12 UTC, Ron Tarrant wrote:
I was trying to do this with an array of pointers, but I get an
error (which suggests to me that I don't know what data type a
pointer is):
It's not a ulong? Have I forgotten so much?
D disallows implicit conversion from integer
On Sunday, 29 December 2019 at 08:31:13 UTC, mipri wrote:
On Sunday, 29 December 2019 at 08:26:58 UTC, Daren Scot Wilson
wrote:
Reading documentation... Array, Algorithms, ... maybe I've
been up too late... how does one obtain the index of, say, 55
in an array like this
int[] a = [77,66,5
On Tuesday, 24 December 2019 at 07:37:02 UTC, Rumbu wrote:
I am trying to create an array of functions inside a struct.
struct S {
void f1() {}
void f2() {}
alias Func = void function();
immutable Func[2] = [&f1, &f2]
}
What I got: Error: non-constant expression '&f1'
Tried also with
On Tuesday, 24 December 2019 at 13:13:12 UTC, MoonlightSentinel
wrote:
On Tuesday, 24 December 2019 at 10:40:16 UTC, Mike Parker wrote:
struct S {}
void f1(S s) {}
void f2(S s) {}
alias Func = immutable(void function());
immutable Func[2] funcs = [cast(Func)&f1, cast(Func)&f2];
Though, it's n
On Tuesday, 24 December 2019 at 10:40:16 UTC, Mike Parker wrote:
struct S {}
void f1(S s) {}
void f2(S s) {}
alias Func = immutable(void function());
immutable Func[2] funcs = [cast(Func)&f1, cast(Func)&f2];
Though, it's not clear to me wy the one requires casting the
pointer type and the oth
60 matches
Mail list logo