-
Notifications
You must be signed in to change notification settings - Fork 28
Port arithmetic operators for jank #828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
f5594c1
3a6d889
47d24c5
1a5a346
7e2af5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,18 +70,19 @@ | |
| 6N 1N 5 | ||
| 6N 1N 5N) | ||
|
|
||
| (is (thrown? #?(:cljs :default :clj Exception :cljr Exception) (+' 1 nil))) | ||
| (is (thrown? #?(:cljs :default :clj Exception :cljr Exception) (+' nil 1))) | ||
| #?(:jank [] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blocked by the jank-lang/jank#558. I was thinking, maybe it would be better to have a specific issue ticket in jank (Maybe a child of this ticket) dedicated to updating all the Clojure test suite test cases for jank with support for catching specific exception types once the blocking feature is merged and in the meanwhile we merge these blocked PRs (this one, #790, and more incomming). That way we have a reminder to update these test cases and benefit from the plethora of other test cases. What do you think?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just see that as part of jank-lang/jank#415. It's not done until jank is running all of the tests we have in this repo.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's fine, so we can merge these PRs and just revisit these tests once jank can catch exceptions by type. Till then I can just keep a list of tests (in the comments of the ticket) that need to be updated. |
||
| :default [(is (thrown? #?(:cljs :default :clj Exception :cljr Exception) (+' 1 nil))) | ||
| (is (thrown? #?(:cljs :default :clj Exception :cljr Exception) (+' nil 1)))]) | ||
|
|
||
| (is (instance? clojure.lang.BigInt (+' 0 1N))) | ||
| (is (instance? clojure.lang.BigInt (+' 0N 1))) | ||
| (is (instance? clojure.lang.BigInt (+' 0N 1N))) | ||
| (is (instance? clojure.lang.BigInt (+' 1N 1))) | ||
| (is (instance? clojure.lang.BigInt (+' 1 1N))) | ||
| (is (instance? clojure.lang.BigInt (+' 1N 1N))) | ||
| (is (instance? clojure.lang.BigInt (+' 1 5N))) | ||
| (is (instance? clojure.lang.BigInt (+' 1N 5))) | ||
| (is (instance? clojure.lang.BigInt (+' 1N 5N))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (+' 0 1N))) | ||
shantanu-sardesai marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (+' 0N 1))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (+' 0N 1N))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (+' 1N 1))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (+' 1 1N))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (+' 1N 1N))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (+' 1 5N))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (+' 1N 5))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (+' 1N 5N))) | ||
|
|
||
| (is (instance? clojure.lang.BigInt (+' -1 r/min-int))) | ||
| (is (instance? clojure.lang.BigInt (+' r/min-int -1))))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (+' -1 r/min-int))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (+' r/min-int -1))))) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,20 +70,23 @@ | |
| 5 1N 5 | ||
| 5 1N 5N) | ||
|
|
||
| (is (thrown? #?(:cljs :default :default Exception) (*' 1 nil))) | ||
| (is (thrown? #?(:cljs :default :default Exception) (*' nil 1))) | ||
| #?(:jank [] | ||
| :default [(is (thrown? #?(:cljs :default :clj Exception :cljr Exception) (*' 1 nil))) | ||
| (is (thrown? #?(:cljs :default :clj Exception :cljr Exception) (*' nil 1)))]) | ||
|
|
||
| (is (instance? clojure.lang.BigInt (*' 0 1N))) | ||
| (is (instance? clojure.lang.BigInt (*' 0N 1))) | ||
| (is (instance? clojure.lang.BigInt (*' 0N 1N))) | ||
| (is (instance? clojure.lang.BigInt (*' 1N 1))) | ||
| (is (instance? clojure.lang.BigInt (*' 1 1N))) | ||
| (is (instance? clojure.lang.BigInt (*' 1N 1N))) | ||
| (is (instance? clojure.lang.BigInt (*' 1 5N))) | ||
| (is (instance? clojure.lang.BigInt (*' 1N 5))) | ||
| (is (instance? clojure.lang.BigInt (*' 1N 5N))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' 0 1N))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' 0N 1))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' 0N 1N))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' 1N 1))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' 1 1N))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' 1N 1N))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' 1 5N))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' 1N 5))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' 1N 5N))) | ||
|
|
||
| (is (instance? clojure.lang.BigInt (*' -1 r/min-int))) | ||
| (is (instance? clojure.lang.BigInt (*' r/min-int -1))) | ||
| (is (instance? clojure.lang.BigInt (*' (long (/ r/min-int 2)) 3))) | ||
| (is (instance? clojure.lang.BigInt (*' 3 (long (/ r/min-int 2))))))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' -1 r/min-int))) | ||
| (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' r/min-int -1))) | ||
| #?(:jank nil ;; Currently `long` hasn't been ported in jank. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can port |
||
| :default (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' (long (/ r/min-int 2)) 3)))) | ||
| #?(:jank nil | ||
| :default (is (#?@(:jank [cpp/jank.runtime.is_big_integer] :default [instance? clojure.lang.BigInt]) (*' 3 (long (/ r/min-int 2)))))))) | ||
Uh oh!
There was an error while loading. Please reload this page.