File: clojure.clj

package info (click to toggle)
kf6-syntax-highlighting 6.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 47,568 kB
  • sloc: xml: 197,750; cpp: 12,850; python: 3,023; sh: 955; perl: 546; ruby: 488; pascal: 393; javascript: 161; php: 150; jsp: 132; lisp: 131; haskell: 124; ada: 119; ansic: 107; makefile: 96; f90: 94; ml: 85; cobol: 81; yacc: 71; csh: 62; erlang: 54; sql: 51; java: 47; objc: 37; awk: 31; asm: 30; tcl: 29; fortran: 18; cs: 10
file content (73 lines) | stat: -rw-r--r-- 1,699 bytes parent folder | download | duplicates (10)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
; Test file, released under MIT License
(ns ^{:doc "Syntax highlighting test file"
      :author "Markus Brenneis"}
    highlighting)

(defn something-else [f xs]
  #_(map #(apply f (% [%])) (cons 1 xs))
  (map #(apply f (% xs)) (cons 1 xs))
  #_[1 '(2)]
  xs)

(def foo [\a \b \n \ucafe \o123 \n
          \newline \tab \space \formfeed \backspace])

(def fizz {#{\a \b}
           #{\n \newline}})

(def fizz' #{{\a \b}
             {\n \newline}})

(defn bar [xs]
  (as-> xs <>
        (cons :a <>)
        (map #(%1 %2) <>) ; TODO improve
        (into <> [:konjure.logic.specs/numShips])))

(def x-2-y
  #_"do \" sth"
  (domonad set-m
    [x #{1.1, (+ -2 +4)}
     y #{1.1, (- -2.0 4.0)}]
    (*' x y)))

(def bases
  (and (= -1 -1N)
       (= 1/4 -2.5e-1)
       (= -1/2 -0.5M)
       (= -0x1Ab -0X1ab)
       (= +2r101010 25R1h)
       (= 39r13 42R10))) ; FIXME this one is not correct

(def ^{:private true}
  (= (last #{#{}}) #{{#{}}}))

(def s "#repl\n")
(def r #"repl")

(defn- stuff!
  [a]
  "This is no \"documentation\"!"
  (= (class #'+) (class #'foo))
  (let [+ -] [(+ a 1) (@#'+ a 1)]))

(defn- throwIllegalArgumentException!
  "Throws an \"IllegalArgumentException\" or
  a js/Error."
  [message]
  #?(:clj  (throw (IllegalArgumentException. message))
     :cljs (throw (js/Error. message))))

(defmacro let-fn "a nonsense macro" [one-binding & body]
  `(+ 1 ~(inc' 1))
  (let [[identifier & fn-body] one-binding]
    `(let [~identifier (fn ~identifier ~@fn-body)]
      ~@body `a#)))

(def state (atom [(= false true) nil]))

(defn something-cool [] (first @state))

(defn- something-different [] (first (into @state [12])))

(defn- instance-getfield [this k] (@(.state this) k))