On Monday, 31 October 2016 at 16:55:51 UTC, WhatMeWorry wrote:
Is there a way to turn off nothrow or work around it? Because
to me it looks like nothrow prevents me from doing anything
useful.
extern(C) void onKeyEvent(GLFWwindow* window, int key, int
scancode, int action, int modifier) not
On Monday, 31 October 2016 at 18:46:31 UTC, Jonathan M Davis
wrote:
though there's no reason to ever use a static constructor
(shared or otherwise) when you can directly initialize the
variable. It's really meant for more complicated initialization
that can't be done directly.
Also, I would p
On 10/31/2016 12:31 PM, Daniel Kozak via Digitalmars-d-learn wrote:
Dne 31.10.2016 v 20:20 Charles Hixson via Digitalmars-d-learn napsal(a):
...
but
dmd -defaultlib=libphobos2.so -fPIC test.d
works. It shouldn't be required (as in the default /etc/dmd.conf
should handle it correctly, but I c
On Monday, October 31, 2016 22:20:59 Kapps via Digitalmars-d-learn wrote:
> Assuming you're sure it'll never throw. To enforce this, use try
> { } catch { throw new Error("blah"); }. You can still throw
> errors, just not exceptions (as errors are not meant to be
> caught).
I always use assert(0).
On Monday, 31 October 2016 at 17:04:28 UTC, Temtaime wrote:
On Monday, 31 October 2016 at 16:55:51 UTC, WhatMeWorry wrote:
Is there a way to turn off nothrow or work around it? Because
to me it looks like nothrow prevents me from doing anything
useful.
extern(C) void onKeyEvent(GLFWwindow*
On 10/31/2016 12:08 PM, Gary Willoughby wrote:
Can someone please explain why the following assertion fails?
import std.stdio;
import std.conv;
void main(string[] args)
{
auto x = 1;
assert(hashOf(x.to!(string)) == hashOf(x.to!(string)));
}
Thanks.
I think you need TypeInfo.getHash.
On Monday, 31 October 2016 at 19:24:13 UTC, Ali Çehreli wrote:
On 10/31/2016 12:08 PM, Gary Willoughby wrote:
[...]
Because it considers the .ptr property of arrays as well:
https://github.com/dlang/druntime/blob/master/src/core/internal/hash.d#L61
[...]
Ah right.
Is there an alternative
Dne 31.10.2016 v 20:20 Charles Hixson via Digitalmars-d-learn napsal(a):
...
but
dmd -defaultlib=libphobos2.so -fPIC test.d
works. It shouldn't be required (as in the default /etc/dmd.conf
should handle it correctly, but I can deal with it now.
It should work, it is possible that you have s
On 10/31/2016 12:08 PM, Gary Willoughby wrote:
Can someone please explain why the following assertion fails?
import std.stdio;
import std.conv;
void main(string[] args)
{
auto x = 1;
assert(hashOf(x.to!(string)) == hashOf(x.to!(string)));
}
Thanks.
Because it considers the .ptr prop
On 10/31/2016 11:23 AM, Daniel Kozak via Digitalmars-d-learn wrote:
Dne 31.10.2016 v 18:06 Charles Hixson via Digitalmars-d-learn napsal(a):
On 10/31/2016 09:26 AM, Charles Hixson via Digitalmars-d-learn wrote:
On 10/30/2016 11:34 PM, Daniel Kozak via Digitalmars-d-learn wrote:
Dne 31.10.201
On Monday, 31 October 2016 at 19:08:50 UTC, Gary Willoughby wrote:
Can someone please explain why the following assertion fails?
import std.stdio;
import std.conv;
void main(string[] args)
{
auto x = 1;
assert(hashOf(x.to!(string)) == hashOf(x.to!(string)));
}
Thanks.
DMD64
Can someone please explain why the following assertion fails?
import std.stdio;
import std.conv;
void main(string[] args)
{
auto x = 1;
assert(hashOf(x.to!(string)) == hashOf(x.to!(string)));
}
Thanks.
On Monday, October 31, 2016 16:02:13 WhatMeWorry via Digitalmars-d-learn
wrote:
> On Monday, 31 October 2016 at 05:42:16 UTC, sarn wrote:
> > On Monday, 31 October 2016 at 04:35:35 UTC, WhatMeWorry wrote:
> >> [...]
> >
> > I've seen hacks to do the same thing in C++. They're not
> > pretty, thou
Dne 31.10.2016 v 18:06 Charles Hixson via Digitalmars-d-learn napsal(a):
On 10/31/2016 09:26 AM, Charles Hixson via Digitalmars-d-learn wrote:
On 10/30/2016 11:34 PM, Daniel Kozak via Digitalmars-d-learn wrote:
Dne 31.10.2016 v 02:30 Charles Hixson via Digitalmars-d-learn
napsal(a):
Well,
On 10/31/2016 09:02 AM, WhatMeWorry wrote:
> Thanks! If you don't mind a follow up question, is this:
>
> immutable uint maxSize = 128;
>
> identical to this:
>
> immutable uint maxSize;
>
> static this()
> {
> maxSize = 128;
>
> }
As usual, yes and no. :)
The former is initialized at compi
On Monday, 31 October 2016 at 16:06:48 UTC, Adam D. Ruppe wrote:
dmd yourfile.d winmm.lib
i personally like https://dlang.org/spec/pragma.html#lib
pragma(lib, "winmm.lib");
On 10/31/2016 09:26 AM, Charles Hixson via Digitalmars-d-learn wrote:
On 10/30/2016 11:34 PM, Daniel Kozak via Digitalmars-d-learn wrote:
Dne 31.10.2016 v 02:30 Charles Hixson via Digitalmars-d-learn napsal(a):
Well, that certainly changed the error messages. With
dmd -defaultlib=/usr/lib/x
On Monday, 31 October 2016 at 16:55:51 UTC, WhatMeWorry wrote:
Is there a way to turn off nothrow or work around it? Because
to me it looks like nothrow prevents me from doing anything
useful.
extern(C) void onKeyEvent(GLFWwindow* window, int key, int
scancode, int action, int modifier) not
Is there a way to turn off nothrow or work around it? Because to
me it looks like nothrow prevents me from doing anything useful.
extern(C) void onKeyEvent(GLFWwindow* window, int key, int
scancode, int action, int modifier) nothrow
{
if(queue.roomInQueue())
{
auto event = ne
Thanks Adam for your kindness, it Works now.
Thanks Alfred for the hint on setting the console output to 65001,
will be useful as well.
Greetings
Cleverson
On 10/30/2016 11:34 PM, Daniel Kozak via Digitalmars-d-learn wrote:
Dne 31.10.2016 v 02:30 Charles Hixson via Digitalmars-d-learn napsal(a):
Well, that certainly changed the error messages. With
dmd -defaultlib=/usr/lib/x86_64-linux-gnu/libphobos2.so test.d
I get:
/usr/include/dmd/druntime/im
On Monday, 31 October 2016 at 14:02:01 UTC, Cleverson Casarin
Uliana wrote:
Error 42: Symbol Undefined _PlaySoundW@12
This is the most common linker error, it means you used a
function without including the library.
PlaySound's docs
https://msdn.microsoft.com/en-us/library/windows/desktop
On Monday, 31 October 2016 at 05:42:16 UTC, sarn wrote:
On Monday, 31 October 2016 at 04:35:35 UTC, WhatMeWorry wrote:
[...]
I've seen hacks to do the same thing in C++. They're not
pretty, though.
[...]
Class/struct static constructors are good for initialising
class/struct static dat
On Monday, 31 October 2016 at 11:44:25 UTC, Cleverson Casarin
Uliana wrote:
Hello all, I'm trying to do two tasks which involves some type
conversion, and I'm having dificulties, probably because I
haven't yet understood well how such types works.
First, I wanted to convert UTF-8 strings to an
On the other hand if you do more IO, you can have higher CPU load
due to compression and serialization.
Thank you very much, Adam, now I'm receiving another strange error. My
code is this:
import core.sys.windows.mmsystem;
void main() {
PlaySoundW("C:/base/portavox/som/_fon102.wav"w.ptr, null, SND_FILENAME);
}
When trying to compile, it returns:
OPTLINK (R) for Win32 Release 8.00.17
Copyright (C)
On Monday, 31 October 2016 at 11:44:25 UTC, Cleverson Casarin
Uliana wrote:
Although the above code works, I have an impression that it
could be more elegant and concise, but don't know how to
improve it...
That's OK except for the last line... the length isn't
necessarily correct so your sli
On Monday, 31 October 2016 at 04:35:35 UTC, WhatMeWorry wrote:
I am fascinated with D's module static this.
I have shamelessly stolen Ali's code directly from his book.
module cat;
static this() {
// ... the initial operations of the module ...
}
static ~this() {
// ... the final operations of
Hello all, I'm trying to do two tasks which involves some type
conversion, and I'm having dificulties, probably because I haven't yet
understood well how such types works.
First, I wanted to convert UTF-8 strings to ansi, so it displays
correctly at the Windows command prompt. One function to do t
On Tuesday, 25 October 2016 at 11:17:29 UTC, Saurabh Das wrote:
Hello,
Are there any good ML libraries for D? In particular, looking
for a neural network library currently. Any leads would be
appreciated.
Thanks,
Saurabh
There is also Henry Gouk's dnnet library[1]. I'm not sure how far
is
On Wednesday, 26 October 2016 at 12:13:16 UTC, Ilya Yaroshenko
wrote:
https://github.com/ljubobratovicrelja/mir.experimental.model.rbf
Now moved to https://github.com/libmir/mir-neural
Hello,
From GCC 6.2, -fpie is becoming the default setting at compile
and at link time.
As dmd uses GCC to link, now the code needs to be compiled with a
special option.
Which means you need, at the moment, to add the following options
to your dmd.conf:
-defaultlib=libphobos2.so -fPIC
(the ch
32 matches
Mail list logo