Remove objects, add some other stuff so that I can make fizzbuzz run in node
This commit is contained in:
@@ -7,8 +7,8 @@ foo <- -> bar() ## function definitions
|
||||
foo <- ->
|
||||
bar()
|
||||
baz()
|
||||
## functions with block statements
|
||||
foo <- x -> y -> x * y + 7 ## Multiple argument functions
|
||||
# functions with block statements
|
||||
oo <- x -> y -> x * y + 7 ## Multiple argument functions
|
||||
if test?()
|
||||
do-something()
|
||||
elif other-test?()
|
||||
@@ -23,9 +23,3 @@ else
|
||||
if second-test?()
|
||||
do-a-real-bad-thing()
|
||||
## Nested blocks
|
||||
|
||||
obj <- {
|
||||
field <- "hello"
|
||||
method <- x -> x * 2
|
||||
}
|
||||
## Object creation
|
||||
|
||||
9
demo/real.dee
Normal file
9
demo/real.dee
Normal file
@@ -0,0 +1,9 @@
|
||||
## Obligatory
|
||||
fizzbuzz <- x ->
|
||||
if x % 15 = 0 print("fizzbuzz")
|
||||
elif x % 3 = 0 print("fizz")
|
||||
# elif x % 5 = 0 print("buzz")
|
||||
else print(x)
|
||||
if x < 100 fizzbuzz(x + 1) ## TODO add looping construct(s)
|
||||
|
||||
fizzbuzz(1)
|
||||
Reference in New Issue
Block a user