shd Wrote:
> Firstly, thanks for response.
After reading Kagamin's response, I'm not sure I understand you still. You want
to have code reuse, you want to have run-time and compile-time configuration,
but you don't want to make use of the technologies/techniques/patterns which
facilitate these
I think he's on a vacation though. :p
Andrej Mitrovic:
> I don't know whether this is intentional or not,
I think it was not intentional. Regarding your successive questions, Don is
your man and best hope.
Bye,
bearophile
I'm wondering about this:
void main()
{
import std.math;
FloatingPointControl fpc;
fpc.enableExceptions(FloatingPointControl.severeExceptions);
float foo;
}
Declaring uninitialized floating point variables after enabling severe
exceptions will throw at runtime:
object.Error: Inva
> Any anti-anti-hijacking ideas? :)
Hopefully I remember to reply more in-depth when I get home.
But this was a question on SO that sounds kind of like your request. I tried
explaining why anti-hijacking was created.
http://stackoverflow.com/questions/6362280/d-template-specialization-in-diff
hm, seems like i am getting somewhere using
std.process.system( "start " ~ mycommandlinestring );
now i have to factor in the issues with the proper quotation of the arguments...
On 2011-07-12 21:19, captaindet wrote:
i am just in the middle of my first little d project. i came to the
point
Oh there's a pull already, this is great.
https://github.com/D-Programming-Language/dmd/pull/96
On 7/12/11, Trass3r wrote:
>> Is this going to be fixed any time soon? Allowing callbacks with D
>> calling convention where a C callback is expected should be an error,
>> and this is like the 10th time I've ran into this bug.
>
> http://d.puremagic.com/issues/show_bug.cgi?id=3797
>
Thanks, I'm v
Is this going to be fixed any time soon? Allowing callbacks with D
calling convention where a C callback is expected should be an error,
and this is like the 10th time I've ran into this bug.
http://d.puremagic.com/issues/show_bug.cgi?id=3797
I just had a bug where a D function is implicitly converted to an
extern(C) function pointer.
I've had this definition:
alias extern (C) void function(void* userData) PaStreamFinishedCallback;
And this extern(C) function:
PaError Pa_SetStreamFinishedCallback(PaStream* stream,
PaStreamFinishedCal
i am just in the middle of my first little d project. i came to the point where
i have to start new processes command line style incl arguments. they need to
run independent of the main program, i.e., several such processes need to be
started and must run parallel while the main program continu
Am 12.07.2011, 20:57 Uhr, schrieb David Nadlinger :
or use your normal system-wide installation which probably has all the
paths set up correctly by specifying the DMD variable: »make
DMD=/usr/local/bin/dmd«.
Thanks a lot for that hint!
>
> I think you may be confusing function templates with plain templates?
>
Yes, I was a bit confused by the syntax, but I found that type of
templates on page 281 in TDPL. That is an eponymous template.
Thanks.
The problem you are experiencing comes from no dmd.conf being included
with the Git repository. Either you can add one to your Git clone
directory, or use your normal system-wide installation which probably
has all the paths set up correctly by specifying the DMD variable: »make
DMD=/usr/local/
On 7/12/11, Steven Schveighoffer wrote:
> Call a function?
> void main()
> {
> void handleEx(Exception e)
> {
>// exception handling code here
> }
>
> try
> {
> }
> catch(Foo f)
> {
>handleEx(f);
> }
> catch(Bar b)
> {
>handleEx(b
Am 13.06.2011, 23:55 Uhr, schrieb Peter Alexander
:
I'm trying to run the test suite for DMD, but I'm running into issues.
Do I need to set up my environment differently to run dmd in
development? How can I get around this?
To quote IRC:
In theory it's simple: go to dmd/test and run make.
2011/7/12 Kagamin :
> You want an IOC container like Unity?
exactly
> And you want the interface-to-class mapping to be configurable externally
> rather than version out these classes directly in source?
> like
> version(UseGL)
> {
> static import wrappers.gl;
> alias wrappers.gl.WindowImpl Wind
shd Wrote:
> Actually, project structure looks like that:
> * project/
> * bin/
> * work/
> * docs/
> * iface/
> * ae
> * ge
> * pe
> (...)
> * impl/
> * glfw
> * ge.window
> * io.hid.keyboard
> * io.hid.mouse
> (you can add other window toolki
On Tue, 12 Jul 2011 11:07:57 -0400, Kagamin wrote:
Steven Schveighoffer Wrote:
Yes, but this is getting into territory where the false positive rate
might get high.
I bet it will be difficult to find a real-world example of this false
positive.
It depends on how the warning is triggered
Steven Schveighoffer Wrote:
> Yes, but this is getting into territory where the false positive rate
> might get high.
I bet it will be difficult to find a real-world example of this false positive.
On Tue, 12 Jul 2011 09:53:28 -0400, Steven Schveighoffer
wrote:
But wait, don't normal D functions have C calling convention? I thought
that was one of the benefits of D's ABI?
Tested it out, definitely is different. So this clearly needs to be
addressed.
-Steve
On 12/07/2011 13:15, Trass3r wrote:
You should declare the function pointer without the "extern(C)".
Example:
alias int function(void* test) FTInitFunc;
extern(C) int foo(void* test){ }
FTInitFunc foo_ptr = &foo;
This worked for me.
That's a bug.
Oh, well, I forgot to mention that th
On Tue, 12 Jul 2011 09:42:22 -0400, Johannes Pfau wrote:
Steven Schveighoffer wrote:
On Tue, 12 Jul 2011 05:36:15 -0400, Johannes Pfau
wrote:
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(vo
Trass3r wrote:
>> You should declare the function pointer without the "extern(C)".
>>
>> Example:
>> alias int function(void* test) FTInitFunc;
>>
>> extern(C) int foo(void* test){ }
>>
>> FTInitFunc foo_ptr = &foo;
>>
>> This worked for me.
>
>That's a bug.
I agree. It looks like the above c
Steven Schveighoffer wrote:
>On Tue, 12 Jul 2011 05:36:15 -0400, Johannes Pfau
>wrote:
>
>> From a discussion related to derelict:
>> How do you write this:
>> ---
>> alias extern(C) int function(void* test) FTInitFunc;
>> FTInitFunc FT_Init_Free
Firstly, thanks for response.
2011/7/11 Jesse Phillips :
> I'm sorry to say that I don't exactly know what you are trying to achieve or
> problems you are having. I'm going to trying and provide details on what I
> have gotten out of your message.
Hopefully i'll clarify it more.
> You can do c
Steven Schveighoffer wrote:
>On Sat, 09 Jul 2011 05:47:51 -0400, Johannes Pfau
>wrote:
>
>> Hi,
>>
>> I have a wrapper for a "object aware" c library (cairo). Take for
>> example two classes, Surface and a subclass, ImageSurface. Now this
>> code has to be valid:
>> ---
>> auto
On Sat, 09 Jul 2011 05:47:51 -0400, Johannes Pfau wrote:
Hi,
I have a wrapper for a "object aware" c library (cairo). Take for
example two classes, Surface and a subclass, ImageSurface. Now this
code has to be valid:
---
auto ptr = cairo_image_surface_create(CAIRO_FORMAT_AR
Is this a bug? If not, how do you make it work?
void h() {}
class Bla
{
mixin wrap!h;
}
mixin template wrap(alias f)
{
void blub(alias g = f)()
{
}
}
void main()
{
Bla b = new Bla();
b.blub();
}
test.d(18): Error: template instance cannot use lo
On Mon, 11 Jul 2011 16:46:07 -0400, Nick Sabalausky wrote:
"Steven Schveighoffer" wrote in message
Hm... I didn't know about that switch, I thought warnings were enabled
with -w and that made them errors.
I suppose you could stick this in there.
-wi: Enable warnings
-w: Enable warnings
On Tue, 12 Jul 2011 05:36:15 -0400, Johannes Pfau wrote:
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(void* test) FTInitFunc;
FTInitFunc FT_Init_FreeType
---
On Mon, 11 Jul 2011 18:08:19 -0400, Andrej Mitrovic
wrote:
I'm trying to do something like the following:
import std.exception;
class Foo : Exception
{
this(string msg) { super(msg); }
}
class Bar : Exception
{
this(string msg) { super(msg); }
}
void main()
{
try
{
}
On Mon, 11 Jul 2011 16:37:12 -0400, Andrej Mitrovic
wrote:
import std.stdio;
import std.string;
void main()
{
char* foo = "foo\0".dup.ptr;
writefln("Foo: %s", foo);
}
This will write the address of foo. Often when you link with C code
you have C structures such as this:
struct Info
You should declare the function pointer without the "extern(C)".
Example:
alias int function(void* test) FTInitFunc;
extern(C) int foo(void* test){ }
FTInitFunc foo_ptr = &foo;
This worked for me.
That's a bug.
On 12/07/2011 11:36, Johannes Pfau wrote:
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(void* test) FTInitFunc;
FTInitFunc FT_Init_FreeType
---
According to the Derelict page, there already are unofficial bindings.
But I guess they wouldn't work with Derelict2 anyway.
On 7/12/2011 4:21 PM, Dainius (GreatEmerald) wrote:
I see. And what about Lua? I see lots and lots of different libraries
for that on dsource, and there is even some support in Derelict as
well. I assume that LuaD is the one in active development and most
fitting for current D2?
Derelict has no
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(void* test) FTInitFunc;
FTInitFunc FT_Init_FreeType
---
without the alias?
-
Johannes Pfau wrote:
>Hi,
>
>I have a wrapper for a "object aware" c library (cairo). Take for
>example two classes, Surface and a subclass, ImageSurface. Now this
>code has to be valid:
>---
>auto ptr = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 512, 512);
>Surface s = new
I see. And what about Lua? I see lots and lots of different libraries
for that on dsource, and there is even some support in Derelict as
well. I assume that LuaD is the one in active development and most
fitting for current D2?
40 matches
Mail list logo