Remove objects, add some other stuff so that I can make fizzbuzz run in node

This commit is contained in:
2024-11-13 20:40:40 -06:00
parent 8259b57a46
commit 26bff70b1f
5 changed files with 95 additions and 23 deletions

View File

@@ -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
View 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)