Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from sailfish-lang/0.2.0.temp
0.2.0
- Loading branch information
Showing
126 changed files
with
3,073 additions
and
10,457 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Uat { | ||
[int] list | ||
int size | ||
} | ||
|
||
Ufn{ | ||
(fun printFoo_(int i)(void){ | ||
Tree( | ||
(| i != own.size | { | ||
printInt(getAtIndexInt(own.list, i)) | ||
++i | ||
own...printFoo_(i) | ||
}) | ||
) | ||
}) | ||
|
||
(fun printFoo(void)(void){ | ||
printStr("List Contents:") | ||
own...printFoo_(0) | ||
}) | ||
|
||
# rather inefficient because we malloc every time | ||
(fun push(int i)(void){ | ||
dec [int] is = [i] | ||
own.list = appendListInt(own.list, is, own.size, 1) | ||
++own.size | ||
}) | ||
|
||
(fun removeByIndex(int i)(void){ | ||
Tree ( | ||
( | own.size == 0 | { printStr("Sorry, list is empty!") }) | ||
( | true | { | ||
own.list = deleteAtIndexInt(own.list, own.size, i) | ||
--own.size | ||
}) | ||
) | ||
}) | ||
|
||
(fun setAtIndex(int i, int v)(void){ | ||
Tree ( | ||
( | (i > own.size) or (i < 0) | { printStr("Invalid index") } ) | ||
( | true | { own.list = setAtIndexInt(own.list, i, v) }) | ||
) | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,18 +1,6 @@ | ||
import Foo : "foo.fish" | ||
import intListHandler : "../examples/intListHandler.fish" | ||
|
||
Uat { | ||
int i | ||
flt f | ||
} | ||
|
||
Ufn { | ||
(fun main(int i)(int){ | ||
Tree ( | ||
(|1 + 2 == 11 - 12 | { | ||
dec int i = 10 | ||
a = 12 + (i - 10) | ||
return a | ||
}) | ||
) | ||
}) | ||
start { | ||
dec intListHandler i = new intListHandler { size: 100, list: []} | ||
dec [int] is = [] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.