Add all the assignment code.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
58c6b1f81c
commit
cfe502c598
1277 changed files with 48709 additions and 1 deletions
20
hw6/hw5programs/compile_various_fields.oat
Normal file
20
hw6/hw5programs/compile_various_fields.oat
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
struct Test {
|
||||
int i;
|
||||
bool b;
|
||||
string s;
|
||||
int[] arr;
|
||||
Test? t;
|
||||
(int) -> int f
|
||||
}
|
||||
|
||||
int neg(int x) { return -x; }
|
||||
|
||||
int program(int argc, string[] argv) {
|
||||
var n = new Test {i=3; b=true; s="hello"; arr=new int[3]{j->0}; t=Test null; f=neg};
|
||||
print_string(n.s);
|
||||
if(n.b) {
|
||||
return n.f(n.i);
|
||||
} else {
|
||||
return n.i;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue