deelang/demo/buildup.dee

32 lines
592 B
Plaintext
Raw Permalink Normal View History

2021-11-25 11:31:47 -06:00
## Comments
apple <- 1 ## assignments
pear() ## function calls
pear(x, y) ## function calls with arguments
apple <- pear(x, y) + z ## compound assignments
foo <- -> bar() ## function definitions
foo <- ->
bar()
baz()
# functions with block statements
2024-11-16 13:44:04 -06:00
foo <- x -> y -> x * y + 7 ## Multiple argument functions
2021-11-25 11:31:47 -06:00
if test?()
do-something()
elif other-test?()
do-something-else()
else
a <- 4
## Block conditionals
if test?()
do-nothing()
else
if second-test?()
do-a-real-bad-thing()
## Nested blocks
2024-11-16 13:44:04 -06:00
i <- 1
loop until i > 10
print(i)
i <- 1
2024-11-18 21:45:10 -06:00
## Loops