File: first-example-library.el

package info (click to toggle)
undercover-el 0.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 212 kB
  • sloc: lisp: 1,187; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 740 bytes parent folder | download | duplicates (4)
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
;;; first-exanple-library.el --- undercover.el: Library for test coverage tests -*- lexical-binding: t; -*-

;; Copyright (c) 2014 Sviridov Alexander

;; Author: Sviridov Alexander <sviridov.vmi@gmail.com>

;;; Commentary:

;; Library for test coverage tests.

;;; Code:

(defun distance (point-1 point-2)
  "Return distance between POINT-1 and POINT-2."
  (let ((x1 (car point-1))
        (x2 (car point-2))
        (y1 (cadr point-1))
        (y2 (cadr point-2)))
    (sqrt (+ (expt (- x1 x2) 2)
             (expt (- y1 y2) 2)))))

(defun fib (n)
  "Return N's Fibonacci number."
  (cond
    ((zerop n) 0)
    ((= n 1) 1)
    (t (+ (fib (- n 1)) (fib (- n 2))))))

(provide 'first-example-library)
;;; first-example-library.el ends here