PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.5
Code Block Pro – Beautiful Syntax Highlighting v1.27.5
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / samples / rel.sample

rel.sample in Code Block Pro – Beautiful Syntax Highlighting 1.27.5, at build/shiki/samples/rel.sample

66 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 module person
2 def ssn = 123-45-6789
3 module name
4 def first = "John"
5 def middle = "Q"
6 def last = "Public"
7 end
8 module birth
9 def city = "Pittsburg"
10 def state = "PA"
11 def country = "USA"
12 def date = parse_date["2000-01-01", "Y-m-d"]
13 end
14 end
15
16 module mymodule
17 def R = {1; 2}
18 ic {count[R] = 2}
19 end
20
21 @inline
22 module my_stats[R]
23 def my_minmax = (min[R], max[R])
24 def my_mean = mean[R]
25 def my_median = median[R]
26 end
27
28 @inline
29 module BipartiteGraph[M, N]
30 def node = M; N
31 def edge = M, N
32 end
33
34 @inline
35 module CycleGraph[N]
36 def node = N
37 def edge(a in N, b in N) =
38 sort[N](x, a)
39 and sort[N](y, b)
40 and y = x%count[N] + 1
41 from x, y
42 end
43
44 @inline
45 module GraphProperties[G]
46 def outdegree[v in G:node] = count[v1 : G:edge(v, v1)] <++ 0
47 def indegree[v in G:node] = count[v1 : G:edge(v1, v)] <++ 0
48 def edge_count = count[G:edge] <++ 0
49 end
50
51 def cg = CompleteGraph[range[1 ,5, 1]]
52 def cg_props = GraphProperties[cg]
53
54 def bg = BipartiteGraph[{1; 2}, {3; 4; 5}]
55 def bg_props = GraphProperties[bg]
56
57 def cycleg = CycleGraph[{"a"; "b"; "c"; "d" ; "e"}]
58 def cycleg_props = GraphProperties[cycleg]
59
60 module output
61 def complete_edge_count = cg_props:edge_count
62 def bipartite_edge_count = bg_props:edge_count
63 def cycle_edge_count = cycleg_props:edge_count
64 end
65
66 # From https://docs.relational.ai/rel/concepts/modules/