Hello.
I recently reinstalled Windows 10 (build 1903), and downloaded
DMD (v2.087.1) and dub (v1.16.0).
My project no longer compiles, giving the following errors:
error LNK2019: unresolved external symbol GetSystemMetrics
referenced in [...]
error LNK2019: unresolved external symbol
On Tuesday, 20 August 2019 at 17:29:15 UTC, Dennis wrote:
On Tuesday, 20 August 2019 at 17:17:01 UTC, Vladimirs Nordholm
wrote:
[...]
Importing only specifies that you expect the symbols to be
there, it doesn't mean the functions are linked in.
[...]
Thank you for the explanation Dennis.
Hello.
I want to create a tree which maps sequences of numbers to data.
ex:
- [1, 2]-> 1
- [1, 3, 1] -> 2
- [1, 3, 2] -> 3
I have no prior knowledge of what makes a good tree, and I am
unsure if what I've got is good. I mean it works, but if anyone
with more knowledge of trees or D-lang
On Tuesday, 2 June 2020 at 12:34:53 UTC, Q. Schroll wrote:
On Tuesday, 2 June 2020 at 11:44:10 UTC, Vladimirs Nordholm
wrote:
[...]
You might want to check out this:
https://en.wikipedia.org/wiki/Trie
Possibly, that's exactly what you're looking for.
Thank you!
I believe this is exactly
Hello.
I wonder if there is a better way to compile something if the
current operating system is _not_ a specific platform.
For example, I only want some code to compile if the operating
system is not Windows. Currently I do this:
version (Windows)
{
}
else
{
//
On Wednesday, 16 September 2020 at 18:54:45 UTC, Jacob Carlborg
wrote:
On 2020-09-16 19:53, Vladimirs Nordholm wrote:
Hello.
I wonder if there is a better way to compile something if the
current operating system is _not_ a specific platform.
For example, I only want some code to compile if t
On Wednesday, 16 September 2020 at 18:07:25 UTC, Ferhat Kurtulmuş
wrote:
On Wednesday, 16 September 2020 at 17:53:31 UTC, Vladimirs
Nordholm wrote:
Hello.
I wonder if there is a better way to compile something if the
current operating system is _not_ a specific platform.
For example, I only
Hello. I wonder what the best-practice is for dub projects with
sub-projects. Excuse me if the terminology is wrong. Let me
explain my situation.
I have a library which I want to split up into multiple projects.
The main project will be a "wrapper" with some additional code.
The sub-projects
On Sunday, 20 September 2020 at 18:24:31 UTC, Vladimirs Nordholm
wrote:
Hello. I wonder what the best-practice is for dub projects with
sub-projects. Excuse me if the terminology is wrong. Let me
explain my situation.
...
The project I am referring to is my project scone
(https://github.com
On Sunday, 20 September 2020 at 18:55:39 UTC, rikki cattermole
wrote:
But since you insist on them being separate repositories, then
they are just regular old dependencies.
Ah, well it's not that I _insist_ on them being their own
dependencies, it's just the only way I've encountered a setup
On Monday, 21 September 2020 at 08:02:46 UTC, Виталий Фадеев
wrote:
On Sunday, 20 September 2020 at 18:24:31 UTC, Vladimirs
Nordholm wrote:
Hello. I wonder what the best-practice is for dub projects
with sub-projects. Excuse me if the terminology is wrong. Let
me explain my situation.
[...]
Hello.
I have a class which I have written some tests for, to ensure if
I ever change some code it will still work as intended.
The documentation https://dlang.org/spec/unittest.html says it is
can be placed both in the class or outside it.
I come from a background of having a completely se
On Thursday, 22 October 2020 at 21:55:59 UTC, Jack Applegame
wrote:
Now we can use type Foo as if it were an lvalue/rvalue:
Foo = 5;
int a = Foo;
int b = Foo + a;
Haha, that's pretty neat!
On Monday, 26 October 2020 at 13:36:58 UTC, Steven Schveighoffer
wrote:
On 10/26/20 9:16 AM, Vladimirs Nordholm wrote:
[...]
Wherever you want. Generally people put it right after the
thing being tested to keep files organized.
When the compiler runs unittests it runs them all in the
seque
Hello.
Is there a "best practice" of what the source folder should be
called?
I commonly see either `source` or `src` in GitHub projects, but
cannot find any formal best practice naming convention.
On Monday, 9 November 2020 at 09:05:58 UTC, Imperatorn wrote:
On Monday, 9 November 2020 at 08:06:54 UTC, Andrey wrote:
Hello,
Are here any differences in creation of dynamic array with
known size?
auto array = new wchar[](111);
and
wchar[] array;
array.length = 111;
You can check usi
Hello.
I am unsure if I am going about this the right way, and if my
question even makes sense.
In essence what I want is to have two "types" represented by a
size_t. Here is an example of what I want think I want (but might
be completely off)
alias Foo = size_t;
alias Bar = size_t
On Tuesday, 10 November 2020 at 11:49:19 UTC, Jerry wrote:
On Tuesday, 10 November 2020 at 11:38:30 UTC, Vladimirs
Nordholm wrote:
Hello.
I am unsure if I am going about this the right way, and if my
question even makes sense.
In essence what I want is to have two "types" represented by a
s
Currently I have something like
version (Posix)
{
enum foo = "bar";
}
else
{
enum foo = "baz";
}
Is there anyway to make it "neater"? Maybe something in one line:
enum foo = version (Posix) { "posix" } : { "other" } ;
On Sunday, 18 November 2018 at 17:52:21 UTC, Neia Neutuladh wrote:
On Sun, 18 Nov 2018 17:47:07 +, Vladimirs Nordholm wrote:
Is there anyway to make it "neater"? Maybe something in one
line:
enum foo = version (Posix) { "posix" } : { "other" } ;
If you're doing it often:
T ifPosix(
Hello.
Is there a proper way to convert a string with multibyte
characters into a dstring?
Case scenario:
string a = "abc😃123"; // a.length == 10 ("abc"==3 + "😃"==4 +
"123"==3)
dstring b = foo(a); // b.length = 7 ("abc"==3 + "😃"==1 +
"123"==3)
dstring foo(string str) {
On Sunday, 25 November 2018 at 21:33:15 UTC, Stanislav Blinov
wrote:
On Sunday, 25 November 2018 at 21:23:31 UTC, Vladimirs Nordholm
wrote:
Is there a proper way to convert a string with multibyte
characters into a dstring?
void main() {
import std.conv : to;
import std.stdio : write
Hello.
Pre-rant:
-
I have a library to aid in development for the terminal. This
library has to initialize some things before it can be used, and
I run some code in `shared static this(){...}`. I believe in the
most common case scenario my initializer should be run.
The initializer s
On Saturday, 8 December 2018 at 17:05:50 UTC, Adam D. Ruppe wrote:
Alternatively, you could perhaps have it keep an internal
is_initialized flag and lazily call init on your other function
calls if it is not already done. Then if the user wants to
customize settings, they just call init before
Hello.
I wish to sort an array by calling a template function on a
struct. In essence I want to do
foos.sort!("a.get!Dummy < b.get!Dummy");
but I get the error message
/dlang/dmd/linux/bin64/../../src/phobos/std/functional.d-mixin-215(215): Error: undefined identifier Dummy
Is the
On Monday, 25 February 2019 at 12:47:50 UTC, Andrea Fontana wrote:
On Monday, 25 February 2019 at 12:37:31 UTC, Vladimirs Nordholm
wrote:
Hello.
I wish to sort an array by calling a template function on a
struct. In essence I want to do
foos.sort!("a.get!Dummy < b.get!Dummy");
but I get
On Monday, 25 February 2019 at 12:47:47 UTC, Simen Kjærås wrote:
On Monday, 25 February 2019 at 12:37:31 UTC, Vladimirs Nordholm
wrote:
Hello.
I wish to sort an array by calling a template function on a
struct. In essence I want to do
foos.sort!("a.get!Dummy < b.get!Dummy");
but I get t
Hello.
Is there a current "Best Practices" for logging in D?
For the actual logging, I know of `std.experimental.logger`.
However, the `experimental` has kept me away from it.
Is it good, or are there any better alternatives?
Hello.
I have dub dependency which has a `shared static this()`.
In my project, can I run code code before the dependency's
`shared static this()`?
Hello people from D-land.
To summarise my problem: I have a program in the terminal (Posix)
with two threads: one which my main program is run on, and a
second one which polls input via `poll(...)` and `read(...)`.
Let's call main thread T1, and a semi-blocking input-thread T2.
Every second
On Wednesday, 15 November 2017 at 11:57:25 UTC, Vladimirs
Nordholm wrote:
Hello people from D-land.
To summarise my problem: I have a program in the terminal
(Posix) with two threads: one which my main program is run on,
and a second one which polls input via `poll(...)` and
`read(...)`.
[.
Hello Dlang community!
I need help in creating a template function which would look like
the following pseudo-code:
void foo(, , ,
...);
// would be used as `void foo(x, y, arg1, arg2, ..., argN)`
// valid examples:
foo(5.332, 1, "a string", 123, "42");
foo(3, 44, false)
On Sunday, 25 March 2018 at 18:24:37 UTC, Vladimirs Nordholm
wrote:
The underlying problems are:
* How do I ensure the two first arguments (used as coordinates)
are types of numbers (all kinds: ints, floats, reals, etc.)
* At least one argument is passed after the coordinates
I found a soluti
On Sunday, 25 March 2018 at 21:31:16 UTC, aliak wrote:
On Sunday, 25 March 2018 at 19:06:14 UTC, Vladimirs Nordholm
wrote:
On Sunday, 25 March 2018 at 18:24:37 UTC, Vladimirs Nordholm
wrote:
The underlying problems are:
* How do I ensure the two first arguments (used as
coordinates) are types
On Monday, 26 March 2018 at 06:48:45 UTC, rumbu wrote:
isNumeric applies to a type, not to a variable => IsNumeric!X
On Monday, 26 March 2018 at 06:51:48 UTC, arturg wrote:
use the type not the variables:
isNumeric!X && isNumeric!Y
Ah, missed that. Thanks a bunch!
Heyo.
I have a struct with a couple "property" methods, like:
struct A
{
auto foo(int bar) { /* do something */ }
}
Is there any reason for me to add the @property tags for the
method? The following code compiles just fine with the struct
above
A a = A();
a.foo =
On Monday, 2 April 2018 at 14:20:49 UTC, Dennis wrote:
On Monday, 2 April 2018 at 13:57:14 UTC, Vladimirs Nordholm
wrote:
Is there any reason for me to add the @property tags for the
method?
A list of things the @property tag does can be found here:
https://dlang.org/spec/function.html#propert
On Monday, 2 April 2018 at 15:15:05 UTC, Dennis wrote:
On Monday, 2 April 2018 at 14:51:57 UTC, Vladimirs Nordholm
wrote:
Do you think I should I omit the @property tag, if the only
wanted behaviour is to set a value (`foo.bar = "baz";`) ?
You're probably fine either way, it's mostly for makin
On Monday, 2 April 2018 at 15:05:04 UTC, Seb wrote:
On Monday, 2 April 2018 at 14:51:57 UTC, Vladimirs Nordholm
wrote:
On Monday, 2 April 2018 at 14:20:49 UTC, Dennis wrote:
[...]
Ah! First time I read the docs I didn't understand the
typeof(exp) explanation, but yours made me understand tha
Hello people.
I currently have a function which multiple times per second takes
in arguments, and appends the argument as my special type. The
following code should explain what I do more properly:
struct MySpecialType { char c; }
auto foo(Args...)(Args args)
{
MySpecialT
My base problem is that I want to mixin `break` into a switch
statement, but the mixin is within a static foreach. Take a look
at the following code:
switch(foo)
{
static foreach(f; EnumMembers!Foo)
{
mixin(format("
case Foo.%s:bar = Bar.%
On Tuesday, 3 April 2018 at 19:41:54 UTC, Alex wrote:
On Tuesday, 3 April 2018 at 19:31:50 UTC, Vladimirs Nordholm
wrote:
[...]
Would labelling help?
https://run.dlang.io/is/vE1KyD
Ah! Okay, now I see.
Thanks Alex and Adam!
On Tuesday, 3 April 2018 at 19:53:11 UTC, Meta wrote:
On Tuesday, 3 April 2018 at 19:02:25 UTC, Vladimirs Nordholm
wrote:
[...]
In this specific case, since you know the length of `Args`, you
can pre-allocate an array of that size and loop through it
doing your initialization.
However, if
Hello people from D-land.
Short question: Can get the type of a struct that has `alias this
= ` ?
See this example, where a struct is aliased to an enum:
enum Enum { one, two, three, fourtytwo }
private template Mix()
{
this(Enum ee) { e = ee; }
Enum e;
a
On Tuesday, 3 April 2018 at 20:41:01 UTC, Alex wrote:
On Tuesday, 3 April 2018 at 20:02:46 UTC, Vladimirs Nordholm
wrote:
On Tuesday, 3 April 2018 at 19:53:11 UTC, Meta wrote:
[...]
I don't think I know the size of the arguments.
If I pass in "123" and MySpecialType('a'), the result should
On Wednesday, 4 April 2018 at 15:49:31 UTC, Vladimirs Nordholm
wrote:
private template Mix()
{
this(Enum ee) { e = ee; }
Enum e;
alias this = e;
}
Oops, typo in the alias. Should be `alias e this`
On Wednesday, 4 April 2018 at 15:57:19 UTC, Simen Kjærås wrote:
On Wednesday, 4 April 2018 at 15:49:31 UTC, Vladimirs Nordholm
wrote:
if (is(T == A) || is(T == B) || is(T == Enum))
if (is(T : Enum))
--
Simen
Ah! Thanks a lot!
47 matches
Mail list logo