mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 21:21:33 +00:00
language: implement proper virtual machine support
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
/* fibonacci sequence */
|
||||
func fib(n) {
|
||||
return if n < 2 {
|
||||
n
|
||||
if n < 2 {
|
||||
return n
|
||||
} else {
|
||||
fib(n - 1) + fib(n - 2)
|
||||
return fib(n - 1) + fib(n - 2)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
let items = ["Hello", "Goodbye"]
|
||||
|
||||
export func main() {
|
||||
let items = ["Hello", "Goodbye"]
|
||||
for item in items {
|
||||
println(item)
|
||||
}
|
||||
|
6
examples/list.pork
Normal file
6
examples/list.pork
Normal file
@ -0,0 +1,6 @@
|
||||
export func main() {
|
||||
let items = listInitWith(30, 0)
|
||||
for item in items {
|
||||
println(item)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user