Hash :
68f60007
Author :
Date :
2014-12-23T20:48:51
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
<h1>Scheme</h1>
<p>To use this language, use the class "language-scheme".</p>
<h2>Comments</h2>
<pre><code>; This is a comment</code></pre>
<h2>Booleans</h2>
<pre><code>#t
#f</code></pre>
<h2>Strings</h2>
<pre><code>"two \"quotes\" within"</code></pre>
<h2>Functions</h2>
<pre><code>(lambda (x) (+ x 3))
(apply vector 'a 'b '(c d e))
</code></pre>
<h2>Full example</h2>
<pre><code>;; Calculation of Hofstadter's male and female sequences as a list of pairs
(define (hofstadter-male-female n)
(letrec ((female (lambda (n)
(if (= n 0)
1
(- n (male (female (- n 1)))))))
(male (lambda (n)
(if (= n 0)
0
(- n (female (male (- n 1))))))))
(let loop ((i 0))
(if (> i n)
'()
(cons (cons (female i)
(male i))
(loop (+ i 1)))))))
(hofstadter-male-female 8)</code></pre>
<h2>Known failures</h2>
<p>There are certain edge cases where Prism will fail.
There are always such cases in every regex-based syntax highlighter.
However, Prism dares to be open and honest about them.
If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.
</p>
<h3>Comment-like substrings</h3>
<pre><code>"foo ; bar"</code></pre>