Fix mzscheme static variable wrappers
$argnum needs to be expanded in the 'varin' typemap which shares code used by the 'in' typemap. Setting the static variable is also a function call (argnum=1). Added class examples - needs static variables to work Test newly working test cases with this fix
This commit is contained in:
parent
b21a28f26a
commit
20344093ef
8 changed files with 151 additions and 24 deletions
34
Examples/mzscheme/class/example.h
Normal file
34
Examples/mzscheme/class/example.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* File : example.h */
|
||||
|
||||
class Shape {
|
||||
public:
|
||||
Shape() {
|
||||
nshapes++;
|
||||
}
|
||||
virtual ~Shape() {
|
||||
nshapes--;
|
||||
}
|
||||
double x, y;
|
||||
void move(double dx, double dy);
|
||||
virtual double area() = 0;
|
||||
virtual double perimeter() = 0;
|
||||
static int nshapes;
|
||||
};
|
||||
|
||||
class Circle : public Shape {
|
||||
private:
|
||||
double radius;
|
||||
public:
|
||||
Circle(double r) : radius(r) { }
|
||||
virtual double area();
|
||||
virtual double perimeter();
|
||||
};
|
||||
|
||||
class Square : public Shape {
|
||||
private:
|
||||
double width;
|
||||
public:
|
||||
Square(double w) : width(w) { }
|
||||
virtual double area();
|
||||
virtual double perimeter();
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue