Fork me on GitHub

since yesterday evening I've got an issue with deploying to clojars: anyone know what's going on?


I don't know what's going on, but I'm having (what appears to be) the same issue.


For interop like this, is there a better way? (java.nio.file.Paths/get "/Users" (into-array ["username" "dev" "clojure"]))

Toby Clemson09:09:17

@doglooksgood I'm in the process of writing a wrapper for java.nio.file that might be of use:

Toby Clemson09:09:41

There's no getting started yet but hoping to work on that this week

Toby Clemson09:09:00

There are API docs but they are in a minimal state at the moment

Toby Clemson10:09:57

For your specific case, with that library:

(require '[pathological.paths :as p])
(p/path "/Users" "username" "dev" "clojure")

Toby Clemson10:09:15

Or (p/path "/Users/username/dev/clojure")

Toby Clemson10:09:12

Take a look at the tests for example usage


is there some way to make the in-browser stacktrace-viewer thing from lein show the same stuff as is shown in the command-prompt? I'm using expound to get readable spec errors, but they don't affect the errors i see in my browser. is this doable? or is there maybe some generally better solution to have readable (or at least not clojure.core-containing) stacktraces?


Does Kibit make suggestions on using any of the threading macros? I see the code there, but I am unable to understand when it does so


Is it possible to access the line/column numbers of an sexp and all it's sub-expressions (and sub-expressions thereof etc) in a macro? Via &form I can access the meta information of the form of the macro invocation, and the meta information of the arguments, but I cannot do it recursively on these arguments (the symbols a, b, c and d in the example below). I would like to use this to improve error reporting in macros. The only solution I see for now is to implement a reader macro which adds the meta information everywhere (with tools.reader). But there must be an easier way?

Alex Miller (Clojure team)16:09:25

Line/col info is only attached to forms, not to symbols in the reader - does that match what you’re seeing?

Alex Miller (Clojure team)16:09:16

If so, then this is not macro-related but reader-related


Thanks @U064X3EF3, it does 🙂


One day it would be cool to have them on any tokens. In cases like (let [x 1, 2 3] 4) it would be cool if an IDE could directly highlight the offending token 2.


Are there any pitfalls to using something like this

(defmacro apply-macro [macro args] `(~macro ~@args))
in order to apply a macro to some list of args? Is this the way to do it, or is there a better way?


I never had problems with this pattern.


I think that will only work if args is a collection literal.

Jack Westmore15:09:50

Hey there, would anybody be willing to help meet out setting out Emacs with Cider? Completely new to this thing and encountering a bug...


it'd be best if you described the problem in advance and posted it in #cider or #emacs


can I override or add rules to kibit?


Is there a library that provides a set of standard read/write handlers for Fressian that can serialize default Clojure data structures, like vectors and meta?


If I was to publish a lib on clojars, is it a better convention to name it com.ahungry.<whatever>, or to do something like ahungry.util.<whatever>?


if I don't use the FQ naming for the ns, would the alternative be in a lein defproject for the group name to use ?


well, this is frustrating - following the clojars deploy tutorial and the similar one on lein's site, and neither work


Sending ahungry/xdg-rc/maven-metadata.xml (1k)to 
Could not transfer metadata ahungry:xdg-rc/maven-metadata.xml from/to clojars (): Access denied to: , ReasonPhrase: Forbidden - repo/ahungry/xdg-rc/maven-metadata.xml.md5 (No such file or directory).
Failed to deploy metadata: Could not transfer metadata ahungry:xdg-rc/maven-metadata.xml from/to clojars (): Access denied to: , ReasonPhrase: Forbidden - repo/ahungry/xdg-rc/maven-metadata.xml.md5 (No such file or directory).


(this comes after a few lines of successful output for sending the jar and pom


known issue. issue with the storage for clojars. they are investigating


thanks, glad it isn't just me - i suppose bad timing on my part


you can follow along in #clojars if you like


yup. just the one random day that there's been a problem


does lein or deps.edn have a standard way to pull code straight from github and avoid clojars entirely?


deps.edn does natively. i think there's a lein plugin to achieve the same


Isn’t there a convenience method that provides both quot and rem ? Obviously I can (juxt quot rem) but I remember something of this sort


ty, good to know I just have abysmal timing for the first time attempt to put something on clojars


or maybe that was Haskell. I can’t remember now


I do not recall anything in Clojure for that.


Yeah, I think I’ve got them mixed up. Thanks.


The clojars deploy issues should now be resolved.

🎉 8

thanks so much @tcrawley you're awesome


My pleasure!


With spec fdef, I want to test/instrument a function that takes no args, but should always return a string


how do I do that?


I tried an fdef of :args nil and :ret string? but when I call stest/instrument, and then redefine the function to return a number, it doesn't throw any error or message

Alex Miller (Clojure team)20:09:18

instrument only checks invocation, not return

Alex Miller (Clojure team)20:09:38

Also (s/cat) is usually the best spec for a no arg function (although there’s not much value in testing a no arg function)


(defn get-string [] "Foo" 5)
         (s/fdef get-string :ret string?)


maybe thats a better sample


user=> (if-let [z true [x y] [1 2]] [x y])
Syntax error macroexpanding clojure.core/if-let at (REPL:1:1).
([x y] [1 2]) - failed: Extra input at: [:bindings] spec: :clojure.core.specs.alpha/binding

user=> (if-let [[x y] [1 2]] [x y])
[1 2]


Destructuring fails if its the second binding in an if-let form


Rather. This fails the spec. Was this how it used to be before?I could’ve sworn it used to work…


It doesn't have anything to do with destructuring


Try [x 1 y 2]


Yeah I did. So only one binding is allowed! But I swear the doc said bindings. I should look that up


Ah! Got it. The clojuredocs version has an if-let* that I used before