about summary refs log tree commit diff stats
path: root/trace.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-23 19:54:44 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-23 19:54:44 -0700
commit732fd9b0ccaad2cad88ced9bd48f840350652b1e (patch)
tree0883b009246f6bd5d6f3b93b46a00a212f00709b /trace.mu
parent80ab9211b962343321c0e21ff385a9a3594f52dd (diff)
downloadmu-732fd9b0ccaad2cad88ced9bd48f840350652b1e.tar.gz
1150
Diffstat (limited to 'trace.mu')
0 files changed, 0 insertions, 0 deletions
akkartik.com> 2016-09-17 00:43:20 -0700 3380' href='/akkartik/mu/commit/static_dispatch.mu?h=main&id=192d59d3bb9ee0baa1afd82cb5d0f352bdc6e403'>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
]