about summary refs log tree commit diff stats
path: root/html/130emit.subx.html
Commit message (Expand)AuthorAgeFilesLines
* 7187Kartik Agaram2020-11-051-1/+1
* 7175Kartik Agaram2020-11-031-1/+1
* 7162Kartik Agaram2020-11-021-1/+1
* 6958Kartik Agaram2020-10-051-17/+17
* 6774Kartik Agaram2020-09-111-1/+1
* 6631Kartik Agaram2020-07-101-0/+513
;vc@akkartik.com> 2015-10-29 21:23:48 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-10-29 21:27:45 -0700 2323 - static dispatch!' href='/akkartik/mu/commit/static_dispatch.mu?h=hlt&id=39017bac428f554b84a15f4d6d7fa2a07eb7b16c'>39017bac ^
192d59d3 ^
39017bac ^
4a48bedc ^
39017bac ^


1ead3562 ^
39017bac ^
4a48bedc ^
39017bac ^
4a48bedc ^
39017bac ^
4a48bedc ^
39017bac ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29







                                                                       
                         
             
             


               
                                
             
             


               
          
             
                                                 
                      
                                                    
                      
                                                                  

                      
# Example program showing how multiple functions with the same name can
# coexist, and how we select between them.
#
# Expected output:
#   4
#   7
#   7

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

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

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