On Monday, 7 June 2021 at 10:36:23 UTC, Mike Parker wrote:
On Monday, 7 June 2021 at 09:29:08 UTC, tastyminerals wrote:
I getting
```
import/core/sync/mutex.d(87,36): Error:
`pthread_mutexattr_init` cannot be interpreted at compile
time, because it has no available source code
```
compile
On Monday, 7 June 2021 at 11:31:13 UTC, tastyminerals wrote:
It's interesting how there is no information about class
instantiation at module level anywhere in the docs. Even the
Ali's book does not explicitly say that you cannot instantiate
a class this way. Maybe I totally missed it but
On Monday, 7 June 2021 at 11:29:44 UTC, tastyminerals wrote:
On Monday, 7 June 2021 at 10:36:23 UTC, Mike Parker wrote:
On Monday, 7 June 2021 at 09:29:08 UTC, tastyminerals wrote:
I getting
```
import/core/sync/mutex.d(87,36): Error:
`pthread_mutexattr_init` cannot be interpreted at compile
thanks, evilrat
Anyway I tried dagon in past and I don't see why bother with
it, better stick with something that can handle industry
standard formats such as FBX, another issue is shaders fused in
right in the engine.
As an alternative the only thing probably worth checking is
godot-d which
On Monday, 7 June 2021 at 14:02:14 UTC, Prokop Hapala wrote:
Basically I'm desperate do find anything which encapsulates
OpenGL calls into some nice D-lang classes to learn from it. I
don't really want to use Dagon, nor Godot. What I want is to
use it as learning resources fro learning
Everything is public by default, and you can't overload and
derive from structs so final has no effect
there less visual noise:
```D
struct gudtPosition {
void reset() { pintLeft1 = pintTop1 = pintRight1 = pintBottom1
= 0; }
private ushort pintLeft1 = 0;
private ushort pintTop1 =
Consider the following code:
```d
class classComputer {
private string pstrName;
final @property string name() { return this.pstrName; }
final @property void name(in string lstrName) { this.pstrName
= lstrName; }
this(
string lstrComputerName
) {
this.pstrName
07.06.2021 17:02, Prokop Hapala пишет:
Basically I'm desperate do find anything which encapsulates OpenGL calls
into some nice D-lang classes
Did you try gfm? specifically its 7th version -
[gfm7](https://github.com/drug007/gfm7)?
It has nice
On Mon, Jun 07, 2021 at 03:26:27PM +, someone via Digitalmars-d-learn wrote:
> Consider the following code:
>
> ```d
> class classComputer {
[...]
> }
>
> class classComputers {
>
>classComputers lhs;
>classComputers rhs;
>
>int opApply(int delegate(classComputers) dg) { ///
On Sat, Jun 05, 2021 at 01:46:45AM +, someone via Digitalmars-d-learn wrote:
[...]
> As I am writing code today I am encountering a lot of these situations.
>
> cast(ushort)(this.pintBottom1 - 1)
>
> My first walkaround for this was intuitive:
>
> this.pintBottom1 - cast(ushort) 1 /// I
On Monday, 7 June 2021 at 02:33:38 UTC, Jack wrote:
What am I missing?
If this runs under Windows, there is no dlopen(), maybe a wrapper
to LoadLibrary() but this will need to call a DllMain() in the
DLL if I am not wrong. Is there a DllMain?
On Monday, 7 June 2021 at 15:26:27 UTC, someone wrote:
Consider the following code:
```d
class classComputer {
private string pstrName;
final @property string name() { return this.pstrName; }
final @property void name(in string lstrName) {
this.pstrName = lstrName; }
this(
On Monday, 7 June 2021 at 17:22:48 UTC, MoonlightSentinel wrote:
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`?
actually i didnt so I just added:
```d
shared static this()
{
On Monday, 7 June 2021 at 15:55:36 UTC, H. S. Teoh wrote:
Thanks for your reply. It was very illustrating.
It's very simple. Whenever some non-array object appears on the
right side of a foreach() statement, the compiler looks for a
method on the object called .opApply. If it exists, the loop
On Monday, 7 June 2021 at 16:10:08 UTC, Jack wrote:
I think you meant to implement ranges? you can implement in the
way you wanted: ```foreach(lobjComputer; lobjComputers)``` ...
Thanks for your reply !
I am aware that ranges are one of D's gems, I did take an
overview of them last night or
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 Monday, 7 June 2021 at 12:53:29 UTC, russhy wrote:
Everything is public by default, and you can't overload and
derive from structs so final has no effect. There less visual
noise.
Gotcha !
I started using final (and the like) on classes a couple of days
ago and I suppose I unconsciously
On Tuesday, 8 June 2021 at 01:17:05 UTC, someone wrote:
On Tuesday, 8 June 2021 at 00:54:41 UTC, someone wrote:
Are there alternatives to nested classes for such scenarios ?
Self-reply: I created two files for classComputers and
classComputer and I replaced the nested-classComputer code
https://dlang.org/articles/safed.html
https://dlang.org/dmd-linux.html#switches
http://ddili.org/ders/d.en/functions_more.html
Neither man dmd nor man dmd.conf appear to have a related/switch
setting.
Does it means safeD is achieved by placing @safe attributes all
over the place ? Or is it
On 08/06/2021 2:47 PM, someone wrote:
https://dlang.org/articles/safed.html
https://dlang.org/dmd-linux.html#switches
http://ddili.org/ders/d.en/functions_more.html
Neither man dmd nor man dmd.conf appear to have a related/switch setting.
Does it means safeD is achieved by placing @safe
On Tuesday, 8 June 2021 at 00:58:12 UTC, Jack wrote:
the dll which I was just build with dub command? how I have a
version mismatch if they're the very same file?
Electron embeds node and does not use whatever you have on your
system. So if there’s a mismatch between the embedded version and
On Tuesday, 8 June 2021 at 03:32:31 UTC, someone wrote:
On Tuesday, 8 June 2021 at 02:59:28 UTC, rikki cattermole wrote:
SafeD is an old name given to the attributes @safe @trusted
@system.
I have the Alexandrescu's book on hand so that explains it.
There is no switch nor any special
On Tuesday, 8 June 2021 at 04:24:38 UTC, H. S. Teoh wrote:
Annotate your functions with @safe.
https://dlang.org/spec/function.html#function-safety
Best Practices: Mark as many functions @safe as practical.
ACK
On Tuesday, 8 June 2021 at 03:04:39 UTC, Mike Parker wrote:
On Tuesday, 8 June 2021 at 00:58:12 UTC, Jack wrote:
the dll which I was just build with dub command? how I have a
version mismatch if they're the very same file?
Electron embeds node and does not use whatever you have on your
On Monday, 7 June 2021 at 20:13:03 UTC, frame wrote:
On Monday, 7 June 2021 at 02:33:38 UTC, Jack wrote:
What am I missing?
If this runs under Windows, there is no dlopen(), maybe a
wrapper to LoadLibrary() but this will need to call a DllMain()
in the DLL if I am not wrong. Is there a
Hello.
I'm looking for someone who has plenty of experience in the D
programming language.
I have some task, which I hope will be added to Rosetta Code.
This task is based on pqmarkup, and is called pqmarkup-lite.
The specialty of this task is formatting characters of pqmarkup
{paired
Consider the following code in what I used nested-classes for the
first time within D:
```d
import std.string;
import std.stdio;
class classComputers {
classComputers lhs;
classComputers rhs;
int opApply(int delegate(classComputer) dg) { /// boilerplate
code to handle the class's
On Tuesday, 8 June 2021 at 02:05:27 UTC, Paul Backus wrote:
Your module and class are both named `classComputers`, with an
`s` at the end. You should change one of the to have a
different name so that there's no ambiguity.
dmd output:
./dm.d(49): Error: undefined identifier `classComputer`
On Tuesday, 8 June 2021 at 02:59:28 UTC, rikki cattermole wrote:
SafeD is an old name given to the attributes @safe @trusted
@system.
I have the Alexandrescu's book on hand so that explains it.
There is no switch nor any special behavior now that it has
long been added to mainline D.
So
On Tuesday, 8 June 2021 at 03:54:47 UTC, Jack wrote:
better read carefully how the attribute work
Good advice. I think I am going too fast. Thank you :)
On Tue, Jun 08, 2021 at 02:47:18AM +, someone via Digitalmars-d-learn wrote:
> https://dlang.org/articles/safed.html
> https://dlang.org/dmd-linux.html#switches
> http://ddili.org/ders/d.en/functions_more.html
>
> Neither man dmd nor man dmd.conf appear to have a related/switch
> setting.
>
On Monday, 7 June 2021 at 22:24:03 UTC, Jack wrote:
I think the entry point function is ```void atStart(napi_env
env) {}``` so there's no DllMain...
DLLMain is not strictly required. It's called by the system
loader when the DLL is first loaded into the process. The
MainFunction for node
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
On Monday, 7 June 2021 at 20:13:03 UTC, frame wrote:
On Monday, 7 June 2021 at 02:33:38 UTC, Jack wrote:
What am I missing?
If this runs under Windows, there is no dlopen(), maybe a
wrapper to LoadLibrary() but this will need to call a DllMain()
in the DLL if I am not wrong. Is there a
On Monday, 7 June 2021 at 20:37:19 UTC, MoonlightSentinel wrote:
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
On Tuesday, 8 June 2021 at 00:54:41 UTC, someone wrote:
Are there alternatives to nested classes for such scenarios ?
Self-reply: I created two files for classComputers and
classComputer and I replaced the nested-classComputer code within
classComputers with:
import classComputers;
But it
On Monday, 7 June 2021 at 14:12:14 UTC, H. S. Teoh wrote:
Here's my solution to D's short integer cast-madness: abstract
it away in an infectious wrapper type.
Your workaround seems interesting. Will look further into the
concept in the coming days. I am learning the D-ways and there's
so
On Tuesday, 8 June 2021 at 00:00:50 UTC, Mike Parker wrote:
On Monday, 7 June 2021 at 22:24:03 UTC, Jack wrote:
I think the entry point function is ```void atStart(napi_env
env) {}``` so there's no DllMain...
DLLMain is not strictly required. It's called by the system
loader when the DLL
I getting
```
import/core/sync/mutex.d(87,36): Error: `pthread_mutexattr_init`
cannot be interpreted at compile time, because it has no
available source code
```
compile time error. One of those D exceptions which doesn't say
where it happened in your code so you need to comment out the
On Monday, 7 June 2021 at 09:29:08 UTC, tastyminerals wrote:
I getting
```
import/core/sync/mutex.d(87,36): Error:
`pthread_mutexattr_init` cannot be interpreted at compile time,
because it has no available source code
```
compile time error. One of those D exceptions which doesn't say
where
https://forum.dlang.org/post/koxqrqqzadfefbgkd...@forum.dlang.org
41 matches
Mail list logo