Commit message (Expand) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | 3439 | Kartik K. Agaram | 2016-10-04 | 1 | -1/+16 | |
* | 3438 | Kartik K. Agaram | 2016-10-04 | 1 | -16/+3 | |
* | 3437 | Kartik K. Agaram | 2016-10-04 | 2 | -1/+1 | |
* | 3436 | Kartik K. Agaram | 2016-10-04 | 1 | -2/+5 | |
* | 3435 | Kartik K. Agaram | 2016-10-04 | 3 | -0/+9 | |
* | 3434 | Karti# example program: constructing functions out of order
#
# We construct a factorial function with separate base and recursive cases.
# Compare factorial.mu.
#
# This isn't a very tasteful example, just a basic demonstration of
# possibilities.
def factorial n:num -> result:num [
local-scope
load-inputs
<factorial-cases>
]
after <factorial-cases> [
# if n=0 return 1
return-unless n, 1
]
after <factorial-cases> [
# return n * factorial(n - 1)
{
break-unless n
x:num <- subtract n, 1
subresult:num <- factorial x
result <- multiply subresult, n
return result
}
]
def main [
1:num <- factorial 5
# trailing space3399 - Update network primitives. | Stephen Malina | 2016-09-18 | 2 | -19/+77 |
* | 3398 | Kartik K. Agaram | 2016-09-18 | 1 | -6/+11 | |
* | 3397 | Kartik K. Agaram | 2016-09-17 | 12 | -916/+916 | |
* | 3396 | Kartik K. Agaram | 2016-09-17 | 24 | -1663/+1663 | |
* | 3395 | Kartik K. Agaram | 2016-09-17 | 97 | -4600/+4668 | |
* | 3394 | Kartik K. Agaram | 2016-09-17 | 9 | -43/+49 | |
* | 3393 | Kartik K. Agaram | 2016-09-17 | 9 | -24/+22 | |
* | 3392 | Kartik K. Agaram | 2016-09-17 | 4 | -7/+36 | |
* | 3391 - type abbreviations everywhere | Kartik K. Agaram | 2016-09-17 | 24 | -3256/+3256 |