Skip to content

Commit 260c3a9

Browse files
authored
feat(language): add Clojure programming language support (@Ryrden) (monkeytypegame#7012)
### Description This PR adds support for the Clojure programming language to Monkeytype, providing developers with a comprehensive set of essential Clojure keywords and constructs for typing practice. **Changes made:** - Add `code_clojure` to language schema (`packages/schemas/src/languages.ts`) - Add `code_clojure` to frontend constants in the `code` language group (`frontend/src/ts/constants/languages.ts`) - Create `code_clojure.json` with 212 essential Clojure keywords and functions - Includes core language constructs (def, defn, let, fn), control flow (if, when, cond), data manipulation (map, filter, reduce), concurrency primitives (atom, ref, agent), and utility functions ### Checks - [ ] Adding quotes? - [ ] Make sure to include translations for the quotes in the description (or another comment) so we can verify their content. - [x] Adding a language? - Make sure to follow the [languages documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LANGUAGES.md) - [x] Add language to `packages/schemas/src/languages.ts` - [x] Add language to exactly one group in `frontend/src/ts/constants/languages.ts` - [x] Add language json file to `frontend/static/languages` - [ ] Adding a theme? - Make sure to follow the [themes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/THEMES.md) - [ ] Add theme to `packages/schemas/src/themes.ts` - [ ] Add theme to `frontend/src/ts/constants/themes.ts` - [ ] Add theme css file to `frontend/static/themes` - [ ] Add some screenshot of the theme, especially with different test settings (colorful, flip colors) to your pull request - [ ] Adding a layout? - [ ] Make sure to follow the [layouts documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LAYOUTS.md) - [ ] Add layout to `packages/schemas/src/layouts.ts` - [ ] Add layout json file to `frontend/static/layouts` - [ ] Adding a font? - Make sure to follow the [themes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/FONTS.md) - [ ] Add font file to `frontend/static/webfonts` - [ ] Add font to `packages/schemas/src/fonts.ts` - [ ] Add font to `frontend/src/ts/constants/fonts.ts` - [x] Check if any open issues are related to this PR; if so, be sure to tag them below. - [x] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info) - [x] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title. <!-- No related issues found --> Note: Please, is it possible to add the label `hacktoberfest-accepted` to this PR?
1 parent 4e5ba24 commit 260c3a9

File tree

3 files changed

+220
-0
lines changed

3 files changed

+220
-0
lines changed

frontend/src/ts/constants/languages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ export const LanguageGroups: Record<string, Language[]> = {
351351
"code_ook",
352352
"code_typescript",
353353
"code_cobol",
354+
"code_clojure",
354355
"code_common_lisp",
355356
"code_ocaml",
356357
"code_odin",
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
{
2+
"name": "code_clojure",
3+
"noLazyMode": true,
4+
"words": [
5+
"def",
6+
"defn",
7+
"defmacro",
8+
"defonce",
9+
"defn-",
10+
"defmulti",
11+
"defmethod",
12+
"defprotocol",
13+
"defrecord",
14+
"defstruct",
15+
"deftype",
16+
"fn",
17+
"let",
18+
"loop",
19+
"recur",
20+
"if",
21+
"when",
22+
"when-not",
23+
"cond",
24+
"case",
25+
"condp",
26+
"do",
27+
"and",
28+
"or",
29+
"not",
30+
"nil",
31+
"true",
32+
"false",
33+
"ns",
34+
"require",
35+
"import",
36+
"use",
37+
"refer",
38+
"map",
39+
"filter",
40+
"reduce",
41+
"apply",
42+
"comp",
43+
"partial",
44+
"constantly",
45+
"identity",
46+
"first",
47+
"rest",
48+
"last",
49+
"butlast",
50+
"next",
51+
"take",
52+
"drop",
53+
"take-while",
54+
"drop-while",
55+
"conj",
56+
"cons",
57+
"concat",
58+
"reverse",
59+
"sort",
60+
"sort-by",
61+
"count",
62+
"empty?",
63+
"seq",
64+
"vec",
65+
"list",
66+
"set",
67+
"hash-map",
68+
"hash-set",
69+
"assoc",
70+
"dissoc",
71+
"get",
72+
"get-in",
73+
"assoc-in",
74+
"update-in",
75+
"merge",
76+
"keys",
77+
"vals",
78+
"contains?",
79+
"find",
80+
"select-keys",
81+
"zipmap",
82+
"into",
83+
"group-by",
84+
"frequencies",
85+
"distinct",
86+
"remove",
87+
"keep",
88+
"keep-indexed",
89+
"map-indexed",
90+
"doall",
91+
"dorun",
92+
"doseq",
93+
"dotimes",
94+
"for",
95+
"while",
96+
"repeatedly",
97+
"iterate",
98+
"cycle",
99+
"range",
100+
"repeat",
101+
"lazy-seq",
102+
"try",
103+
"catch",
104+
"finally",
105+
"throw",
106+
"str",
107+
"pr-str",
108+
"print",
109+
"println",
110+
"prn",
111+
"with-open",
112+
"slurp",
113+
"spit",
114+
"read-string",
115+
"atom",
116+
"ref",
117+
"agent",
118+
"var",
119+
"deref",
120+
"swap!",
121+
"reset!",
122+
"alter",
123+
"commute",
124+
"send",
125+
"send-off",
126+
"future",
127+
"promise",
128+
"deliver",
129+
"delay",
130+
"force",
131+
"pmap",
132+
"pcalls",
133+
"pvalues",
134+
"binding",
135+
"with-redefs",
136+
"with-meta",
137+
"meta",
138+
"vary-meta",
139+
"with-out-str",
140+
"with-in-str",
141+
"re-find",
142+
"re-matches",
143+
"re-seq",
144+
"re-pattern",
145+
"subs",
146+
"format",
147+
"join",
148+
"split",
149+
"split-lines",
150+
"trim",
151+
"triml",
152+
"trimr",
153+
"replace",
154+
"upper-case",
155+
"lower-case",
156+
"capitalize",
157+
"inc",
158+
"dec",
159+
"max",
160+
"min",
161+
"abs",
162+
"mod",
163+
"rem",
164+
"quot",
165+
"even?",
166+
"odd?",
167+
"zero?",
168+
"pos?",
169+
"neg?",
170+
"number?",
171+
"integer?",
172+
"float?",
173+
"rational?",
174+
"decimal?",
175+
"string?",
176+
"keyword?",
177+
"symbol?",
178+
"map?",
179+
"vector?",
180+
"list?",
181+
"set?",
182+
"coll?",
183+
"sequential?",
184+
"associative?",
185+
"sorted?",
186+
"counted?",
187+
"reversible?",
188+
"indexed?",
189+
"seqable?",
190+
"fn?",
191+
"ifn?",
192+
"class",
193+
"type",
194+
"instance?",
195+
"isa?",
196+
"cast",
197+
"satisfies?",
198+
"extends?",
199+
"supers",
200+
"bases",
201+
"class?",
202+
"resolve",
203+
"requiring-resolve",
204+
"find-var",
205+
"var-get",
206+
"var-set",
207+
"bound?",
208+
"thread-bound?",
209+
"make-array",
210+
"object-array",
211+
"aclone",
212+
"aget",
213+
"aset",
214+
"alength",
215+
"amap",
216+
"areduce"
217+
]
218+
}

packages/schemas/src/languages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ export const LanguageSchema = z.enum(
416416
"tibetan",
417417
"tibetan_1k",
418418
"code_cobol",
419+
"code_clojure",
419420
"code_common_lisp",
420421
"docker_file",
421422
"code_fortran",

0 commit comments

Comments
 (0)