File: prism-j.html

package info (click to toggle)
node-prismjs 1.30.0%2Bdfsg%2B~1.26.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,220 kB
  • sloc: javascript: 27,628; makefile: 9; sh: 7; awk: 4
file content (59 lines) | stat: -rw-r--r-- 1,285 bytes parent folder | download | duplicates (3)
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
48
49
50
51
52
53
54
55
56
57
58
59
<h2>Comments</h2>
<pre><code>NB. This is a comment</code></pre>

<h2>Strings</h2>
<pre><code>'This is a string.'
'This is a string with ''quotes'' in it.'</code></pre>

<h2>Numbers</h2>
<pre><code>2.3e2 2.3e_2 2j3
2p1 1p_1
1x2 2x1 1x_1
2e2j_2e2 2e2j2p1 2ad45 2ar0.785398
16b1f 10b23 _10b23 1e2b23 2b111.111</code></pre>

<h2>Verbs</h2>
<pre><code>%4
3%4
,b
'I';'was';'here'
3 5$'wake read lamp '</code></pre>

<h2>Adverbs</h2>
<pre><code>1 2 3 */ 4 5 6 7
'%*'(1 3;2 _1)} y</code></pre>

<h2>Conjunctions</h2>
<pre><code>10&^. 2 3 10 100 200
+`*
+:@*: +/ -:@%:</code></pre>

<h2>Examples</h2>
<pre><code>NB. The following functions E1, E2 and E3
NB. interchange two rows of a matrix,
NB. multiply a row by a constant,
NB. and add a multiple of one row to another:

E1=: &lt;@] C. [
E2=: f`g`[}
E3=: F`g`[}
f=: {:@] * {.@] { [
F=: [: +/ (1:,{:@]) * (}:@] { [)
g=: {.@]
M=: i. 4 5
M;(M E1 1 3);(M E2 1 10);(M E3 1 3 10)</code></pre>

<pre><code>NB. Implementation of quicksort

sel=: adverb def 'u # ['

quicksort=: verb define
  if. 1 >: #y do. y
  else.
    (quicksort y &lt;sel e),(y =sel e),quicksort y >sel e=.y{~?#y
  end.
)</code></pre>

<pre><code>NB. Implementation of quicksort (tacit programming)

quicksort=: (($:@(&lt;#[), (=#[), $:@(>#[)) ({~ ?@#)) ^: (1&lt;#)</code></pre>