I'm curious if it'd be possible to write erlang NIFs in D?
From reading Interfacing to C, it seems like I'd need to generate
a D interface file for the [not insignificant] erl_nif header,
and then I'd be able to create a -shared file from D code and
load it like any other shared object in Erla
On Thursday, 13 December 2018 at 23:33:39 UTC, Stanislav Blinov
wrote:
On Thursday, 13 December 2018 at 13:17:05 UTC, aliak wrote:
Ah. Is there any case where you would not want to do that when
you have a T value as parameter?
Hypothetically, yes, e.g. an object that contains references to
i
This one confused me until I decided to talk to a rubber ducky:
import std.string;
void main() {
auto s = "%s is a good number".format(42);
}
Fine; it works... Then the string becomes too long and I split it:
auto s = "%s is a good number but one needs to know" ~
" what th
On Saturday, December 15, 2018 10:27:36 AM MST Neia Neutuladh via
Digitalmars-d-learn wrote:
> On Sat, 15 Dec 2018 17:19:05 +, Timoses wrote:
> > Running `dub test` will output:
> > Running ./unit-test-library writeln: unittest All unit tests have been
> > run successfully.
> >
> > Why is the
On Saturday, 15 December 2018 at 20:54:03 UTC, JN wrote:
Bump. Encountering the same issue. Just reinstalled Windows and
having the same error on
DMD32 D Compiler v2.083.1 .
OK, fixed it. Since it's the first hit from Google, here's a
solution:
https://www.reddit.com/r/roguelikedev/commen
On Wednesday, 7 November 2018 at 14:43:07 UTC, Chris M. wrote:
On Wednesday, 7 November 2018 at 01:37:29 UTC, Chris M. wrote:
On Tuesday, 29 May 2018 at 07:47:07 UTC, Begah wrote:
[...]
This works fine on my home Win10 machine, dmd 2.082/2.083 +
dub 1.11.0, installed using the executable fro
Hi
I am wondering if it is possible to assign a vector to a row of a
matrix?
main.d ==
import mir.ndslice;
void main() {
auto matrix = slice!double(3, 4);
matrix[] = 0;
matrix.diagonal[] = 1;
auto row = matrix[0];
row[3] = 4;
assert(matrix[0, 3] == 4);
//
A look into `dub test --vverbose` showed that ./source/app.d is
not even included in the compilcation step...
On Sat, 15 Dec 2018 17:19:05 +, Timoses wrote:
> Running `dub test` will output:
> Running ./unit-test-library writeln: unittest All unit tests have been
> run successfully.
>
> Why is the `shared static this()` not executed?
Run `dub clean; dub test -v` and you'll see that main.d isn't compi
Spec 27.5 states: "Unit tests, when enabled, are run after all
static initialization is complete and before the main() function
is called. " (https://dlang.org/spec/unittest.html)
main.d:
---
import std.stdio;
shared static this()
{
import vibe.core.log;
setLogLevel(Lo
On Sat, 15 Dec 2018 13:49:03 +, Heromyth wrote:
> Yes, it's very dangerous to create a new thread in shared static this().
> For a big project, it sometimes hard to identify this problem. Maybe,
> the compiler should do something for this, should it?
The runtime, more likely. There are plenty
On Saturday, 15 December 2018 at 03:48:15 UTC, Neia Neutuladh
wrote:
On Sat, 15 Dec 2018 02:54:55 +, Heromyth wrote:
shared static this() {
writeln("running A in shared static this(),
sharedField=", sharedField);
Thread th = new Thread(() { });
th.start();
Java code:
```java
class A extends Node {}
class B extends Node {}
class C extends Node {}
@Override public Set> getNodes() {
return new HashSet<>(Arrays.asList(
A.class,
B.class,
C.class
));
}
```
For dlang like this?
`
On Thursday, 13 December 2018 at 23:33:39 UTC, Stanislav Blinov
wrote:
On Thursday, 13 December 2018 at 13:17:05 UTC, aliak wrote:
[...]
Hypothetically, yes, e.g. an object that contains references to
itself. However, D operates on the assumption that you don't
have such objects. And even t
14 matches
Mail list logo