-
-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples: lang: Test that each of the mcl examples compiles
We let these rot, so fixup the issues and test them!
- Loading branch information
1 parent
6de7d8b
commit d0ed004
Showing
9 changed files
with
34 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import "fmt" | ||
|
||
$add = func($x) { | ||
func add($x) { # if this was a lambda, type unification would fail! (not allowed) | ||
$x + $x | ||
} | ||
|
||
$num = 2 | ||
$out1 = $add($num) # 4 | ||
$out1 = add($num) # 4 | ||
|
||
print fmt.printf("%d + %d is %d", $num, $num, $out1) { # simple math | ||
print [fmt.printf("%d + %d is %d", $num, $num, $out1),] { # simple math | ||
Meta:autogroup => false, | ||
} | ||
|
||
$val = "hello" | ||
$out2 = $add($val) # hellohello | ||
$out2 = add($val) # hellohello | ||
|
||
print fmt.printf("%s + %s is %s", $val, $val, $out2) { # simple concat | ||
print [fmt.printf("%s + %s is %s", $val, $val, $out2),] { # simple concat | ||
Meta:autogroup => false, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters