Re: Java wildcards... in D

2016-01-18 Thread Ali Çehreli via Digitalmars-d-learn
On 01/18/2016 02:08 PM, Voitech wrote: > alias Element =Algebraic!(real,string); > > i will get: > > Cannot store a int in a VariantN!(16LU, real, string) Are you really storing a 'real' or a 'string'? (The default floating type in D is double, not real.) The following compiles and works as ex

Re: Java wildcards... in D

2016-01-18 Thread Voitech via Digitalmars-d-learn
On Monday, 18 January 2016 at 21:15:51 UTC, Chris Wright wrote: On Mon, 18 Jan 2016 19:19:22 +, Voitech wrote: Hi. I'm trying to parse an simple string expression to something like Element array. Each Element can have a value of unknown type, which will be further combined and calculated t

Re: Java wildcards... in D

2016-01-18 Thread Chris Wright via Digitalmars-d-learn
On Mon, 18 Jan 2016 19:19:22 +, Voitech wrote: > Hi. I'm trying to parse an simple string expression to something like > Element array. Each Element can have a value of unknown type, which will > be further combined and calculated to let say real/double/float value, > no mather. In Java, Elem

Java wildcards... in D

2016-01-18 Thread Voitech via Digitalmars-d-learn
Hi. I'm trying to parse an simple string expression to something like Element array. Each Element can have a value of unknown type, which will be further combined and calculated to let say real/double/float value, no mather. In Java i had something like generics and this could be implemented