Re: Call for Opinions

new topic     » goto parent     » topic index » view thread      » older message » newer message

Pete Lomax wrote:
> Not to put too fine a point on it, I consider that horrid !!
> 
> Presumably, struct must be of type MyStruct anyway for the above to
> work? So, please, what is wrong with:
> 
> 	struct = New(0, "Hello World" )
> 	struct = SomeMethod()
> 
> Obviously, if struct is not of type MyStruct, then you need the
> "MyStruct." qualifier to identify the class, but given that it is, you
> can leave it (and that "this" thing) out?

Problem is Pete, yes, struct in that example is declared as MyStruct.  HOWEVER,
what about type-casting?

Example of Type Casting:
euclass MyClassA(sequence a)
    integer b, c, d
    function new()
        return repeat(0,3)
    end function
end euclass

euclass MyClassB(sequence b)
    integer a, d, e, f
    function new()
        return repeat(0,4)
    end function
end euclass

MyClassA MyNewVar

if platform() = 3 then
   MyNewVar = MyClassB.new({})
else
   MyNewVar = MyClassA.new({})
end if


If we went the way you suggest, then this would become obsolete, as sub-classing
couldn't be controled.  And we're back to having the same problem as we do now
with Regular Euphoria, as unable to dynamically include diffrent files, based on
platform, only in a Object refrence.

Mario Steele
http://enchantedblade.trilake.net
Attaining World Dominiation, one byte at a time...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu