-
Notifications
You must be signed in to change notification settings - Fork 1
/
benchmark.scss
47 lines (40 loc) · 934 Bytes
/
benchmark.scss
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (C) 2016 Colin Fulton
// All rights reserved.
//
// This software may be modified and distributed under the
// terms of the three-clause BSD license. See LICENSE.txt
///////////////
// Pure SASS //
///////////////
@function sass_fib($value) {
@if $value < 2 {
@return $value;
} @else {
@return sass_fib($value - 1) + sass_fib($value - 2);
}
}
Pure SASS {
Assert: sass_fib(14);
Expect: 377;
}
////////////////
// Sassy Lisp //
////////////////
@import 'sassy_lisp';
Sassy Lisp {
Assert: function_eval(
(global lisp_fib (lambda (value) (
(cond
((less_than value 2) (identity value))
(else
(add
(lisp_fib (subtract value 1))
(lisp_fib (subtract value 2))
)
)
)
)))
(lisp_fib 14)
);
Expect: 377;
}