Fork me on GitHub
#beginners
<
2017-01-21
>
SoV400:01:56

@seancorfield !! 😄 it works

SoV400:01:02

thanks for your good juju

beppu00:01:05

Is it ok to publish Clojure applications (as opposed to libraries) to http://clojars.org ?

beppu00:01:19

Tangentially, I'm wondering what the best way to publish a Clojure Swing app would be. How do you package a cross-platform GUI app written in Clojure?

seancorfield02:01:12

It doesn’t really make sense to publish an application to http://clojars.org since it wouldn’t be used as a JAR dependency in another program @beppu

seancorfield02:01:09

As for packaging an app, you want to build an uberjar — a JAR that includes Clojure and all other dependencies — so you can just run it with java -jar path/to/the.jar

beppu02:01:21

@seancorfield Thanks for the feedback. If possible, I'd like to find a tool that can take an uberjar and make it something that can be opened via doubleclicking.

beppu02:01:37

I realize this is OS-specific.

seancorfield02:01:02

I thought double-clicking a JAR file ran it?

beppu02:01:59

Does it? I don't normally open apps that way since I'm a command line junkie. (I was just trying to be considerate to non cli people.)

beppu02:01:05

let me try...

beppu02:01:59

@seancorfield It works (as long as I set the executable bit). Cool. Now, I just need to figure out how to set an icon for an uberjar.

neurogoo13:01:45

Hi, what is idiomatic way in Clojure to build a double linked list and keep track of what element you last time where reading to easily go to previous or next element.

neurogoo13:01:41

You can of course just use norma list, and you take-while/drop-while to find the last read place, but that doesn't feel very elegant

akiroz16:01:09

and Clojure supports zippers since 1.0, they're in the clojure.zip namespace

neurogoo16:01:45

Thanks for the tip @akiroz . I have to look into them

akiroz16:01:46

no problem, here's a quick demo:

user=> (require '[clojure.zip :as zip])
nil
user=> ;; create a zipper, descend down to the first element
user=> (def my-zipper (zip/down (zip/vector-zip [1 2 3 4 5])))
#'user/my-zipper
user=> ;; get current element
user=> (zip/node my-zipper)
1
user=> ;; move right, get element
user=> (zip/node (zip/right my-zipper))
2
user=> ;; and again...
user=> (zip/node (zip/right (zip/right my-zipper)))
3
user=> 

nathansmutz22:01:24

I think I've seen a function/form that takes a Clojure var and returns a unique ID for the object it references. I can't seem to find it lately though. Is that a real thing?

nathansmutz23:01:23

I'm looking to enforce a consistent (but arbitrary) order on collections of arbitrary things. Using .hashCode isn't guaranteed unique and probably has some overhead. There are those times where you're trying to print a map or something to console and instead you see [object/type]/#[some uuid-looking string]. That seems like it might be unique per object and, if you can get it on-purpose, maybe the best thing on which to sort.