On Sat, Sep 26, 2009 at 10:36 AM, Justin Johansson
proc...@adam-dott-com.au wrote:
I've got about 2 dozen types in the variant so the O(n) really hurts.
The variant thing seemed like a really cool idea at the time but now ...
Without something like suggested above or a computed goto on typeid
Justin Johansson wrote:
...
I've got about 2 dozen types in the variant so the O(n) really hurts.
The variant thing seemed like a really cool idea at the time but now ...
Without something like suggested above or a computed goto on typeid or
Andrei's visitator, it almost pushes me to
Sat, 26 Sep 2009 09:32:55 -0400, Justin Johansson thusly wrote:
I've had a good poke around the forums and couldn't find anything on
this so ...
What's the recommended method for dispatching code off the runtime type
of a variant variable (Phobos D2 std.variant)?
Does one use a bunch of
Justin Johansson wrote:
language_fan Wrote:
Sat, 26 Sep 2009 09:32:55 -0400, Justin Johansson thusly wrote:
I've had a good poke around the forums and couldn't find anything on
this so ...
What's the recommended method for dispatching code off the runtime type
of a variant variable (Phobos
I've had a good poke around the forums and couldn't find anything on this so ...
What's the recommended method for dispatching code off the runtime type of a
variant variable
(Phobos D2 std.variant)?
Does one use a bunch of
if ( var.peek!(type1)) { ... }
else if ( var.peek!(type2) { ... }
language_fan Wrote:
Sat, 26 Sep 2009 09:32:55 -0400, Justin Johansson thusly wrote:
I've had a good poke around the forums and couldn't find anything on
this so ...
What's the recommended method for dispatching code off the runtime type
of a variant variable (Phobos D2 std.variant)?
Justin Johansson wrote:
I've had a good poke around the forums and couldn't find anything on this so ...
What's the recommended method for dispatching code off the runtime type of a
variant variable
(Phobos D2 std.variant)?
Does one use a bunch of
if ( var.peek!(type1)) { ... }
else if (
Sat, 26 Sep 2009 12:25:23 -0400, Jeremie Pelletier thusly wrote:
Justin Johansson wrote:
language_fan Wrote:
Sat, 26 Sep 2009 09:32:55 -0400, Justin Johansson thusly wrote:
I've had a good poke around the forums and couldn't find anything on
this so ...
What's the recommended method for
Sat, 26 Sep 2009 18:28:52 +0200, Lutger thusly wrote:
a hash literal works like this, index with the typeid to get a function
ptr you can call:
Algebraic!(int, Foo) a;
a = 3;
[ typeid(int) : function { writeln(a is int); },
typeid(Foo) : function { writeln(a is Foo); }
] [a.type] ();
language_fan wrote:
Sat, 26 Sep 2009 12:25:23 -0400, Jeremie Pelletier thusly wrote:
Justin Johansson wrote:
language_fan Wrote:
Sat, 26 Sep 2009 09:32:55 -0400, Justin Johansson thusly wrote:
I've had a good poke around the forums and couldn't find anything on
this so ...
What's the
On Sat, Sep 26, 2009 at 4:18 PM, Jeremie Pelletier jerem...@gmail.com wrote:
type Event = Mouse | Key | Move;
This can be confusing, for example the first thing that comes to mind for me
is that Event is the bitwise OR result of 3 constants, not an enumerated
type.
Besides, how is it any
Jarrett Billingsley wrote:
On Sat, Sep 26, 2009 at 4:18 PM, Jeremie Pelletier jerem...@gmail.com wrote:
type Event = Mouse | Key | Move;
This can be confusing, for example the first thing that comes to mind for me
is that Event is the bitwise OR result of 3 constants, not an enumerated
type.
On Sat, Sep 26, 2009 at 4:50 PM, Jeremie Pelletier jerem...@gmail.com wrote:
Oh, that makes sense, but I don't see why you need language support for
that, a variant type should be able to get most of it using type tuples,
maybe just add support to switch on type tuples along with an opSwitch()
Sat, 26 Sep 2009 16:50:36 -0400, Jeremie Pelletier thusly wrote:
Jarrett Billingsley wrote:
On Sat, Sep 26, 2009 at 4:18 PM, Jeremie Pelletier jerem...@gmail.com
wrote:
type Event = Mouse | Key | Move;
This can be confusing, for example the first thing that comes to mind
for me is that
Exactly, this is what I mentioned previously. Isn't it ugly compared to
type Event = Mouse | Key | Move;
void dispatchEvent(Event event) {
match(event) {
Mouse m = m.squeek();
Key k = ...
...
}
}
What's with all the language proposals here? Why
Jarrett Billingsley Wrote:
On Sat, Sep 26, 2009 at 10:36 AM, Justin Johansson
proc...@adam-dott-com.au wrote:
I've got about 2 dozen types in the variant so the O(n) really hurts.
The variant thing seemed like a really cool idea at the time but now ...
Without something like suggested
Justin Johansson wrote:
At the end of the day, if I can get this thing to fly using D, it will,
at least to me, prove that D is a killer language.
One way or another you will, and if you have difficulties let us hear of
them. Practical experience with Algebraic and friends is very valuable.
Justin Johansson wrote:
I've had a good poke around the forums and couldn't find anything on this so ...
What's the recommended method for dispatching code off the runtime type of a
variant variable
(Phobos D2 std.variant)?
Does one use a bunch of
if ( var.peek!(type1)) { ... }
else if (
Sat, 26 Sep 2009 18:51:19 -0400, #ponce thusly wrote:
Exactly, this is what I mentioned previously. Isn't it ugly compared to
type Event = Mouse | Key | Move;
void dispatchEvent(Event event) {
match(event) {
Mouse m = m.squeek();
Key k = ...
...
}
}
Andrei Alexandrescu Wrote:
Justin Johansson wrote:
At the end of the day, if I can get this thing to fly using D, it will,
at least to me, prove that D is a killer language.
One way or another you will, and if you have difficulties let us hear of
them. Practical experience with
Christopher Wright Wrote:
Justin Johansson wrote:
I've had a good poke around the forums and couldn't find anything on this
so ...
What's the recommended method for dispatching code off the runtime type of
a variant variable
(Phobos D2 std.variant)?
Does one use a bunch of
Christopher Wright wrote:
Justin Johansson wrote:
I've had a good poke around the forums and couldn't find anything on
this so ...
What's the recommended method for dispatching code off the runtime
type of a variant variable
(Phobos D2 std.variant)?
Does one use a bunch of
if (
Christopher Wright wrote:
Justin Johansson wrote:
I've had a good poke around the forums and couldn't find anything on
this so ...
What's the recommended method for dispatching code off the runtime
type of a variant variable
(Phobos D2 std.variant)?
Does one use a bunch of
if (
On Sat, Sep 26, 2009 at 11:16 PM, Jeremie Pelletier jerem...@gmail.com wrote:
string switch actually walks the case strings and compares with the source
string until it finds a match, a binary search is much faster if you don't
care about the order of the tests.
FWIW the runtime does perform
Jarrett Billingsley wrote:
On Sat, Sep 26, 2009 at 11:16 PM, Jeremie Pelletier jerem...@gmail.com wrote:
string switch actually walks the case strings and compares with the source
string until it finds a match, a binary search is much faster if you don't
care about the order of the tests.
25 matches
Mail list logo