Fork me on GitHub

for the records: I solved using wrap-content-type


I'm looking at in h = (comp a b c d e f g) is the idea that: a b c d e f, are all called as 1 arg input, 1 arg output g, h are both N arg input, 1 arg output ?



((comp - #(+ %1 %2))2 3)
gives -5


so the last one seems to allow multiple arguments

Vaagn Khachatryan07:01:42

yep, the last one in the chain can be a multiple-arg function


hi everyone, i have a question regarding app auto-updates, plugins/modules and the like. i’m working on a web application code base for a client, several projects will be based on it, and i’d like to add auto-updates and a plugin/module system to it. i’ve heard about OSGi but i’m not sure it’s a good fit for either me or clojure. any pointers/advice?


I think @U04V70XH6 may have some valuable insights into OSGi and whether it's okay or whether it has particular pitfalls. He should be online in a few hours time.


Thanks! In particular, I wonder about the warnings I read when googling this concerning the “classloader interference” and the “large impacts” on my “application architecture”


The CFML (ColdFusion) community have an open source server called Lucee which was rebuilt in the latest major release to make use of OSGi and it caused some edge case issues when trying to deal with certain aspects of Clojure from within a CFML project so it may be completely irrelevant to your questions, but Sean understood the issue in better detail than I could explain it.


I’ll try to find it, thanks again. I hope this Sean you mention has a minute or two to spare 🙂


He is generally very generous with his time 🙂


hey all, I’m trying to figure out a good API for defining AWS Lambda functions


btw there is #aws-lambda for questions along these lines


the java8 host expects that there’s a class that implements which has a single handleRequest method


my dream is to expose a single fn that one can just do

(deflambda my-fn [request] "Hello")
and it would generate the class. but I’m guessing that a function won’t suffice, since in order to gen-class the correct class, it needs to be known at compile time?


I think you need to implement that Java interface with reify


But on second read of your question I think you already knew that 🙂


:thinking_face: I’m not familiar with reify, but from the example it looks like there’s some ceremony involved to load and invoke the Clojure namespace


I’ve heard about portkey also, but never tried it.


looks very similar to what you’re trying to do, if you don’t want to use the lib directly you could probably at least get some good ideas from it 🙂


ahhh that is doing exactly what I want 😅


yeah, I see. they’re using a macro to generate the gen-class. was hoping to avoid macros but c’est la vie


I’m a clojure newbie so I figured I should stave off the urge at least for a bit 😛


don’t! macros are great and you should absolute learn how to use them


but it’s equally important to learn when not to use them 😄


one thing that is interesting… I looked at lambada yesterday and dismissed it because it hasn’t been updated in ~2 years. but looking at the code, it looks still valid


coming from other mainstream languages, anything that hasn’t been updated in a year is invalid 😛


yes, that is something you have to adjust to when using clojure


Clojure and Java take backwards compatibility very serious, unlike some other mainstream languages


hence, there is less churn in Github repos and things that worked a couple of years ago tend to still work


is there a version of (satisfies? P x) that requires an implementation of all methods from P by x?


wait, can you partially implement a protocol?


you can, but it’s undocumented (and generally signals a design issue)


whoa, had no idea


is that a bug?


stay oblivious


I don’t think it’s a bug


one of the few places where Java gets it right and Clojure gets it wrong…


perhaps Rich wanted us to avoid implementing methods which body consists of (throw (NotImplementedException.)), which happens ocassionally in Java et al


I think the reasoning is largely the “open vs. close” debate, like in spec when it comes to validation (open maps)


Should be achievable with reflection although I’d like to avoid any hacky business, hence my question 🙂


ahh right, to avoid breaking existing implementations if you add new methods to the protocol


one could argue that that's what (semantic) versioning exists for, but then again Rich opposes that


don't particularly agree/disagree, time will tell if these ideas really triumph?


@noisesmith I 3 days ago I asked you a couple of beginner questions about serving json. I did not understand your suggestions at all then. I do now. After reflecting about it (and after reading the docs of ring) I finally understand everything, my problems are gone and I became a better person. Thank you so much!


I just read the announcement about git deps. I have heard of it first when go used that as dependency mechanism and have always been sceptical about that. I think this introduces some risks like, what if I refer to a certain branch that gets deleted, or a tag / version. Or maybe someone deletes its repo or maybe moves it. I guess there are some more risks about dependencies vanishing. Does someone know if this is a problem in the go world? Of course I could clone every repo I use as a dependency, but do I want that? Surely not.


the feature isn't there yet as far as I know, just something interest has been expressed in, so it is hard to critique it


in general maven works pretty well, but some artifacts still get deleted or a given version is overwritten by a different jar from time to time


as a result most organizations of any size actually run a caching proxy maven server of some kind


(so something for git would help deal with the similar issues there)


Worst case you can just fork repos and control this, it s way easier than publishing on maven


(if you are part of a large organization that is not running some kind of caching proxy maven server you should look in to it)


the feature is just out


oh, look at that


@hiredman I am and we do run our on artifactory. I am talking more about myself when I do my side projects and dont have my own artifactory available.


it looks like the write up says it checks out the repo so it sounds like you will have a back of ever repo+branch you depend on


the write up doesn't talk about transitive deps for git


but it looks like maybe it supports deps.edn, project.clj, or pom.xml


(which can't have been easy to support)


most build tools do cache 🙂 @alexmiller I am pretty sure you discussed the disadvantages and wonder what your conclucions were? Also, how are transitive versions, that are different, resolved?


there is a #tools-deps channel too

Alex Miller (Clojure team)21:01:03

@hiredman it currently supports only deps.edn but is designed to support others as they are available. I have spent some time on pom and as expected it’s truly awful to use the apis for this. so it’s not done yet. lein is kind of a pain as there is no api to just read a project.clj and get its deps other than naively reading it as if it were data (which certainly won’t always work)

Alex Miller (Clojure team)21:01:04

@sveri it’s git - commits have a relationship. if multiple revs are applicable, the “most descendant” one will be used. if there is no lineage relationship, then this is an unresolvable conflict and your classpath can’t be computed (and you’ll get an error). note that this relationship can even work across forks, because git is awesome. :)

Alex Miller (Clojure team)21:01:21

additionally, most maven artifacts contain the git url + rev when they were created so you can also compare versions between maven and git deps, but I have not actually added that yet


@alexmiller Thanks, I did not know that this even works across forks. Interesting.


I have a dependency free library on github and while trying to pull it with the new deps.edn feature I'm getting the following error:


> Error building classpath. Manifest type :lein not loaded when finding deps


I pushed a pom.xml generated by lein pom but to no avail


pulling data.csv just as in the example works


that's because ATM you can only load libraries that have a deps.edn


I was looking for the file which enabled this, thanks (should've been obvious)

Alex Miller (Clojure team)22:01:17

you can get around this in the dep by forcing a deps manifest

Alex Miller (Clojure team)22:01:32

{:git/url .. :rev … :deps/manifest :deps}

Alex Miller (Clojure team)22:01:49

it should be tolerant of the deps.edn file being absent

Alex Miller (Clojure team)22:01:03

and treat it as an empty deps.edn

Alex Miller (Clojure team)22:01:35

or of course by adding an empty deps.edn to the dependent project

Alex Miller (Clojure team)22:01:27

by default it tries to autodetect the manifest type and it finds the project.clj but doesn’t have a reader for it (yet)

Alex Miller (Clojure team)22:01:17

I should probably change that to just not auto detect those types yet


@alexmiller The deps.edn changes are great -- thanks to you/Rich & the rest of Cognitect. I've been doing some crazy things with lein-voom and scripted repo downloading to achieve the same effect for keeping Onyx and it's ~20 sub-projects all tested against each other. This obliterates so much terrible plumbing.


deps.edn is a game changer, thanks @alexmiller

Alex Miller (Clojure team)23:01:55

I most like that it’s decoupled from clojure so we can release stuff all the time :)