Avoiding abstract

Jarrett Billingsley kb3ctd2 at yahoo.com
Wed May 30 12:25:37 PDT 2007


"Oliver Ruebenkoenig" <oliver.ruebenkoenig at web.de> wrote in message 
news:f3khn7$hjf$1 at digitalmars.com...

> If i derive another class, say Integer i'd have to insert something like 
> abstract int val(); for the value of the Integer. Now, I do not want 
> specify an Integer for my Symbol and like wise i do not need a char []  in 
> my Integer. How can i do this? The only thing the expressions share is 
> their virtual head.
>
> the following code does NOT work but shows the problem - i hope ;-)

If you don't want int val() to have to be declared in every class, then only 
declare it in the classes that you need.  In your case, only declare it in 
Integer.

What on earth is .head() for anyway? 




More information about the Digitalmars-d-learn mailing list