Fork me on GitHub
#clojure
<
2018-07-18
>
gavin15:07:30

One moment let me jack in

Duco Ergo Sum15:07:33

In seesaw you create a textarea like: (def ta (text “Some Text”)) Then update it with: (config! ta :text “Other Script”) But when the user enters some text value can be extracted with: (text ta) “Other Script”

stathissideris16:07:52

interop question: how do I force Clojure to call an overloaded method via the variant that expects a primitive int? I’m trying to call select(int index) from this class https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/SingleSelectionModel.html

iperdomo16:07:02

(int index) should coerce to primitive int and then pick the right to call? https://clojure.org/reference/java_interop#_coercions (just guessing)

stathissideris16:07:41

the problem is that…

> (type (int 10))
java.lang.Integer
it’s not an int!

iperdomo16:07:54

(.intValue (int 10)) ?

iperdomo16:07:06

i think that (type (int 10)) is doing some boxing there as the doc and implementation suggests that is cast to int and not Integer - https://github.com/clojure/clojure/blob/clojure-1.9.0/src/clj/clojure/core.clj#L874-L879

iperdomo17:07:31

so (int index) should do the trick

wilkerlucio16:07:46

hello, I'm trying to use tools.deps and use some alias do override a dependency with a local version, but seems like the classpath is not using the alias I'm setting, in my project I have an alias :test that has dependency A from maven, and I have on my user alias one that uses a local version and has it on :override-deps, but seems like its never using that, I'm running with: clj -A:test:mydep-dev, am I doing somethign wrong?

Alex Miller (Clojure team)16:07:04

can you provide the deps.edn?

wilkerlucio16:07:52

sure, this is the project deps:

wilkerlucio16:07:53

{:paths
 ["src"]

 :deps
 {org.clojure/clojure            {:mvn/version "1.9.0"}
  org.clojure/clojurescript      {:mvn/version "1.10.339"}
  org.clojure/core.async         {:mvn/version "0.4.474"}
  org.clojure/data.json          {:mvn/version "0.2.6"}
  org.clojure/math.combinatorics {:mvn/version "0.1.4"}
  org.clojure/test.check         {:mvn/version "0.10.0-alpha3"}
  spec-coerce                    {:mvn/version "1.0.0-alpha6"}
  camel-snake-kebab              {:mvn/version "0.4.0"}
  fulcrologic/fulcro             {:mvn/version "2.5.11"}}

 :aliases
 {:dev
  {:extra-paths ["src-docs" "workspaces/src" "test"]
   :extra-deps  {fulcrologic/fulcro-inspect {:mvn/version "2.2.1"}
                 binaryage/devtools         {:mvn/version "0.9.10"}
                 nubank/workspaces          {:mvn/version "1.0.0-preview1"}}}

  :http-drivers
  {:extra-deps {clj-http {:mvn/version "3.8.0"}}}

  :profile
  {:extra-deps {criterium {:mvn/version "0.4.4"}}}

  :test
  {:extra-paths ["test"]
   :extra-deps  {com.cognitect/test-runner {:git/url ""
                                            :sha     "5fb4fc46ad0bf2e0ce45eba5b9117a2e89166479"}
                 nubank/workspaces         {:mvn/version "1.0.0-preview1"}}
   :main-opts   ["-m" "cognitect.test-runner"]}}}

wilkerlucio16:07:45

and this is my local deps (`~/.clojure/deps.edn`):

wilkerlucio16:07:47

{:aliases
 {:fulcro-dev
  {:extra-deps
   {fulcrologic/fulcro {:local/root "/Users/wilkerlucio/Development/third-part/fulcro"}}}

  :fulcro-inspect-dev
  {:override-deps
   {fulcrologic/fulcro-inspect {:local/root "/Users/wilkerlucio/Development/third-part/fulcro-inspect"}}}

  :pathom-dev
  {:override-deps
   {com.wsscode/pathom {:local/root "/Users/wilkerlucio/Development/pathom"}}}

  :workspaces-dev
  {:override-deps
   {nubank/workspaces {:local/root "/Users/wilkerlucio/Development/nubank/workspaces"}}}

  :depify
  {:extra-deps
   {org.clojure/clojure {:mvn/version "1.9.0"}
    depify              {:git/url ""
                         :sha     "04329744872890711dbba8939a16e9987dd33bb3"}}

   :main-opts
   ["-m" "depify.project"]}

  :zprint
  {:extra-deps
   {org.clojure/clojure {:mvn/version "1.9.0"}
    zprint              {:mvn/version "0.4.9"}}

   :main-opts
   ["-m" "zprint.main"]}} }

wilkerlucio16:07:54

I'm trying to override the nubank/workspaces dep

wilkerlucio16:07:49

(so can I run my tests against the :local/root version)

Alex Miller (Clojure team)16:07:30

I don’t see :mydep-dev in either - did I miss that?

wilkerlucio16:07:52

when I talked about I was just using made up names

wilkerlucio16:07:02

the actual command is clj -A:test:workspaces-dev

Alex Miller (Clojure team)16:07:58

there is a known issue with overriding deps with a different coordinate type (here, maven to local)

Alex Miller (Clojure team)16:07:06

that’s most likely the problem

wilkerlucio16:07:50

yeah, seems like that, ok, I think that's one of the coolest features of deps, been able to quickly replace a mvn dep with a local one, hope it can get fixed soon, thanks Alex

leblowl17:07:34

doc strings for clojure.spec definitions? or comments good enough?

noisesmith17:07:00

if you add a doc string it should show up via clojure.repl/doc or your favorite editor tooling which builds on that

noisesmith17:07:06

never mind, specs work with doc, but spec/def doesn't take a doc string

noisesmith17:07:45

and you can't attach metadata to a keyword, so how would you end up with a doc string?

andy.fingerhut17:07:54

One of the higher voted JIRA tickets for Clojure is to add doc string support for specs: https://dev.clojure.org/jira/browse/CLJ-2194 Feel free to vote it up more if you want that.

leblowl18:07:03

@andy.fingerhut Thanks for pointing that out. I should've looked there first

Bravi19:07:13

has anyone ever used create-migration function in luminus?

leblowl20:07:21

Hey @U7ESY38HJ I think I have or at least I have used the underlying migration library migratus (https://github.com/yogthos/migratus) for which create-migration is wrapper. The create-migration you are talking about is in env/dev/clj/user.clj right?

Bravi20:07:18

yes. but I sorted it out. basically it was throwing a bunch of errors and it turns out that once you start the REPL, you need to restart it and then the function works

leblowl20:07:42

ok, glad you figured it out

Bravi20:07:04

thanks for the reply 🙂