Speaking of COM.. has anyone successfully used COM interfaces in D2?
I once tried to create a DDraw proxy dll but I can't remember how good it
worked.
https://bitbucket.org/trass3r/ddrawproxy
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - .fragment;
scope(success) {
std.file.rename(tempFilename, filename);
}
auto f = File(tempFilename, w);
}
and:
void transactionalCreate(string filename) {
string
How does one avoid code duplication in a snippet code like this:
class A{}
void foo(const A, void delegate(const A) fn)
{
// some stuff
// ...
// ...
}
void foo(A, void delegate(A) fn)
{
// exact same stuff, with different qualifiers
// ...
// ...
On Thu, 20 Jan 2011 21:14:06 -0500, Adam Conner-Sax
adam_conner_...@yahoo.com wrote:
The following code:
import std.algorithm;
class Foo {
private:
int id_;
public:
shared int id() const { return id_; }
}
static bool compare(in shared(Foo) a, in shared(Foo) b)
{
return (a.id()
On 01/21/2011 02:18 PM, tamir wrote:
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - .fragment;
scope(success) {
std.file.rename(tempFilename, filename);
}
auto f = File(tempFilename, w);
}
and:
void
Thanks!
I tried to apply that patch and rebuild phobos (I changed the file, remade
libphobos2.a, put it in /usr/local/lib). That worked but I still get my error.
I
might have done the applying or rebuilding wrong though, especially since once I
did that, even with the casting away of shared, I
On Fri, 21 Jan 2011 10:04:56 -0500, Adam Conner-Sax
adam_conner_...@yahoo.com wrote:
Thanks!
I tried to apply that patch and rebuild phobos (I changed the file,
remade
libphobos2.a, put it in /usr/local/lib). That worked but I still get my
error. I
might have done the applying or
On Fri, 21 Jan 2011 08:18:15 -0500, tamir tamir@gmail.com wrote:
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - .fragment;
scope(success) {
std.file.rename(tempFilename, filename);
}
auto f =
On Fri, 21 Jan 2011 10:09:18 -0500, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Fri, 21 Jan 2011 10:04:56 -0500, Adam Conner-Sax
adam_conner_...@yahoo.com wrote:
Thanks!
I tried to apply that patch and rebuild phobos (I changed the file,
remade
libphobos2.a, put it in
On Fri, 21 Jan 2011 09:08:58 -0500, Sean Eskapp eatingstap...@gmail.com
wrote:
How does one avoid code duplication in a snippet code like this:
class A{}
void foo(const A, void delegate(const A) fn)
{
// some stuff
// ...
// ...
}
void foo(A, void delegate(A) fn)
{
On 1/20/11 5:48 PM, Jacob Carlborg wrote:
On 2011-01-20 21:34, Steven Schveighoffer wrote:
On Thu, 20 Jan 2011 15:03:55 -0500, Jacob Carlborg d...@me.com wrote:
On 2011-01-20 19:18, Steven Schveighoffer wrote:
On Thu, 20 Jan 2011 13:07:58 -0500, Jacob Carlborg d...@me.com wrote:
On
templates:
void foo(T)(T, void delegate(T) fn)
{
}
This parameterizes foo based on T, which could be A, const A, or int, or
whatever works to compile the function.
What if the parameters are more general, for instance the first parameter is
always a Foo, the second is a delegate which
On Friday, January 21, 2011 12:36:23 Ary Manzana wrote:
On 1/20/11 5:48 PM, Jacob Carlborg wrote:
On 2011-01-20 21:34, Steven Schveighoffer wrote:
On Thu, 20 Jan 2011 15:03:55 -0500, Jacob Carlborg d...@me.com wrote:
On 2011-01-20 19:18, Steven Schveighoffer wrote:
On Thu, 20 Jan 2011
On Friday, January 21, 2011 05:18:15 tamir wrote:
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - .fragment;
scope(success) {
std.file.rename(tempFilename, filename);
}
auto f = File(tempFilename, w);
}
Hi, I'm trying to override Object's toString. I've noted it isn't a
const method, namely:
string toString() const;
This cause me troubles when using it on a const reference.
Shouldn't it be const?
Thanks,
Tom;
Sean Eskapp Wrote:
templates:
void foo(T)(T, void delegate(T) fn)
{
}
This parameterizes foo based on T, which could be A, const A, or int, or
whatever works to compile the function.
What if the parameters are more general, for instance the first parameter is
always a Foo,
Tom Wrote:
Hi, I'm trying to override Object's toString. I've noted it isn't a
const method, namely:
string toString() const;
This cause me troubles when using it on a const reference.
Shouldn't it be const?
Thanks,
Tom;
Phobos hasn't become very const aware. There have been bugs
When there are multiple calls that can fail, and where I have to do
clean-up code in a certain order and under certain conditions I use
scope(exit). For example:
import std.stdio;
import std.exception;
void main()
{
foo();
}
enum NoError = true;
bool Initialize() { return true; }
bool
On Friday, January 21, 2011 13:02:56 Tom wrote:
Hi, I'm trying to override Object's toString. I've noted it isn't a
const method, namely:
string toString() const;
This cause me troubles when using it on a const reference.
Shouldn't it be const?
Thanks,
Tom;
It's a long-standing
On Friday, January 21, 2011 14:49:44 Andrej Mitrovic wrote:
When there are multiple calls that can fail, and where I have to do
clean-up code in a certain order and under certain conditions I use
scope(exit). For example:
import std.stdio;
import std.exception;
void main()
{
foo();
On Friday, January 21, 2011 14:12:18 Andrej Mitrovic wrote:
import std.stdio;
import std.concurrency;
void foo(int var)
{
}
bool bar(int var)
{
return true;
}
void barWrapper(int var)
{
bar(var);
}
void main()
{
spawn(foo, 1);
spawn(barWrapper, 1);
Jesse Phillips:
So I do believe it should be const, but between the other priorities, and
possible signature change for toString, it isn't done yet.
There also the idea of introducing the writeTo() standard method, that's neat
:-)
Bye,
bearophile
Sorry, I should be careful with the word side-effects. What I meant
was the newly spawned thread does its own job that the main thread
doesn't care much about. It doesn't touch main's state or any shared
variables. It does some work other than return a value. But the
function I wanted the new
On 01/21/2011 09:56 PM, Jonathan M Davis wrote:
On Friday, January 21, 2011 05:18:15 tamir wrote:
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - .fragment;
scope(success) {
std.file.rename(tempFilename,
The following code yields results as commented.
import std.stdio;
class A
{
int b;
}
void main()
{
const A a = new A;
writeln(typeof(a).stringof); // const(A)
writeln(typeof(a.b).stringof); // const(int)
writeln((const A).stringof); // const(A)
Sean Eskapp wrote:
The following code yields results as commented.
import std.stdio;
class A
{
int b;
}
void main()
{
const A a = new A;
writeln(typeof(a).stringof); // const(A)
writeln(typeof(a.b).stringof); // const(int)
writeln((const A).stringof); // const(A)
On Friday, January 21, 2011 15:23:37 Andrej Mitrovic wrote:
Sorry, I should be careful with the word side-effects. What I meant
was the newly spawned thread does its own job that the main thread
doesn't care much about. It doesn't touch main's state or any shared
variables. It does some work
27 matches
Mail list logo