git @ Cat's Eye Technologies Argyle / master eg / factorial.argyle
master

Tree @master (Download .tar.gz)

factorial.argyle @masterraw · history · blame

(let (
    (fact-rec
      (lambda (self val)
        (let ((next-val (add val (neg 1))))
          (if-apply next-val
            (lambda (x) (mul val (self self next-val)))
            (lambda (x) 1))
        )
      )
    )
    (factorial
      (lambda (val)
        (fact-rec fact-rec val)))
  )
  (factorial 5))