This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-11
Channels
- # beginners (79)
- # boot (21)
- # cider (28)
- # cljs-dev (1)
- # clojure (88)
- # clojure-italy (3)
- # clojure-russia (6)
- # clojurescript (49)
- # community-development (4)
- # cursive (37)
- # datomic (12)
- # editors (3)
- # emacs (33)
- # fulcro (15)
- # hoplon (9)
- # jobs-discuss (3)
- # keechma (3)
- # lein-figwheel (2)
- # luminus (3)
- # off-topic (146)
- # onyx (5)
- # portkey (11)
- # re-frame (34)
- # reagent (7)
- # reitit (5)
- # remote-jobs (1)
- # shadow-cljs (6)
- # unrepl (11)
usually I just do (disassemble (Foo.))
, but (disassemble (Foo$Bar.))
doesn’t seem to work
at the bytecode/jvm level a java inner class is nothing different than a regular class, with an $ in the name
So I’m quite sure this is not in the standard library but I’m trying to write a function that takes the output of partition and combines the overlapping parts with a function
so for example I have (partition 1024 768 (repeat 0) coll)
and I want to combine the overlaping partitions with *
so you want to reduce each partitioned list to a numeric value?
or do you mean something else by "overlapping"
that's visible
seems like you have to take the partitioned input, then make your "un-partition" by counting the items in the first element
no, wait, you need to know the second arg to partition I think
oh, right, the first and second arg are needed for that
My current setup for providing https:// and wss:// is: 1. provide http:// and ws:// via clojure http-kit/ring 2. use some node.js wrapper to do magic with *.pem, open up https:// and wss:// and redirect to clojure's http:// and ws:// question: is there a nice way to do https/wss directly in clojure? I have all the certificates/private keys, I just need the webserver to do the encryption stuff
I'm running some Clojure code that counts the number of words in a wikipedia dump. When I run it with lots of pages (500+) get a NullPointerException [trace missing]
. How can I debug this further?
Never mind; manually dug into the code and found that one of the seqs was nil
@qqq there is https://github.com/nginx-clojure/nginx-clojure which should allow to use the nginx way of doing, and should also give you http2 easily. Still have to try for myself, no priority so far.
12308 in #admin-announcements
there was a question in #cider about how to turn off the prepended namespace from maps with namespaced keys like
clj -e "{:a/a 1 :a/b 2}"
#:a{:a 1, :b 2}
does this option exist?user=> (clojure.repl/doc *print-namespace-maps*)
-------------------------
clojure.core/*print-namespace-maps*
*print-namespace-maps* controls whether the printer will print
namespace map literal syntax. It defaults to false, but the REPL binds
to true.
nil
thanks @noisesmith
(def ^byte ^:const ubyte (byte 0x01))
doesn’t seem to work when I look at the bytecode
a def can't hold a primitive
even a primitive long can't go in a def though, right?
oh, right
so technically the def would hold a Long, but usages of that var compatible with primitive values would only see an inlined primitive long
I find it quite annoying how clojure ignores the existence of primitives other than long and double
combinatorial explosion of IFn method signitures
@noisesmith I understand the rationale for supporting only long/double as primitive function arguments
but clojure doesn't really deal well with other primitive in contexts where there's no technical limitation for it
I've made a few patches enhancing support but they've been rotting in jira for a while so it's clear that there's not a great deal of interest about it
so, if I have a byte[]
and want to do a bunch of stuff with it, I guess I’m better off using long[]
in Clojure and shed a tear for all my wasted bits?
if you stay in a local scope, primitives other than longs and doubles are somewhat supported
@schmee an array of byte still works - it's just standalone unboxed bytes that have this issue
oh, right, of course
but you can stil use an array of byte - worst case converting to long, but in the local scope it might even do the right thing
yeah, just to give some context, I wrote a board game thing in Clojure, and just to see how fast it could go I wrote another implementation in Java that uses bitboards
@noisesmith eh, clojure will sometimes do weird stuff
yeah, if you’re using native bytes, you’re doing it because you want something to be predictably fast
it would be cool if the compiler had some additional support for primitives, that would mean that I could use Clojure to replace Java even for the low-level stuff 🙂
@schmee I forget - did you mention using no.disassemble?
@schmee sometimes I fear that that sentence could end at "Clojure"
I don't remember 100% anymore but I believe I made t.e.jvm work with all primitive types as you'd expect
@noisesmith speaking of combinatorial explosions, I just looked at the IFn interface… that’s not something you see in Java everyday 😄