Name: Anonymous 2008-09-23 22:37
This code does not compile.
Only the 1337est h4x0rz know the fix.
Only the 1337est h4x0rz know the fix.
class superclass
{
float _x, _y;
public:
void set(const float x, const float y)
{ _x = x; _y = y; }
};
class childclass : public superclass
{
public:
void set(int s) {}
};
int main()
{
childclass kid;
kid.set(1.f, 2.f);
return 0;
}
using superclass::set;
kid.superclass::set(1,2); or what >>4 posted, but then you already know that if you're posting the problem - unlike the fact that your anus has just been haxed.
class SuperClass a where
set :: a -> a -> ()
instance SuperClass (Float,Float) where
set (x,y) = () where _x = x; _y = y
class ChildClass (SuperClass a) where
set :: a -> ()
instance ChildClass Int where
set s = ()
main = do kid::ChildClass Int
set 1.0 2.0
return ()
class Superclass():
def __init__(self):
self._x = 0.0
self._y = 0.0
def set(x,y):
self._x = x
self._y = y
class Childclass(Superclass):
def update(x,y):
super(Childclass,self).set(x,y)
kid = Childclass()
kid.set(1.0,2.0)
class Superclass (object):
def __init__(self):
self.x = self.y = 0.
class Childclass (Superclass):
pass
kid = Childclass()
kid.x, kid.y = 1., 2.class Superclass
attr :x, :y
def initialize; @x = @y = 0; end
def set x,y; @x, @y = x, y; end
end
class Childclass < Superclass
def set x, y; end
end