This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-31
Channels
- # aws-lambda (4)
- # beginners (152)
- # boot (19)
- # cider (45)
- # cljs-dev (14)
- # clojure (54)
- # clojure-dev (33)
- # clojure-greece (11)
- # clojure-italy (4)
- # clojure-nl (8)
- # clojure-norway (2)
- # clojure-russia (6)
- # clojure-sg (1)
- # clojure-spec (1)
- # clojure-uk (40)
- # clojure-ukraine (5)
- # clojurescript (40)
- # community-development (13)
- # component (8)
- # core-async (3)
- # cursive (25)
- # data-science (11)
- # datomic (13)
- # duct (1)
- # emacs (2)
- # events (16)
- # figwheel (3)
- # fulcro (53)
- # graphql (2)
- # jobs (5)
- # jobs-rus (1)
- # juxt (10)
- # leiningen (4)
- # off-topic (82)
- # other-languages (5)
- # portkey (3)
- # protorepl (13)
- # re-frame (22)
- # reagent (15)
- # ring-swagger (4)
- # shadow-cljs (69)
- # spacemacs (7)
- # specter (16)
- # sql (13)
- # vim (5)
- # yada (2)
@noisesmith @smith.adriane: I forgot to mention, this is a *.cljc file, so I need jvm + js // I guess I should now look into js regex libraries 🙂
looks like this has a similar api http://sstephenson.github.io/strscan-js/
@qqq also double check if subs is actually a problem - it should be cheap (on the jvm at least) since java strings are immutable
@noisesmith: some-> is precisely what I need -- thanks
I like to use parens with arrow macros, it's a personal style preference
Hi, is there a name for the common design pattern of letting an HOF accept extra arguments that will be applied to the given function, e.g swap!
or update
?
The succession model is a term I've heard
if I have a local jar file, how can I include it in a project? i.e where should the jar be located and what do I need to add to the project file? (lein 2)
14:27 $ clj --help
Usage: java -cp clojure.jar clojure.main [init-opt*] [main-opt] [arg*]
I might understand why clj --help
mentions java, but I'd expect it to have a more specific help message?
Does anyone familiar with the salesforce API, know what would happen if I have push topic's set up to sync salesforce data to a standalone db, then a user's permissions change and the user is now long has access to a specific record, would the push topic send a delete
update for the request that the user can no longer view?
A noob question: is it possible to make a http HEAD request in clojure without reverting to javaland (HttpURLConnection) or pulling in a third party dependency?
clojure.core has no http client unless you count slurp as one, and slurp doesn't support http methods options
I find myself writing a lot of code of the form
{:tag kw kw data ... other attribs ... }
for ecample
{:tag :pat :pat .... :name .... }
thi seems a bit redundant
Good morning 🙂 Is anyone here familiar with Neanderthal? I'm trying to find some missing constants that are required in order to run the hello-world example. (require '[uncomplicate.clojurecl.core :as uc])
from a repl in the example project gives me a CompilerException java.lang.Exception: No namespace: uncomplicate.clojurecl.constants, compiling:(uncomplicate/clojurecl/core.clj:1:1)
. There is no constants
namespace defined anywhere in the Neanderthal repo, and I can't find a repo in the Uncomplicate org that looks like it might have those constants.
Obviously @devrandomguy you haven't got the correct setup to use neanderthal
http://neanderthal.uncomplicate.org/articles/getting_started.html#installation ClojureCL
(OpenCL) not installed correct
Maybe I should go over the opencl install again via the Neandertal instructions. I already have webcl working in Firefox, and opencl working from Python.
Thanks for the room link, I almost missed that
is there a good word for 'compute a bunch of auxiliary / derived data for caching purposes' ? (informatically theoretically, it adds nothing new, but it precomputes a bunch of lookup tables / caches)
it’s similar to how dynamic programming works, right? - organizing things so you can save and reuse partial calculations
'dynamic programming' is a very specific class of algorithms; where you save computation by remembering it in my case, I'm pre-building lookup tables -- it's not quite the same
any reason you aren’t using memoize?
now, given two ops, I want to know which has a higher precedence .. so I need to 'invert' the above vector of vectors, and cache the results, to get something like: ^ -> 3 * -> 2 / -> 2 + -> 1 - -> 1
why generalize it, why not just call it “build-precedence-map” or something mundane like that
do you anticipate this being a common type of task?
1. why do you believe i'm trying to 'generalize' it? 2. 'build-inverse-precedence-map' is perfectly valid, but I was hoping for a shorter word
I'm not trying to 'write a more general function', I'm literally looking for a shorter func name.
tough if we don't know exactly what it returns and how you'll use it. If it just returns -1,0,1, compare-by-precedence
. If it returns the lower of the two lower-precedence
, if it returns a vector of the two ops sorted, sort-be-precedence
. If it returns a map that allows you to lookup by operator token then make-precedence-map
ah, I see, I should have been clearer on input/output
input:
{:tag :grammar
...
:precs [[:right "^"] [:left "*" "/"] [:left "+" "-"]]
}
output
add a field
:inv-precs { "^" [3 :right] "*" [2 :left] "/" [2 :left] "+" [1 :left] "-" [1 :left]]
i'm getting a compilation error in 1.9.0-beta3: Caused by: java.lang.ClassNotFoundException: clojure.pprint
i definitely see it in the source/tests, and it's basically a new/empty project. any idea what i'm doing wrong?
@joshkh How did you create the project? Have you edited it at all? What command are you using that produces that error? What does the source look like that it is complaining about?
i used the lein-re-frame template and added just a few deps. you have a good point though... i'll start with a barebones project and rule out any weird dependency problems first.
sounds like some code was assuming clojure.pprint is loaded on startup (a bad assumption)
there’s some tooling which requires clojure.pprint, that often runs on startup, but it’s not something you can count on
if you use a namespace, you should explicitly require it, even if it comes with clojure.core
even for namespaces like http://clojure.java.io that are loaded by clojure.core itself, there’s no explicit promise that will be the case with the next clojure release, so it’s better to require it if you access it