I'm registering a callback with some C code. The simplified story is
here, but the actual code is on GitHub [1] at the end if you care.
The call looks something like this.
void register(void(*fp)(void*), void* context);
I have a class that holds state for the callback and registers itself:
On Monday, 30 March 2015 at 02:13:22 UTC, Alex Parrill wrote:
I have a directory structure like this:
.
| test.d
|
\---test
| test1.txt
|
\---subfolder
test2.txt
I am running test.d using this command:
On Monday, 30 March 2015 at 02:53:36 UTC, Paul O'Neil wrote:
As of dmd 2.067, doing this is deprecated.
where is this documented? I don't see it in the release notes.
On 30/03/2015 3:51 p.m., Baz wrote:
On Monday, 30 March 2015 at 02:13:22 UTC, Alex Parrill wrote:
I have a directory structure like this:
.
| test.d
|
\---test
| test1.txt
|
\---subfolder
test2.txt
I am running test.d using this
it's still working. moreover, it is used in Phobos! and yet it's not
documented anywhere. what i want to know is whether they will be removed
for good, or brought back and properly documented? the current situation
is awful: compiler has special treatment for some aggregate members, but
On Sunday, 29 March 2015 at 12:37:23 UTC, Robert burner Schadek
wrote:
On Sunday, 29 March 2015 at 01:36:24 UTC, lobo wrote:
Hi,
I'm trying to use std.experimental.logger and I'd like the
logf(), tracef() style functions to log to a file and stdout.
(note: I can use sharedLog.logf(),
On Sunday, 29 March 2015 at 23:19:31 UTC, Freddy wrote:
Is there any way to do a final switch statement in
std.variant's Algebraic.
Not currently. However, std.variant.visit is probably what you
want. It enforces that you handle all types contained in the
Algebraic.
import std.variant;
On 03/29/2015 10:57 PM, weaselcat wrote:
On Monday, 30 March 2015 at 02:53:36 UTC, Paul O'Neil wrote:
As of dmd 2.067, doing this is deprecated.
where is this documented? I don't see it in the release notes.
I don't see it in the release notes either, but it's happening. Maybe
it's an
On Sun, 29 Mar 2015 22:53:35 -0400, Paul O'Neil wrote:
I'm registering a callback with some C code. The simplified story is
here, but the actual code is on GitHub [1] at the end if you care.
The call looks something like this.
void register(void(*fp)(void*), void* context);
I have a
On Sun, 29 Mar 2015 17:33:02 +, Namespace wrote:
On Sunday, 29 March 2015 at 16:29:40 UTC, ketmar wrote:
On Sun, 29 Mar 2015 16:00:05 +, matovitch wrote:
On Sunday, 29 March 2015 at 14:50:24 UTC, ketmar wrote:
On Sun, 29 Mar 2015 13:45:10 +, matovitch wrote:
you can also use
I have a directory structure like this:
.
| test.d
|
\---test
| test1.txt
|
\---subfolder
test2.txt
I am running test.d using this command:
rdmd -Jtest test.d
I can do `import(test1.txt)` from
On Sun, 29 Mar 2015 20:29:49 +, bitwise wrote:
The verbosity and blatant disregard for DRY makes me CRY.
See what I did there.. ;)
you can always `alias` it to something funny or obscene.
signature.asc
Description: PGP signature
On Monday, 30 March 2015 at 02:53:36 UTC, Paul O'Neil wrote:
I'm registering a callback with some C code. The simplified
story is
here, but the actual code is on GitHub [1] at the end if you
care.
The call looks something like this.
void register(void(*fp)(void*), void* context);
I have a
On Sunday, 29 March 2015 at 01:27:01 UTC, Koi wrote:
Hello,
today i implemented OpenGL instancing, and it crashed when
calling glVertexAttribDivisor (OpenGL 3.3).
So i checked DerelictGL3.reload() and it returned
GLVersion.GL32, not GL33.
My graphic card (NVidia GT 240) should support
On Sun, 29 Mar 2015 13:45:10 +, matovitch wrote:
you can also use unions.
signature.asc
Description: PGP signature
On 3/29/2015 10:26 AM, Koi wrote:
Hello,
today i implemented OpenGL instancing, and it crashed when calling
glVertexAttribDivisor (OpenGL 3.3).
So i checked DerelictGL3.reload() and it returned GLVersion.GL32, not GL33.
My graphic card (NVidia GT 240) should support GL33 and an OpenGL
On Sunday, 29 March 2015 at 14:34:39 UTC, Rene Zwanenburg wrote:
On Sunday, 29 March 2015 at 01:27:01 UTC, Koi wrote:
How do you create your context? OpenGL version needs to be
specified when creating it, for example when using GLFW:
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
On Sunday, 29 March 2015 at 14:50:24 UTC, ketmar wrote:
On Sun, 29 Mar 2015 13:45:10 +, matovitch wrote:
you can also use unions.
Good idea ! In my case I think it was better to cast, but this
could be helpful another time thanks ! :)
On Monday, 30 March 2015 at 03:02:07 UTC, Paul O'Neil wrote:
On 03/29/2015 10:57 PM, weaselcat wrote:
On Monday, 30 March 2015 at 02:53:36 UTC, Paul O'Neil wrote:
As of dmd 2.067, doing this is deprecated.
where is this documented? I don't see it in the release notes.
I don't see it in
On Sunday, 29 March 2015 at 13:39:47 UTC, matovitch wrote:
Hi,
floats are stored on 32 bits using ieee754...and I would like
(for some obscure reason) to reinterpret a such float into a 32
bits uint (i.e without altering the memory). A simple :
import std.stdio;
void main()
{
float f =
On Sunday, 29 March 2015 at 01:36:24 UTC, lobo wrote:
Hi,
I'm trying to use std.experimental.logger and I'd like the
logf(), tracef() style functions to log to a file and stdout.
(note: I can use sharedLog.logf(), sharedLog.tracef(), but I
prefer just logf())
So I did this:
shared static
Hi,
floats are stored on 32 bits using ieee754...and I would like
(for some obscure reason) to reinterpret a such float into a 32
bits uint (i.e without altering the memory). A simple :
import std.stdio;
void main()
{
float f = 0.5;
uint i = cast(uint)(f);
writeln(i);
}
doesn't
On Sun, 29 Mar 2015 16:00:05 +, matovitch wrote:
On Sunday, 29 March 2015 at 14:50:24 UTC, ketmar wrote:
On Sun, 29 Mar 2015 13:45:10 +, matovitch wrote:
you can also use unions.
Good idea ! In my case I think it was better to cast, but this could be
helpful another time thanks !
On Sunday, 29 March 2015 at 16:29:40 UTC, ketmar wrote:
On Sun, 29 Mar 2015 16:00:05 +, matovitch wrote:
On Sunday, 29 March 2015 at 14:50:24 UTC, ketmar wrote:
On Sun, 29 Mar 2015 13:45:10 +, matovitch wrote:
you can also use unions.
Good idea ! In my case I think it was better to
I'm a little confused at this point why this doesn't work either:
const(Test) test = new Test(); // fine
test = new Test(); // error
In C++, There is a clear distinction:
const Test *test1 = nullptr; // const before type
test1 = new Test(); // fine
Test
The whole art/science vein of these Knuth quotes seems like a
lot of BS, trying to situate computer programming in the
long-standing and overblown science/humanities divide.
I should like to see an argument rather than mere assertion.
Steve Jobs is not an authority on this subject, but I
perhaps something like Rebindable could be used.
Looking at Rebindable now, there is a useful example. There
should probably be a mention of this on the const/immutable docs.
For people coming from C++, this will not be obvious.
auto a = Rebindable!(const Widget)(new Widget);
a.y();
bitwise:
I'm a little confused at this point why this doesn't work
either:
const and immutable are rather different between C++ and D, I
suggest you to take a look at the documentation:
http://dlang.org/const-faq.html
Bye,
bearophile
On Saturday, 28 March 2015 at 09:04:51 UTC, Messenger wrote:
On Saturday, 28 March 2015 at 01:09:44 UTC, Laeeth Isharc wrote:
On Friday, 27 March 2015 at 11:33:39 UTC, Kagamin wrote:
Hmm... science exists only as long as we don't understand
something, then it disappears and only knowledge
On Sunday, 29 March 2015 at 18:05:28 UTC, Laeeth Isharc wrote:
I appreciate that many of us have better things to do. But I
had been thinking about why I find D appealing, and how I would
get this across to future partners, and had also been thinking
about various forum comments equating
On Friday, 27 March 2015 at 06:31:40 UTC, Laeeth Isharc wrote:
In this talk I shall try to explain why I think Art is the
appropriate word. I will discuss what it means for something to
be an art, in contrast to being a science; I will try to
examine whether arts are good things or bad things;
On Sunday, 29 March 2015 at 19:04:30 UTC, anonymous wrote:
Notice how you have that '*' there that allows you to
distinguish the data from the reference.
You can have a mutable pointer to const data in D, too:
struct Test {}
const(Test)* test1 = null;
test1 = new Test; /* fine */
Although, I suppose this is still a step up from C# which has not
const at all =O
On Sunday, 29 March 2015 at 18:51:19 UTC, Joakim wrote:
On Sunday, 29 March 2015 at 18:05:28 UTC, Laeeth Isharc wrote:
I appreciate that many of us have better things to do. But I
had been thinking about why I find D appealing, and how I
would get this across to future partners, and had also
On Sunday, 29 March 2015 at 18:41:36 UTC, Laeeth Isharc wrote:
The whole art/science vein of these Knuth quotes seems like a
lot of BS, trying to situate computer programming in the
long-standing and overblown science/humanities divide.
I should like to see an argument rather than mere
On Sunday, 29 March 2015 at 19:13:32 UTC, bitwise wrote:
Interesting, but I still don't understand why D doesn't have
something like this:
const Test test;// or const(Test) test;
test = new Test() // fine, underlaying data is const, the
reference is not
Test const test = new Test();
1) Such placement based syntax is foreign to D.
I would have to agree that this is a strange way to do things in
any language.
The great int* a vs int *a debate...
2) It would be special syntax just for class types.
IMO, it would be worth it
3) It's not how C++ rolls.
`const Test test;`
On Sunday, 29 March 2015 at 18:43:32 UTC, bitwise wrote:
I'm a little confused at this point why this doesn't work
either:
const(Test) test = new Test(); // fine
test = new Test(); // error
In C++, There is a clear distinction:
const Test *test1 = nullptr; // const
What's the most efficient way to extract a the storage from a
BinaryHeap and then sort it?
Is there a better way other than
binaryHeap.release.sort
than makes use of the heap property? For example
while (!binaryHeap.empty)
{
sortedStorage ~= binaryHeap.front;
On Sunday, 29 March 2015 at 20:29:50 UTC, bitwise wrote:
3) It's not how C++ rolls.
`const Test test;` and `Test const test;` are equivalent in
C++. You need that '*' in C++, too, to make a distinction
between reference and data.
I'm a little confused. I was comparing a C++ pointer-to-class
On Sunday, 29 March 2015 at 20:05:22 UTC, Nordlöw wrote:
What's the most efficient way to extract a the storage from a
BinaryHeap and then sort it?
Is there a better way other than
binaryHeap.release.sort
than makes use of the heap property? For example
while (!binaryHeap.empty)
Is there any way to do a final switch statement in std.variant's
Algebraic.
42 matches
Mail list logo