Andrei Alexandrescu:
I do agree tagged unions should be pushed into the language;
they'd help the GC.
A more general solution is to add a onGC() optional method that
gets called by the GC on collections, and tells it what's inside
the union.
Bye,
bearophile
On 08/01/2014 03:26 AM, Andrei Alexandrescu wrote:
On 7/31/14, 5:35 PM, Timon Gehr wrote:
On 07/31/2014 06:23 PM, Andrei Alexandrescu wrote:
On 7/31/14, 6:03 AM, w0rp wrote:
On Thursday, 31 July 2014 at 11:42:21 UTC, Remo wrote:
http://tech.esper.com/2014/07/30/algebraic-data-types/
D
On 8/1/14, 7:18 AM, Timon Gehr wrote:
It might also be possible that this is what is actually wanted:
alias Foo = Algebraic!(int,Algebraic!(This[],double)[]);
(I.e. This refers to the inner type.)
There is always this issue as well:
alias ListInt=Algebraic!(Tuple!(),Tuple!(int,ListInt*));
On 08/01/2014 05:28 PM, Andrei Alexandrescu wrote:
On 8/1/14, 7:18 AM, Timon Gehr wrote:
It might also be possible that this is what is actually wanted:
alias Foo = Algebraic!(int,Algebraic!(This[],double)[]);
(I.e. This refers to the inner type.)
There is always this issue as well:
alias
http://tech.esper.com/2014/07/30/algebraic-data-types/
D already has product type it is struct.
But D lacks sum type also called tagged-union.
Do you think it would be possible to add something like this to
D2 ?
On Thursday, 31 July 2014 at 11:42:21 UTC, Remo wrote:
http://tech.esper.com/2014/07/30/algebraic-data-types/
D already has product type it is struct.
But D lacks sum type also called tagged-union.
Do you think it would be possible to add something like this to
D2 ?
There is a library
On Thursday, 31 July 2014 at 11:42:21 UTC, Remo wrote:
http://tech.esper.com/2014/07/30/algebraic-data-types/
D already has product type it is struct.
But D lacks sum type also called tagged-union.
Do you think it would be possible to add something like this to
D2 ?
I think you're looking
Am 31.07.2014 13:42, schrieb Remo:
http://tech.esper.com/2014/07/30/algebraic-data-types/
D already has product type it is struct.
But D lacks sum type also called tagged-union.
Do you think it would be possible to add something like this to D2 ?
I'm currently in the process of polishing one
On Thu, 31 Jul 2014 11:42:20 +, Remo wrote:
http://tech.esper.com/2014/07/30/algebraic-data-types/
D already has product type it is struct.
But D lacks sum type also called tagged-union.
Do you think it would be possible to add something like this to D2 ?
In addition
Justin Whear:
In addition to the suggestions of Algebraic or Variant
elsewhere in this
thread, it's trivial to implement your own concrete tagged
unions:
struct MyTaggedUnion
{
enum Type { Int, Float, String }
Type tag;
union {
int int_;
float float_;
string
On 7/31/14, 6:03 AM, w0rp wrote:
On Thursday, 31 July 2014 at 11:42:21 UTC, Remo wrote:
http://tech.esper.com/2014/07/30/algebraic-data-types/
D already has product type it is struct.
But D lacks sum type also called tagged-union.
Do you think it would be possible to add something like
On Thursday, 31 July 2014 at 15:03:09 UTC, Justin Whear wrote:
On Thu, 31 Jul 2014 11:42:20 +, Remo wrote:
http://tech.esper.com/2014/07/30/algebraic-data-types/
D already has product type it is struct.
But D lacks sum type also called tagged-union.
Do you think it would be possible
On Thursday, 31 July 2014 at 20:28:55 UTC, Remo wrote:
How to translate this useless Rust code to D, with as least D
code as possible ?
How be sure that everything will still work as expected if
programmer will add White color ?
enum Color {
Red,
Green,
Blue,
On 07/31/2014 06:23 PM, Andrei Alexandrescu wrote:
On 7/31/14, 6:03 AM, w0rp wrote:
On Thursday, 31 July 2014 at 11:42:21 UTC, Remo wrote:
http://tech.esper.com/2014/07/30/algebraic-data-types/
D already has product type it is struct.
But D lacks sum type also called tagged-union.
Do you
On 7/31/14, 5:35 PM, Timon Gehr wrote:
On 07/31/2014 06:23 PM, Andrei Alexandrescu wrote:
On 7/31/14, 6:03 AM, w0rp wrote:
On Thursday, 31 July 2014 at 11:42:21 UTC, Remo wrote:
http://tech.esper.com/2014/07/30/algebraic-data-types/
D already has product type it is struct.
But D lacks sum
15 matches
Mail list logo