Comments (5)
If it is a bug this issue belongs somewhere else, maybe light-table.
from lt-cljs-tutorial.
@jasonkuhrt this is not a bug. Sets do not have an order.
from lt-cljs-tutorial.
@swannodette How does first
decide which element to take then?
I am able to produce what I would expect in another file:
(first #{:a :b :c}) ;; :a
(rest #{:a :b :c}) ;; (:c :b)
Are you saying this should be considered correct?:
(rest #{:a :b :c}) ;; (:a :c)
If so it seems to make rest
etc pretty useless for sets
?
from lt-cljs-tutorial.
I am still confused by these results.
My additions using the :a :b :c
return what I expect. What's going on here?
from lt-cljs-tutorial.
My guess is that sets are sorted by a hash value for its elements. Hash values are somewhat random by design, so that would explain the seemingly random ordering of the sets when they are coerced to a sequence.
from lt-cljs-tutorial.
Related Issues (14)
- Exception on the first def HOT 3
- regex HOT 1
- No reader function for tag js HOT 2
- Things I didn't understand HOT 2
- ReferenceError: lt_cljs_tutorial is not defined HOT 2
- Worth having the `true` case here too?
- Light Table 0.5.x
- Some obscurities HOT 1
- Clarify naming of Js types when extending them with protocols HOT 1
- Error on first eval HOT 4
- Confusion from extend-type/extend-protocol example
- no file or url found for cljs connection HOT 1
- Fails evaluating namespace with "We couldn't connect"
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 lt-cljs-tutorial.