CS143-Lab/assignments/PA4/good.cl
2023-03-27 14:54:06 +08:00

26 lines
341 B
Common Lisp

class C {
a : Int;
b : Bool;
init(x : Int, y : Bool) : SELF_TYPE {
{
a <- x;
b <- y;
self;
}
};
};
Class Main {
good() : Bool { true };
self_method() : SELF_TYPE { self };
main():C {
{
new SELF_TYPE.good();
(new C).init(1,true);
isvoid true;
isvoid false;
isvoid x;
}
};
};