On 06/21/2014 06:40 AM, Jesse Phillips wrote:
On Thursday, 19 June 2014 at 15:24:41 UTC, Jesse Phillips wrote:
Once I get some examples compiling again in 32bit, it should be easier
for you to play around with COM in D.
I've pushed changes which get the library building and examples working.
On 06/20/14 14:42, Dicebot via Digitalmars-d-learn wrote:
On Friday, 20 June 2014 at 12:17:22 UTC, Johann Lermer wrote:
So, why is there no init routine for the rectangle? There's only one for the
matrix.
That needs actually building deimos cairo and checking symbols in object
files so I
On 06/21/14 05:32, Paul D Anderson via Digitalmars-d-learn wrote:
I can't use a template mixin:
mixin template Function(string name)
{
const char[] Function =
public static int ~ name ~ () { return other.module. ~ name ~; };
}
Error: mixin templates are not regular templates.
On Saturday, 21 June 2014 at 11:12:18 UTC, Artur Skawina via
Digitalmars-d-learn wrote:
On 06/21/14 05:32, Paul D Anderson via Digitalmars-d-learn
wrote:
I can't use a template mixin:
mixin template Function(string name)
{
const char[] Function =
public static int ~ name ~ () { return
Out of curiosity, why use a mixin template containing a string mixin
instead of, well, directly injecting a string mixin in your struct,
with a function?
On Saturday, 21 June 2014 at 13:45:14 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
Out of curiosity, why use a mixin template containing a string
mixin
instead of, well, directly injecting a string mixin in your
struct,
with a function?
Hiding non-hygienic implementation behind a more
On Saturday, 21 June 2014 at 10:26:57 UTC, simendsjo wrote:
This is great. I used Juno back in 2007 for working with Excel,
and it
worked great. Nice to see the library getting an update for D2.
I remember seeing some slides on another COM library for D2 a
while ago.
Was that effort ever
On Friday, 20 June 2014 at 11:15:20 UTC, Mike wrote:
Do you think it's ready for a v0.1 release? It be willing to
add it to dub if it passes general D coding stardards.
Sure, go for it :). Dub package versioning should be done using
SemVer so there are some restrictions on how to number a
On Sat, Jun 21, 2014 at 4:24 PM, Dicebot via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Saturday, 21 June 2014 at 13:45:14 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
Out of curiosity, why use a mixin template containing a string mixin
instead of, well, directly
IS there such method get(key, default) for associative arrays,
like in Python?
On Saturday, June 21, 2014, Paul via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
IS there such method get(key, default) for associative arrays, like in
Python?
I think it's named getDefault, try that.
On Saturday, June 21, 2014, Paul D Anderson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Does enum have any effect on functions?
I think that's just a parser bug.
Paul:
IS there such method get(key, default) for associative arrays,
like in Python?
Try it.
Bye,
bearophile
I tried this:
struct S {
R opDispatch(string name, R, Args...)(Args args) {
return mixin((*iface). ~ name)(iface, args);
}
SomeT ** iface;
}
But then val.foo(1, 2) gives me no property 'foo' for type 'S'.
I've seen the template solution:
struct S {
Actyaly, last variant didn't work either: i was testing it
inside S like ifc.foo(1), so UFCS kiked in, not alias this.
On Saturday, 21 June 2014 at 18:14:15 UTC, bearophile wrote:
Paul:
IS there such method get(key, default) for associative arrays,
like in Python?
Try it.
Bye,
bearophile
Wow! Thank you! It exists. Excuse my silly question :)
On Saturday, 21 June 2014 at 18:16:17 UTC, monnoroch wrote:
Actyaly, last variant didn't work either: i was testing it
inside S like ifc.foo(1), so UFCS kiked in, not alias this.
Oh, my bad, alias impl this; actually did work. But the first
argument problem still holds.
On Wednesday, 18 June 2014 at 19:24:03 UTC, Bienlein wrote:
Hello,
I'm looking for a way to do some kind of RPC in D. Some way of
being able to say aFoo.bar(int i, ...) with receiver object and
method being marshalled at the sender's site and being
unmarshalled and invoked at the receiver's
import std.stdio;
struct A {
this(this) {
writeln(A.this(this));
}
B b1, b2;
}
struct B {
this(this) {
writeln(B.this(this));
}
}
void main() {
A a, b;
a = b;
}
This outputs:
On 06/21/14 18:01, Philippe Sigaud via Digitalmars-d-learn wrote:
In what way is a template more reliable than the equivalent function?
mixin template Function(string name) {
mixin(public static int ~ name ~ () { return other.module. ~
name ~; });
}
struct S {
mixin
On 06/21/2014 11:56 AM, Marc Schütz schue...@gmx.net wrote:
import std.stdio;
struct A {
this(this) {
writeln(A.this(this));
}
B b1, b2;
}
struct B {
this(this) {
writeln(B.this(this));
}
You can use 'auto' to let the compiler deduce the return type. Here I
use 'foo' which returns an int and 'bar', which returns void.
struct SomeT {
int foo(double d) { return 0;}
void bar(double d) { return;}
}
struct S {
auto /* here */
opDispatch(string name, Args...)(Args
Apart from what Artur has mentioned template mixins also give you
opportunity to do qualified injection in case generated symbols
conflict with existing ones:
class A
{
void foo() {}
mixin(void foo() {}); // error, need to add manual
namespace wrapper
mixin func!foo Sub; // does
23 matches
Mail list logo