fixed everything breaking i think
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
(* TEST: [-asc -tc] *)
|
||||
(* Type definitions *)
|
||||
|
||||
#include "std.alpha"
|
||||
(* mapping type *)
|
||||
type string2int: string -> integer
|
||||
|
||||
@ -9,9 +9,9 @@ type funArray: 1 -> string2int
|
||||
|
||||
(* record of functions *)
|
||||
type funRec: [ string2int: f; string2int: g ]
|
||||
|
||||
type int2int: integer -> integer
|
||||
(* function returning function *)
|
||||
type integer_2_string2int: integer -> string2int
|
||||
type integer_2_int2int: integer -> int2int
|
||||
|
||||
(* function returning function *)
|
||||
type string2int_2_integer: string2int -> integer
|
||||
@ -22,8 +22,8 @@ type iXiXc: [integer: a; integer: b; character: c]
|
||||
type iic2b: iXiXc -> Boolean
|
||||
|
||||
(* Function declarations using the above type definitions *)
|
||||
function a: string2int
|
||||
function b: integer_2_string2int
|
||||
function a: int2int
|
||||
function b: integer_2_int2int
|
||||
function c: string2int_2_integer
|
||||
|
||||
function d: iic2b
|
||||
@ -37,8 +37,8 @@ function entry: string2int
|
||||
|
||||
a(x) := {
|
||||
[string : s]
|
||||
s := x;
|
||||
|
||||
x:= printInteger(x);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ b(x) := {
|
||||
c(x) := {
|
||||
[string: s]
|
||||
s := "Hi!";
|
||||
return a(s);
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
||||
@ -59,11 +59,11 @@ c(x) := {
|
||||
entry is the first function called
|
||||
*)
|
||||
entry(arg) := {
|
||||
[integer: result; string2int: f; integer: temp]
|
||||
temp := a("Hello");
|
||||
[integer: result; int2int: f; integer: temp]
|
||||
temp := 7;
|
||||
f := b(temp);
|
||||
result := f("ahhh");
|
||||
result := c(f);
|
||||
result := f(temp);
|
||||
(*result := c(f);*)
|
||||
if (d(1,2,'c'))
|
||||
then {
|
||||
result := 0;
|
||||
@ -72,6 +72,6 @@ entry(arg) := {
|
||||
[ Boolean : b]
|
||||
result := entry("hello");
|
||||
}
|
||||
result := c(f);
|
||||
(*result := c(f);*)
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user