about summary refs log blame commit diff stats
path: root/CONTRIBUTING.md
blob: 29ae33a17c7ef1a35cbaa683d62c37e69fe44307 (plain) (tree)
1
2
3
4
5
6
7
8
9



                        




                                                                                  
                                                                              


                                                                                     


                   
                  

          
# Contributing to Ranger

## Tips for bug reports

* Was this issue already reported?  Please do a quick search.
* Maybe the problem is solved in the current master branch already?
  Simply clone ranger with `git clone https://github.com/ranger/ranger` or
  download the git version via https://github.com/ranger/ranger/archive/master.zip
  and run `./ranger.py` directly to find out.
* You can obtain much better error messages with `ranger --debug`, please post
  those in bug reports rather than the usual, single-line error message. Also
  check the log by using the default map `W` or by running the command `display_log`.
* Send security-relevant bugs PGP-encrypted to hut@hut.pm, see `HACKING.md`.

## Tips on patching

* See `HACKING.md`

Thank you!
ommit/factorial.mu?h=main&id=b96af395b9af2ff9df94b3e82213171f30827c8d'>b96af395 ^
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
30
31
32
33

                                             
          
             
                         
                          


 
                                         
             
                  

                     

                               
            
   
                             

                                 
                                 
 
 


                         
                           
   
                         


            
# example program: compute the factorial of 5

def main [
  local-scope
  x:number <- factorial 5
  $print [result: ], x, [ 
]
]

def factorial n:number -> result:number [
  local-scope
  load-ingredients
  {
    # if n=0 return 1
    zero?:boolean <- equal n, 0
    break-unless zero?
    return 1
  }
  # return n * factorial(n-1)
  x:number <- subtract n, 1
  subresult:number <- factorial x
  result <- multiply subresult, n
]

# unit test
scenario factorial-test [
  run [
    1:number <- factorial 5
  ]
  memory-should-contain [
    1 <- 120
  ]
]