Skip to content

Commit 3cae34f

Browse files
shantanu-sardesaijianlingzhong
authored andcommitted
Port double (jank-lang#583)
* Port `double` * Run the `double?` Clojure test suite test * Disable `double` test case Blocked by jank-lang/clojure-test-suite#790 (comment). * Repoint Clojure test suite
1 parent 6a83037 commit 3cae34f

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

compiler+runtime/src/jank/clojure/core.jank

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5352,8 +5352,7 @@
53525352
(defn double
53535353
"Coerce to double"
53545354
[#_Number x]
5355-
;; (clojure.lang.RT/doubleCast x)
5356-
(throw "TODO: port double"))
5355+
(cpp/jank.runtime.to_real x))
53575356

53585357
(defn short
53595358
"Coerce to short"

compiler+runtime/test/bash/clojure-test-suite/src/jank_test/run_clojure_test_suite.cljc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,30 @@
2323
;clojure.core-test.bit-shift-right ; invalid object type: 0
2424
;clojure.core-test.bit-test ; Uncaught exception: invalid object type: 0
2525
;clojure.core-test.bit-xor ; Uncaught exception: invalid object type: 0
26-
;clojure.core-test.boolean ; TODO: port double, Expecting whitespace after the last token. due to M.
26+
clojure.core-test.boolean
2727
;clojure.core-test.bound-fn ; TODO: port future
2828
;clojure.core-test.bound-fn-star ; TODO: port future
2929
clojure.core-test.butlast
3030
;clojure.core-test.byte ; TODO: port byte, Expecting whitespace after the last token. due to M.
3131
;clojure.core-test.char ; TODO: port char
32-
;clojure.core-test.char-qmark ; TODO: port double, Read error (405 - 423): number out of rangeExpecting whitespace after the last token. due to M.
32+
clojure.core-test.char-qmark
3333
;clojure.core-test.compare ; Uncaught exception: not comparable: []
3434
clojure.core-test.conj
3535
;clojure.core-test.count ;https://github.com/jank-lang/jank/issues/244
3636
;clojure.core-test.dec ; TODO underflow \n Uncaught exception: failed
3737
clojure.core-test.decimal-qmark
3838
;clojure.core-test.denominator ; Failed a test. Expecting whitespace after the last token. due to M.
39-
;clojure.core-test.double ; TODO: port double, Expecting whitespace after the last token. due to M.
40-
;clojure.core-test.double-qmark ; TODO: port double, Expecting whitespace after the last token. due to M.
39+
;clojure.core-test.double
40+
clojure.core-test.double-qmark
4141
;clojure.core-test.drop ; Uncaught exception: not a number: nil, https://github.com/jank-lang/jank/issues/243 , https://github.com/jank-lang/jank/issues/245
4242
;clojure.core-test.drop-last ; Uncaught exception: not a number: nil, https://github.com/jank-lang/jank/issues/244
4343
;clojure.core-test.drop-while ; Assertion failed! val.is_some(), In clojure.core-test.drop-while$fn_8-90, duplicate definition of symbol '_fn_55_1', https://github.com/jank-lang/jank/issues/243 , https://github.com/jank-lang/jank/issues/212
4444
;clojure.core-test.empty ; expected: (= (quote ()) (empty (range))) actual: (not (= () nil))
4545
;clojure.core-test.even-qmark ; Uncaught exception: invalid object type: 3, Expecting whitespace after the last token. due to M.
46-
;clojure.core-test.false-qmark ; TODO: port double, Expecting whitespace after the last token. due to M.
46+
clojure.core-test.false-qmark
4747
clojure.core-test.first ; In clojure.core-test.first$fn_2-61, duplicate definition of symbol '_jank_global_init_60'
4848
;clojure.core-test.float ; Failed a test. Expecting whitespace after the last token. due to M.
49-
;clojure.core-test.float-qmark ; TODO: port double, Expecting whitespace after the last token. due to M.
49+
clojure.core-test.float-qmark
5050
;clojure.core-test.fnil ; Assertion failed! ret, unloadable.
5151
;clojure.core-test.format ;TODO: port format
5252
;clojure.core-test.get ; Assertion failed! ret, unloadable.
@@ -114,15 +114,15 @@
114114
;clojure.core-test.star ; error: Unable to resolve symbol 'Exception'.
115115
;clojure.core-test.star-squote ; error: Unable to resolve symbol 'clojure.lang.BigInt'.
116116
;clojure.core-test.str ; TODO: port double, Expecting whitespace after the last token. due to M.
117-
;clojure.core-test.string-qmark ; TODO: port double, Expecting whitespace after the last token. due to M.
117+
clojure.core-test.string-qmark
118118
;clojure.core-test.subs ; Uncaught exception: end index 1 is less than start 2, In clojure.core-test.subs$fn_2-70, duplicate definition of symbol '_fn_2_0', https://github.com/jank-lang/jank/issues/244
119119
;clojure.core-test.symbol ; Read error (1409 - 1414): invalid ratio: expecting an integer denominator
120120
clojure.core-test.symbol-qmark ; Expecting whitespace after the last token. due to M.
121121
;clojure.core-test.take ; Uncaught exception: not a number: nil, In clojure.core-test.take$fn_2-57, duplicate definition of symbol '_fn_2_0', https://github.com/jank-lang/jank/issues/245 , https://github.com/jank-lang/jank/issues/243
122122
;clojure.core-test.take-last ; Uncaught exception: not a number: nil, In clojure.core-test.take-last$fn_2-43, duplicate definition of symbol '_fn_2_0', https://github.com/jank-lang/jank/issues/243 , https://github.com/jank-lang/jank/issues/244
123123
;clojure.core-test.take-while ; Uncaught exception: invalid call with 1 arg to: nil, In clojure.core-test.take-while$fn_2-86, duplicate definition of symbol '_fn_2_0', https://github.com/jank-lang/jank/issues/243
124124
;clojure.core-test.taps ; Read error (0 - 0): unbound symbol: clojure.lang.IPending
125-
;clojure.core-test.true-qmark ; TODO: port double, Expecting whitespace after the last token. due to M.
125+
clojure.core-test.true-qmark
126126
;clojure.core-test.unsigned-bit-shift-right ; Uncaught exception: invalid object type: 0, In clojure.core-test.unsigned-bit-shift-right$fn_2-37, duplicate definition of symbol '_jank_global_init_36', Exception: invalid object type: 0
127127
;clojure.core-test.with-out-str ; Exception: TODO: port with-out-str
128128
;clojure.core-test.with-precision ; TODO: port with-precision, Read error (372 - 374): invalid number: chars 'M' are invalid for radix 10

0 commit comments

Comments
 (0)