This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-07
Channels
- # announcements (10)
- # babashka (11)
- # beginners (69)
- # calva (1)
- # cider (2)
- # clj-kondo (35)
- # cljdoc (48)
- # cljs-dev (3)
- # clojure (60)
- # clojurescript (10)
- # community-development (6)
- # cursive (4)
- # datahike (1)
- # datalog (33)
- # deps-new (2)
- # depstar (8)
- # docker (24)
- # fulcro (1)
- # graphql (4)
- # honeysql (5)
- # java (2)
- # leiningen (2)
- # missionary (3)
- # off-topic (104)
- # pedestal (8)
- # polylith (18)
- # portkey (3)
- # reagent (7)
- # reveal (1)
- # rewrite-clj (4)
- # shadow-cljs (19)
- # specter (3)
- # tools-deps (2)
I'm trying to update this so that it works with the current ns form rules:
https://github.com/uplift-inc/twilio
lein test keeps failing and giving messages like:
Syntax error macroexpanding clojure.core/ns at (twilio/core.clj:1:1).
import - failed: #{:refer-clojure} at: [:ns-clauses :refer-clojure :clause] spec: :clojure.core.specs.alpha/ns-refer-clojure
I replaced the (import [http://java.net URLEncoder]) with ring.util.codec and that seemed to resolve the issue.
is there a (core) predicate that answers whether something is a scalar? Like #{int? string? ...}
No, as that is an open ended set
complement coll? is probably closest, but colls are also an open ended set
I often stub my toes against exactly that notion. In some talk about spec it was said “There can always be more stuff”. I don’t need to enumerate all the things nor do I need to find some abstraction over that. Just specify what is needed where it is needed. Ty
I'm not sure what you mean by composite ... What would be some qualifying inputs?
7
?
3.14159
?
radical 2
?
@denis.baudinot Maybe (complement sequential?)
? ... Sorry on my phone so I can't actually check it
There's number?
... so one could do (complement number?)
perhaps
@denis.baudinot (complement coll?)
perhaps?
(`sequential?` is not true of several collection types so (complement sequential?)
won't be accurate)
Clojure is open to new scalars and new coll types
Perhaps if you explain the problem you're trying to solve, we can offer a more specific solution?
I'm not even sure what "inherently atomic" in database terms means -- that depends on the database technology, doesn't it?
Yeah that’s the problem: I don’t use a specific database, just that’s where the idea comes from I guess
In some databases, that would be a whole document (definitely a "collection" of data), in others it would be a row, in others just a tuple...
But, again, what problem are you trying to solve?
I recently added vectors as an atomic type for the Asami database, though I did (arbitrarily) restrict them to not allowing collection types as members. So it’s definitely vague!
I'm not hearing a problem statement here, just academic curiosity about terminology 🙂
I consider operations as something that can be atomic, not values.
dev=> (doc compare-and-set!)
-------------------------
clojure.core/compare-and-set!
([atom oldval newval])
Atomically sets the value of atom to newval if and only if the
current value of the atom is identical to oldval. Returns true if
set happened, else false
Atomic operation.dev=> (doc swap!)
-------------------------
clojure.core/swap!
([atom f] [atom f x] [atom f x y] [atom f x y & args])
Atomically swaps the value of atom to be:
(apply f current-value-of-atom args). Note that f may be called
multiple times, and thus should be free of side effects. Returns
the value that was swapped in.
Atomic operation.(and that's true of databases too: ACID - Atomic, etc - refers to operations)
I’m led to think of mathematical logic, and in particular Prolog, where base terms are called atoms
Ty for your answers and hints. I resolved the issue, for reference: I realised that this part of the program doesn’t know or shouldn’t care if that makes sense. I tried to write a spec for something that this module can’t possibly validate without leaking the implementation of another module.
😄 those are some of the best questions. At least you are interrogating / questioning what is possible while preserving simplicity. It sounds like you want to know the type of the data and just be wary of turning any generic screw drivers into fruit-brand context-specific screw drivers that cost extra. it's the right-to-repair movement for your source code 😛
Hi everyone, I hope you all are doing great. I am very new to Clojure World. I am working on a ClojureScript, shadow-cljs project. I am trying to use an npm package in the project. I installed it using "yarn add react-native-swipe-list-view". But I don't know if something is wrong with the package or this is not the right way to add a dependency. Because that added module is showing Syntax Error: "Cannot use Import Statement outside a module". It will be a big help if someone can point me to a resource to fix this issue. I posted other Info's like screenshots on this URL: https://github.com/status-im/status-react/pull/12432#issuecomment-894633595
@U02AB40BP0W you want want to ask in #shadow-cljs
"yarn add" is the right way to add a js dep.
What is make test
running?
I feel like that might just a bug in that library. it seem rather self contained.
Hi @https://app.slack.com/team/U0DJ4T5U1 , Thank you very much for your reply. According to my research shadow-cljs implements a custom JS bundler and bundles node_modules into something that can be used with clojurescript. And that npm package uses ES6 Syntax and shadow-cljs having trouble bundling that. I think I need to use babel to convert that into browser-friendly code first. I just need to figure out how to use babel to do that. You are right I should ask question in #shadow-cljs Thanks
Did you read: https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages ?
@U0K064KQV Thank you very much for your reply. Yes, it mentions adding the dependency. Also, what will be the similar syntax to ES6 to use for coding in clojurescript. But problem is, npm package that I added is using ES6 syntax.
I don't know but here it is breaking, just because package has ES6 syntax
As you can see in error message in link, error is only in node_modules directory. That I not even modified. Problem is happening while shadow-cljs converting that code for clojurescript
I think you might want: (:require ["react-native-swipe-list-view" :refer (SwipeRow)])
maybe?
I'm not too sure, but I know that shadow should be able to handle ES6
This is my swiper search for keyword react-native-swipe-list-view. You can see there is only one manually added place, others are automated files like yarn.lock. And you can see my import there.
Oh sorry I forget to mention, I am quite sure about syntax. Because I am able to run code and app is running on phone with this imported class. Means this code is right.
But I don't why later this error shows https://user-images.githubusercontent.com/17097240/128596485-8f52c6fa-8f34-494b-8247-7dbd486b43a1.png
oh, its just the bundling that's struggling? Ya, you'd probably need theller to help you with that
bundling is the issue
Ya that's good advice, I am messaging him. Thanks!
Still, Thank you very much for your time. 🙂