This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-26
Channels
- # 100-days-of-code (3)
- # announcements (2)
- # beginners (237)
- # bitcoin (2)
- # boot (5)
- # cider (15)
- # cljs-dev (9)
- # cljsrn (6)
- # clojure (75)
- # clojure-estonia (1)
- # clojure-italy (8)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-spec (68)
- # clojure-uk (80)
- # clojurescript (89)
- # cursive (31)
- # datomic (22)
- # emacs (2)
- # events (3)
- # figwheel-main (184)
- # fulcro (28)
- # graphql (1)
- # hyperfiddle (2)
- # jobs (1)
- # jobs-discuss (64)
- # luminus (5)
- # off-topic (16)
- # om (2)
- # onyx (1)
- # pedestal (12)
- # portkey (1)
- # re-frame (13)
- # reagent (56)
- # reitit (13)
- # ring-swagger (13)
- # shadow-cljs (145)
- # slack-help (2)
- # specter (6)
I have a project where dependencies are ostensibly being included from ~/.lein/profiles.clj into releases and I can't for the life of me figure out why: https://github.com/cloverage/cloverage/issues/228#issuecomment-424810468
Eastwood has some very recent un-released changes that I think also make it behave this way. I've created an issue at the following link in case folks want to add any comments to it: https://github.com/jonase/eastwood/issues/286
@andy.fingerhut I'm curious: why would Eastwood do that? What does it gain by inserting itself like that?
All currently released versions of Eastwood do not do this.
(and it seems like venantius/ultra crops up regularly enough that it pretty much needs to be an FAQ in the Clojure world about "why are my dependencies broken?" 🙂 )
It was a recently committed change, not yet part of any release, that I believe has such a change.
I wasn't involved in the decision on this change, only some debugging of some earlier Eastwood changes that prevented 0.2.9 from actually being used, and these changes were made by the current Eastwood maintainer as part of the fixes for that issue.
Ah, I see what it's doing now. Previously, it used to add itself as a dependency if it wasn't already specified (via add-if-missing
from leinjacker
). Now, it looks for a plugin dependency if present and uses that to add itself as a (dev) dependency. And it only seems to do it while Eastwood is running inside Leiningen (`eval-in-project`).
So it doesn't look like the behavior has really changed -- it's just dropped support for Leiningen 1.x and relies on core Leiningen stuff in 2.x to run itself now?
I think the difference with Ultra is that it injects itself into your deps in all situations?
I have not dug into how ultra modifies things, or these recent Eastwood changes, enough to understand them fully. I raised the issue because I was pattern matching on "ultra behavior X causes some people problems. Hmm, that sounds similar to a recent Eastwood change that maybe shouldn't be released if it would cause the same problems."
If you have more details that might help make good decisions there, and have the time and interest to share your knowledge, that would be great.
The above is based on 1) just now reading the entire commit list for Eastwood since the last release and 2) repeated complaints from people who've tripped over Ultra's behavior when they're not aware they're explicitly "using" it for anything... so I'm not sure I'm any more qualified than the next person )
@seancorfield your reading of the dependency injection code in Eastwood very much resembles the intent of it.
@slipset Sorry if I am raising alarms for no good reason. My recent comment above gives what could loosely be called my thinking process here.
Basically, as far as I understand, if you have Eastwood only listed as a plug-in, lein needs it as a dep to actually run it.
@andy.fingerhut no problem. I’m just grateful for more eyes on this.
I have a problem I'm not really sure how to go about solving, maybe someone can point me in the right direction
for any given (small) collection of numbers, let's say [0 5 5 4]
, I need to change any duplicates such that they are the nearest non-duplicate value, say, [0 5 6 4]
for this
the actual changed value and distance of the change isn't as important as the numbers being unique, though ideally there would be as little change to the numbers as possible
hello guys
anyone has experience with this library to serialize as avro format? https://github.com/damballa/abracad
I need to be able to serialize a java.sql.Date
field value to Avro, but I'm not succeeding with that.
I've tried "extending" the types following the example, but I can't figure out how to do properly...
specifically what kind of error?
SchemaParseException "date" is not a defined name.
This is my code:
(extend-type java.sql.Date
avro/AvroSerializable
(schema-name [_] "resultset")
(field-get [this field] (case field :date (.getTime this)))
(field-list [this] #{:date}))
(defn ->java.sql.Date
[d] (java.sql.Date. d))
But, I'm pretty sure it is incorrect, but I can't figure out how to make it work having just the little example in the project's README
I couldn't fully understand how to glue the pieces in the example.
defn lets you make a function with . in the name, but it clojure's compiler will blow up if you ever try to write code that calls it
also -> in the name isn't a syntax, it's a convention - ->foo
is the name of something that creates a foo
so you probably want ->Date
- then a reader would correctly understand it's a function that exists to create a Date
other than that the code is incomplete but looks fine so far
(though resultset is a weird name for a schema for a date type)
I think that is the issue. In the project's example, the schema is named "ip.address"
it just has to match the symbol used defining the schema, right?
I mean, when extending, it is named "ip.address"
then, in schema definition, it appears as 'ip.address
then, in binding the readers, it appears as 'ip/address
i couldn't understand why this /
instead of .
well I promise clojure would explode if you try to compile code that calls a function defn'd as ->java.sql.Date
- the var resolution would blow up looking for a class that doesn't exist
the / is syntactically significant in symbols, it creates a namespace
i've tried just ->Date
already, but not works
ok, but there is no need to "match" with the name given to the namespace?
OK, you don't have any code defining the schema yet - I'm just pointing out errors
I wouldn't expect any need to match namespaces, and I wouldn't expect it to use namespaced keywords in that context
i'm a little bit confusing on the use of a "pure string" when extending the types (`"ip.address"`) and, later, using a symbol 'ip.address
have you seen the example that i'm referring to?
do you think it is correct?
i mean... could that example be wrong?
it could be, but I have no reason to think it would be
for databases (other than datomic), do the majority of people prefer to use something like hugsql or do they just use clojure.java.jdbc?
I know almost nothing about DBs and want to keep it pretty status quo for this project
i went with hugsql and don’t really have any complaints
seems nicer than dealing with jdbc directly
hugsql and honeysql seem to be the status quo.
@lilactown At work we use clojure.java.jdbc
for all the "day-to-day" SQL stuff and HoneySQL where we need programmatically composable queries. See this talk from a former colleague about how we use that https://www.youtube.com/watch?v=alkcjyhesjI
My understanding is that HugSQL is great for fixed SQL queries where you want to keep your SQL in regular .sql
files outside your Clojure code (I prefer to see my SQL inline).
clojure.java.jdbc
itself provides get-by-id
, find-by-keys
, insert!
(a hashmap into a table), update!
, and delete!
-- all of which really need no SQL at all for basic CRUD operations.
is there a single step method to get the unqualified part of a qualified keyword, such that (?fn :myapp.core/key) => :key
?
(comp keyword name)
is a function that does that
just name
if a string suffices
@seancorfield what do you think of walkable?