On Thursday, 3 November 2016 at 06:11:48 UTC, rikki cattermole
wrote:
[Environment32]
DFLAGS=-I/usr/include/dmd/phobos
-I/usr/include/dmd/druntime/import -L-L/usr/lib/i386-linux-gnu
-L--export-dynamic -fPIC -defaultlib=libphobos2.so
[Environment64]
DFLAGS=-I/usr/include/dmd/phobos
Le 01/07/2012 01:59, dnewbie a écrit :
import std.stdio;
alias void function(int) fooInt;
alias void function(long) fooLong;
int main(string[] args)
{
fooInt f1 = foo;
fooLong f2 = foo;
f1(1L);
f2(1L);
return 0;
}
void foo(int i)
{
writeln(foo(int i));
}
void foo(long i)
{
writeln(foo(long
Simple question. How to I get a function pointer to one of the foo
functions in this case :
void foo(int i);
void foo(long i);
Le 06/03/2012 05:34, Tyler Jameson Little a écrit :
I've been playing with libev in D lately, and I've run into a problem.
I've been able to hack around it, but it'd like to find a better, more
general solution. Here's a link to the code:
Le 24/02/2012 00:49, Vadim a écrit :
I am looking for the details on D Garbage Collection implementation. I
will much appreciate if someone suggests the answers or give some links
to existing documentation clarifying the following points:
1. Is it Mark-n-Sweep or copy or generational collector
Le 23/02/2012 21:00, mist a écrit :
Hello!
I have been asked few question recently from a Haskell programmer about
D2 and, after experimenting a bit, have found that I really can't
provide a good answe myself, as I am not getting a design limititations
(if any).
Here is the snippet, it is
Le 22/02/2012 03:59, Vladimir Panteleev a écrit :
On Tuesday, 21 February 2012 at 15:41:58 UTC, deadalnix wrote:
Le 21/02/2012 16:32, Vladimir Panteleev a écrit :
On Tuesday, 21 February 2012 at 15:22:15 UTC, deadalnix wrote:
struct stuff {
private Exception delegate() exceptionBuilder
Le 21/02/2012 18:46, Jacob Carlborg a écrit :
On 2012-02-21 16:55, deadalnix wrote:
Le 21/02/2012 16:48, Adam D. Ruppe a écrit :
A possible workaround is to initialize the delegate
in the object's constructor.
It is a struct. And struct don't have default constructor. It lead to
very
Le 22/02/2012 05:01, Andrej Mitrovic a écrit :
class Foo
{
this(int) inout
{ }
Foo makeFoo() { return new Foo(1); }
}
void main() { }
test.d(8): Error: cannot implicitly convert expression (new Foo(1)) of
type inout(Foo) to test.Foo
Is this a bug?
inout is supposed to
struct stuff {
private Exception delegate() exceptionBuilder = delegate Exception() {
return new Exception(foobar);
};
}
The following piece of code trigger a compiler error : delegate
module.stuff.__dgliteral1 function literals cannot be class members
Why is
Le 21/02/2012 16:32, Vladimir Panteleev a écrit :
On Tuesday, 21 February 2012 at 15:22:15 UTC, deadalnix wrote:
struct stuff {
private Exception delegate() exceptionBuilder = delegate Exception() {
return new Exception(foobar);
};
}
The following piece of code trigger a compiler error
Le 21/02/2012 16:48, Adam D. Ruppe a écrit :
A possible workaround is to initialize the delegate
in the object's constructor.
It is a struct. And struct don't have default constructor. It lead to
very segfault prone code (I did try that).
Le 21/02/2012 17:30, Mantis a écrit :
21.02.2012 17:24, deadalnix пишет:
struct stuff {
private Exception delegate() exceptionBuilder = delegate Exception() {
return new Exception(foobar);
};
}
The following piece of code trigger a compiler error : delegate
module.stuff.__dgliteral1 function
IMO, what would be stupid is that everything has to be object
oriented.
You have problems where OOP is good, and other where it isn't.
Use the tool that fit what you want to accomplish.
Screwdriver are great, but are useless when you are dealing with
a nail.
On Tuesday, 14 February 2012
Le 14/12/2011 13:48, Timon Gehr a écrit :
On 12/14/2011 01:28 PM, Kagamin wrote:
Goal would be to have a possibility to compile and let run code from
random people (some of them perhaps evil minded), watch over the
processes and kill them, if they take too long or use up too much
memory.
I
Le 29/11/2011 04:11, Andrej Mitrovic a écrit :
On 11/29/11, bearophilebearophileh...@lycos.com wrote:
Do you know why the compiler doesn't ask you for a cast, and why the run
does that?
Because foreach is broken?
http://d.puremagic.com/issues/show_bug.cgi?id=4510
No it has nothing to do
Le 21/11/2011 15:04, Alex Rønne Petersen a écrit :
Hi,
Is there any way to make a variable single-assignment, regardless of its
type? I.e.:
void foo()
{
some magical keyword? int i = 0;
i = 2; // Error: i cannot be reassigned
}
I realize const and immutable will do this, but they are
Le 09/11/2011 18:12, Dejan Lekic a écrit :
I would be satisfied with something like POSIX.1-2001 setrlimit() . Sure
nothing prevents me from using setrlimit() in my D app, but perhaps it is
something to think about a portable way of doing that.
One thing I like about my Java apps is that I can
Le 03/11/2011 15:39, Charles McAnany a écrit :
Hi. I noticed that one of the guarantees in TDPL is that any code that is valid
in both C
and D should compile with the same result. But I'm seeing a different behavior
here.
I'm trying to find the smallest double for which the comparison x+1/x =
, maybe I should reconside my project to port eigen.
Deadalnix
In addition, I would like to mention this confrence by Andrei
Alexandrescu : http://blip.tv/boostcon/boostcon-2009-keynote-2452140
Le 17/10/2011 04:55, Jonathan M Davis a écrit :
On Monday, October 17, 2011 10:22:42 Granville Barnett wrote:
Hi All,
I've not used D for long so hopefully this
Nice trick ! However, in D, you have scope(exit) scope(success) and
scope(failure) to do similar stuffs.
I personally use both, on a case by case basis.
Le 17/10/2011 06:47, Steve Teale a écrit :
Is not needed because structs are inherently scope.
I'm sure experienced D programmers do this
Le 12/10/2011 09:53, bearophile a écrit :
Jonathan M Davis:
int and dchar implicitly convert to one another for better or for worse.
Personally, I'd prefer that they didn't, but that's the way that it is, so I
don't believe that this is technically a bug.
char-int is OK, but int-char is not
Le 09/10/2011 12:00, Zardoz a écrit :
Recently I've been asked if I could give a speech about D in my university. It
will be of one hour of long.
I not respond yet, but I think that I will do it. Actually I have the problem
that I don't know well how explain well too many features and things of
DSFML2 doesn't exist right now. So no doubt you'll have trouble to
compile it. I don't know what you are try to achieve, but definitively
not what you believe.
Note that my answer in the mentionned link give you all you need to use
SFML with D.
SFML2 is currently on a devellopement stage,
of such a function call or somethung similar.
Thank by adavnce,
deadalnix
Great answer ! Thank you very much, it answered almost everything !
But what about, in the exemple you gave me (which is great by the way)
if foo as parameters ? Those parameters are passed on the stack by copy
to the function, and then, copied to the heap (resulting in two copies) ?
Le
27 matches
Mail list logo