Comments (6)
Since CLJS accepts it and I haven't heard anyone complain about that, I think it's better to just leave it since then the SCI code can remain the same for both implementations.
from babashka.
ClojureScript also accepts (let [a 1, b 1] #{a b})
. I would consider this undefined behavior or an incidental implementation detail.
from babashka.
Ah wait:
user=> (defn foo [a b] #{a b})
#'user/foo
user=> (foo 1 1)
Execution error (IllegalArgumentException) at user/foo (REPL:1).
Duplicate key: 1
from babashka.
It seems JVM Clojure has a createWithCheck
mechanism which is used for literals:
https://github.com/search?q=repo%3Aclojure%2Fclojure%20createWithCheck&type=code
from babashka.
Still I think the question should be asked: why is this important, exactly? I never had a situation myself where leaving the check off would have made a big difference.
from babashka.
I agree it's probably "incidental implementation". I simply just realized that there's this strange difference between clj and babashka and though it might be nice to at be aware know about it, that's all.
Personally I never even realized that set initialization using #{}
form actually throws in clojure. Instinctively, I'd expect it to behave similar to into #{}
, i.e. duplicities get silently ignored. Because, well.. why not.
When I think about it, the fact that the form using values #{1 2 3 1}
throws might make sense. If the expression is such a simple static literal, then the compile error might make come handy (in a way it can be thought as a kind of late compile-time "linter")
I agree I wouldn't "fix" this discrepancy in behavior as there's probably no "agreed contract" regarding how all this should "officially" behave. Let's close this issue.
from babashka.
Related Issues (20)
- Caching issue with relative local/root by same name, used in bb.edn in different directories HOT 1
- Resolve bb.edn when script is invoked via symlink HOT 1
- No dispatch macro for: ? HOT 9
- metadata added by read-string (as compared to clj implementation). HOT 9
- Embedding META-INF/bb.edn with :deps results in: Cannot run program "java"
- bb execution fails on Gentoo HOT 6
- Adding javax.net.ssl.SSLSocket and javax.net.ssl.SSLSocketFactory? HOT 33
- Static-linked binary file for armv7(32-bit) platform. HOT 1
- hash-ordered-coll not found in clojure.core HOT 1
- Try to support latest changes in at-at
- Wrapping built-in timbre/log! throws an error HOT 3
- exec-task description
- bb --version could run without a JVM HOT 1
- Can't use a lambda in a babashka's task HOT 2
- Babashka's `use-fixtures` doesn't add `:clojure.test/*-fixtures` metadata to namespace
- Dynamic var *test-out* not properly bound when clojure.test is called from within the nrepl
- bb should error when bb.edn does not contain exactly one valid form HOT 2
- Feature request: Expose flatland.ordered.set/ordered-set HOT 1
- command line separation with -- broken in several context
- Make transcriptor work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babashka.