conjure-js 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cli/conjure-js.mjs +9336 -5028
- package/dist-vite-plugin/index.mjs +10455 -0
- package/package.json +9 -2
- package/src/bin/cli.ts +2 -2
- package/src/bin/nrepl-symbol.ts +150 -0
- package/src/bin/nrepl.ts +301 -157
- package/src/bin/version.ts +1 -1
- package/src/clojure/core.clj +764 -29
- package/src/clojure/core.clj.d.ts +76 -4
- package/src/clojure/demo/math.clj +5 -1
- package/src/clojure/generated/builtin-namespace-registry.ts +4 -0
- package/src/clojure/generated/clojure-core-source.ts +765 -29
- package/src/clojure/generated/clojure-set-source.ts +136 -0
- package/src/clojure/generated/clojure-walk-source.ts +72 -0
- package/src/clojure/set.clj +132 -0
- package/src/clojure/set.clj.d.ts +20 -0
- package/src/clojure/string.clj.d.ts +14 -0
- package/src/clojure/walk.clj +68 -0
- package/src/clojure/walk.clj.d.ts +7 -0
- package/src/core/assertions.ts +114 -6
- package/src/core/bootstrap.ts +337 -0
- package/src/core/conversions.ts +48 -31
- package/src/core/core-module.ts +303 -0
- package/src/core/env.ts +42 -7
- package/src/core/errors.ts +8 -0
- package/src/core/evaluator/apply.ts +40 -25
- package/src/core/evaluator/arity.ts +8 -8
- package/src/core/evaluator/async-evaluator.ts +565 -0
- package/src/core/evaluator/collections.ts +30 -4
- package/src/core/evaluator/destructure.ts +180 -69
- package/src/core/evaluator/dispatch.ts +24 -14
- package/src/core/evaluator/evaluate.ts +22 -20
- package/src/core/evaluator/expand.ts +45 -15
- package/src/core/evaluator/form-parsers.ts +178 -0
- package/src/core/evaluator/index.ts +7 -9
- package/src/core/evaluator/js-interop.ts +189 -0
- package/src/core/evaluator/quasiquote.ts +14 -8
- package/src/core/evaluator/recur-check.ts +6 -6
- package/src/core/evaluator/special-forms.ts +380 -173
- package/src/core/factories.ts +182 -3
- package/src/core/index.ts +55 -5
- package/src/core/module.ts +136 -0
- package/src/core/ns-forms.ts +107 -0
- package/src/core/positions.ts +9 -2
- package/src/core/printer.ts +371 -11
- package/src/core/reader.ts +127 -29
- package/src/core/registry.ts +209 -0
- package/src/core/runtime.ts +376 -0
- package/src/core/session.ts +263 -478
- package/src/core/stdlib/arithmetic.ts +516 -215
- package/src/core/stdlib/async-fns.ts +132 -0
- package/src/core/stdlib/atoms.ts +286 -63
- package/src/core/stdlib/errors.ts +54 -50
- package/src/core/stdlib/hof.ts +74 -173
- package/src/core/stdlib/js-namespace.ts +344 -0
- package/src/core/stdlib/lazy.ts +34 -0
- package/src/core/stdlib/maps-sets.ts +322 -0
- package/src/core/stdlib/meta.ts +109 -28
- package/src/core/stdlib/predicates.ts +322 -196
- package/src/core/stdlib/regex.ts +126 -98
- package/src/core/stdlib/seq.ts +564 -0
- package/src/core/stdlib/strings.ts +164 -135
- package/src/core/stdlib/transducers.ts +95 -100
- package/src/core/stdlib/utils.ts +283 -147
- package/src/core/stdlib/vars.ts +27 -27
- package/src/core/stdlib/vectors.ts +122 -0
- package/src/core/tokenizer.ts +13 -3
- package/src/core/transformations.ts +117 -9
- package/src/core/types.ts +118 -6
- package/src/host/node-host-module.ts +74 -0
- package/src/nrepl/relay.ts +432 -0
- package/src/vite-plugin-clj/codegen.ts +87 -95
- package/src/vite-plugin-clj/index.ts +242 -18
- package/src/vite-plugin-clj/namespace-utils.ts +39 -0
- package/src/vite-plugin-clj/static-analysis.ts +211 -0
- package/src/clojure/demo.clj +0 -63
- package/src/clojure/demo.clj.d.ts +0 -0
- package/src/core/core-env.ts +0 -60
- package/src/core/stdlib/collections.ts +0 -784
- package/src/host/node.ts +0 -55
package/src/core/core-env.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { define, makeEnv } from './env'
|
|
2
|
-
import { cljNativeFunction, cljNil } from './factories'
|
|
3
|
-
import { arithmeticFunctions } from './stdlib/arithmetic'
|
|
4
|
-
import { atomFunctions } from './stdlib/atoms'
|
|
5
|
-
import { collectionFunctions } from './stdlib/collections'
|
|
6
|
-
import { errorFunctions } from './stdlib/errors'
|
|
7
|
-
import { hofFunctions } from './stdlib/hof'
|
|
8
|
-
import { metaFunctions } from './stdlib/meta'
|
|
9
|
-
import { predicateFunctions } from './stdlib/predicates'
|
|
10
|
-
import { regexFunctions } from './stdlib/regex'
|
|
11
|
-
import { stringFunctions } from './stdlib/strings'
|
|
12
|
-
import { transducerFunctions } from './stdlib/transducers'
|
|
13
|
-
import { utilFunctions } from './stdlib/utils'
|
|
14
|
-
import { varFunctions } from './stdlib/vars'
|
|
15
|
-
import { valueToString } from './transformations'
|
|
16
|
-
import { type CljValue, type Env } from './types'
|
|
17
|
-
|
|
18
|
-
const nativeFunctions = {
|
|
19
|
-
...arithmeticFunctions,
|
|
20
|
-
...atomFunctions,
|
|
21
|
-
...collectionFunctions,
|
|
22
|
-
...errorFunctions,
|
|
23
|
-
...predicateFunctions,
|
|
24
|
-
...hofFunctions,
|
|
25
|
-
...metaFunctions,
|
|
26
|
-
...transducerFunctions,
|
|
27
|
-
...regexFunctions,
|
|
28
|
-
...stringFunctions,
|
|
29
|
-
...utilFunctions,
|
|
30
|
-
...varFunctions,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function loadCoreFunctions(env: Env, output?: (text: string) => void) {
|
|
34
|
-
for (const [key, value] of Object.entries(nativeFunctions)) {
|
|
35
|
-
define(key, value, env)
|
|
36
|
-
}
|
|
37
|
-
const emit = output ?? ((text: string) => console.log(text))
|
|
38
|
-
define(
|
|
39
|
-
'println',
|
|
40
|
-
cljNativeFunction('println', (...args: CljValue[]) => {
|
|
41
|
-
emit(args.map(valueToString).join(' '))
|
|
42
|
-
return cljNil()
|
|
43
|
-
}),
|
|
44
|
-
env
|
|
45
|
-
)
|
|
46
|
-
define(
|
|
47
|
-
'print',
|
|
48
|
-
cljNativeFunction('print', (...args: CljValue[]) => {
|
|
49
|
-
emit(args.map(valueToString).join(' '))
|
|
50
|
-
return cljNil()
|
|
51
|
-
}),
|
|
52
|
-
env
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function makeCoreEnv(output?: (text: string) => void): Env {
|
|
57
|
-
const env = makeEnv()
|
|
58
|
-
loadCoreFunctions(env, output)
|
|
59
|
-
return env
|
|
60
|
-
}
|