14. Type inference
(almost complete)
function foo(s) {
String.length(s);
}
function bar(x, y) {
foo(x) + y;
}
15. Type inference
(almost complete)
int function foo(string s) {
String.length(s);
}
int function bar(string x, int y) {
foo(x) + y;
}
16. element =
<div>
<span>{prompt({none})}</span>
<span>{expr}
</div>
<div>{Calc.compute(expr)}</div>;
Open and close tag mismatch
<span> vs </div>
17. case {some: 13}: #status = "Enter";
callback(get());
case {some: 37}: #status = "Left";
move({lef});
case {some: 38}: #status = "Up";
move({up});
case {some: 39}: #status = "Right";
move({right});
First type: { lef }
Second type:
{ left } or { right } or
{ rightmost } or
{ up } or { down }
18. previous = Dom.get_content(#precaret);
#precaret = String.sub(0,
String.lenght(previous) - 1,
previous);
#postcaret += String.get(String.length
(previous) - 1, previous);
No field ‘lenght’ found.
Most probable field:
length: string -> int
19. previous = Dom.get_content(#postcaret);
#postcaret = String.sub(1,
String.length(previous) - 1, previous);
#precaret =+ String.get(previous);
String.get is a string
function(int, string) but
application uses it
as function(string)
20.
21.
22. “Keep your eye on Opa, the
new open source language that
[...] may transform Web
development.” Neil McAllister
“Coding in Opa is super quick
and fun. I don’t think I could
have written things faster in any
other framework.” Alok Menghrajani