This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-10
Channels
- # beginners (151)
- # cider (41)
- # cljdoc (7)
- # cljs-dev (6)
- # clojure (92)
- # clojure-dev (5)
- # clojure-italy (26)
- # clojure-losangeles (1)
- # clojure-nl (10)
- # clojure-russia (3)
- # clojure-spec (23)
- # clojure-uk (82)
- # clojurescript (56)
- # clojutre (1)
- # core-async (3)
- # cursive (15)
- # datomic (26)
- # editors (3)
- # emacs (3)
- # events (2)
- # figwheel-main (192)
- # fulcro (66)
- # leiningen (12)
- # mount (1)
- # off-topic (131)
- # portkey (6)
- # re-frame (38)
- # reagent (10)
- # reitit (7)
- # ring-swagger (55)
- # shadow-cljs (21)
- # spacemacs (11)
- # tools-deps (48)
Hi to all. How i can omit source and obfuscate my target .jar file using deps.edn and clojure cli? Previously i used leiningen and proguard and all works fine. But in current project we are use clojure cli and juxt/pack.alpha for building .jar.
(read-string "#!/usr/bin/env bash")
blows up… but clojure seems to be ok with it… This is the only bit I don’t understand, presumably the clj
/`clojure` tools strip this out?
@rickmoynihan they do not, this is in clojure.core
really
that was my first thought… but why does read-string blow up?
ahhh hold on maybe it’s because there’s no more input…
yeah that’s it
thanks
(read-string "#!/usr/bin/env bash\n 10")
works (read-string "#!/usr/bin/env bash")
fails
Well Rich had remarkable foresight when he added this feature ten years ago 🙂 https://github.com/clojure/clojure/blame/master/src/jvm/clojure/lang/LispReader.java#L116
Though I guess even then this was useful, even then… more so now we have the clj tools
Rich plays the longest game
No comment
Mission accomplished
I need to use gen-class
it implement an abstract Java class, but am having no luck getting it to load in the REPL for cursive. I assume it needs to be AOT'ed to be present on the classpath for clj. How is this accomplished with deps.edn? Or do I need a separate tool?
If I use compile
and add classes
to :extra-paths
I get this exception on import.
@aitem i’m curious too how distribute clojure closed source jars. How datomic is distributed? May be @alexmiller help us.
Don’t know - I’m not on the Datomic team :)
ask in #datomic
@rickmoynihan Looking at that code makes me wonder what #<
is for since, right now, both in EDN and Clojure, the reader for that simply throws an exception.
@seancorfield: yes that’s a curious one
I'd forgotten about ##
as well -- and #!
was new to me too.
yeah ##
was new in 1.9
Can you override how #<
is read? Or do you mean "reserved for some future, unknown purpose"?
I didn’t think the reader was extensible/overridable; at least not beyond tagged literals.
@seancorfield I'm guessing a bit.
Wow, I had never noticed that #! special case in the Clojure reader before. I won't say I never saw it, because I am sure I looked at the linked group of source lines at least a dozen times over the years.
As in, is there some object that will print as a sequence of character beginning with #<
? I don't know if there is one today.
Scanning through the Clojure implementation for print and pprint I didn't notice any such case.
Not to my knowledge
I think that’s just reserving space in the reader
You think it’s that old object syntax?
my interpretation was always that #<>
was the way unreadable things were printed, and the #<
entry in the reader was to produce the "unreadable form" exception whenever you accidentally tried to read those things
here's the reader error messages from 1.2.1:
user=> (-> (Object.) pr-str read-string)
java.lang.RuntimeException: java.lang.Exception: Unreadable form (NO_SOURCE_FILE:0)
user=> (read-string "#,comma")
java.lang.RuntimeException: java.lang.Exception: No dispatch macro for: , (NO_SOURCE_FILE:0)
so I thought of the #<
codepath as the way to avoid the less helpful No dispatch macro for: <
message you'd get otherwiseand it's still useful today for reading data produced by older clojures