-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Kind of annoying having to always type out all parameters... It is not the seplin way.
Current: | T_Routine of char list * (var_mod * typ) list
Instead: | T_Routine of char list * (var_mod * typ option) list
Then when resolving types, only the defined types can be used.
If type resolution is succesful, missing parameter types can be filled out.
The goal is essentially that the following becomes valid:
intern iter :(_, (T)):= <T>(a: T[], f) {
for(i ::= 0; i < |a|; i +:= 1)
f(a[i]);
}
entry main ::= () {
iter("Hello world!", (c) { print c; });
}
The type of 'iter' should be valid, as both parameters have a type, 'a' from the routine expression and 'f' from the assignment.
The call to 'iter' should be valid, as 'T' can be infered to be 'char', and 'c' could then be given that type, before the anon routine is type checked.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels