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
28
Examples/mzscheme/class/example.cxx
Normal file
28
Examples/mzscheme/class/example.cxx
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/* File : example.cxx */
|
||||
|
||||
#include "example.h"
|
||||
#define M_PI 3.14159265358979323846
|
||||
|
||||
/* Move the shape to a new location */
|
||||
void Shape::move(double dx, double dy) {
|
||||
x += dx;
|
||||
y += dy;
|
||||
}
|
||||
|
||||
int Shape::nshapes = 0;
|
||||
|
||||
double Circle::area() {
|
||||
return M_PI*radius*radius;
|
||||
}
|
||||
|
||||
double Circle::perimeter() {
|
||||
return 2*M_PI*radius;
|
||||
}
|
||||
|
||||
double Square::area() {
|
||||
return width*width;
|
||||
}
|
||||
|
||||
double Square::perimeter() {
|
||||
return 4*width;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue