about summary refs log tree commit diff stats
path: root/example1.mu
blob: 83995a1efa2fbf2938e7d0b29e59ff452f4cb414 (plain) (blame)
1
2
3
4
5
6
7
def main [
  local-scope
  a:num <- add 2, 2
  a <- multiply a, 3
  # uncomment the next line to see the output
# $print a
]
pre>
          
             
                                                      
                      
                                                         
                      
                                                                       

                      
def test a:num -> b:num [
  local-scope
  load-ingredients
  b <- add a, 1
]

def test a:num, b:num -> c:num [
  local-scope
  load-ingredients
  c <- add a, b
]

def main [
  local-scope
  a:num <- test 3  # selects single-ingredient version
  $print a, 10/newline
  b:num <- test 3, 4  # selects double-ingredient version
  $print b, 10/newline
  c:num <- test 3, 4, 5  # prefers double- to single-ingredient version
  $print c, 10/newline
]