Fork me on GitHub
#clojure
<
2016-03-25
>
crocket11:03:27

I feel that somehow clojure constructs are more elegant than haskell ones.

crocket11:03:59

The way clojure handles recursion, map, filter, etc feels more elegant.

borkdude12:03:28

@crocket: the dynamic nature of clojure can sometimes bring more convenience (and elegance, although highly subjective)

crocket12:03:46

It's not just dynamic nature of clojure that brings more convenience.

crocket12:03:16

There are dynamic or lisp languages that aren't as elegant.

borkdude12:03:46

@crocket: you were comparing to Haskell, so I meant to ask for an example of this

crocket12:03:07

I can't think of a good example right now, but clojure syntax is easier to read and write than haskell's.

crocket12:03:32

It's definitely easier to write due to haskell's picky syntax rules.

borkdude12:03:47

I agree with that

crocket12:03:47

easier to read due to simple syntax rules.

crocket12:03:12

Haskell's picky indentation makes it more difficult to read and write in haskell.

lvh13:03:13

I don’t know if anyone here cares about object capabilities, but for some crossing the stream stuff: here’s applications of relational programs to them 😄 https://people.cs.kuleuven.be/~dominique.devriese/obj-cap-log-rel-eff-param.pdf

ccann18:03:27

anyone know of a tool that detects and removes unused dependencies in your project.clj?

richiardiandrea18:03:58

I think lein-ancient can detect outdate deps, not sure about unused though

arrdem18:03:41

https://github.com/clojure-emacs/refactor-nrepl would be the most likely suspect, and it looks like it can't do that.

arrdem18:03:28

You'd have to somehow construct a mapping from namespaces to classpath elements and classpath elements to dependencies, then tree shake.

arrdem18:03:44

Doable but requires a lot more runtime introspection than most things try to achieve.

hiredman18:03:11

there are, um, I guess you call them dependency patterns that would break with that

hiredman18:03:15

some of the jre apis allow you to override and specify plugins or whatever via property files on the classpath

hiredman18:03:19

but I will say, encounters with that have been few and far between for me

roberto20:03:52

Anyone knows if clj-aws-s3 is still being maintained? https://github.com/weavejester/clj-aws-s3

weavejester20:03:28

roberto: Unfortunately not. It’s not a library I’ve used in a while.

roberto20:03:37

ok, thank you for replying, and for the library. I really like it, but just stumbled on something I need to do but the library doesn’t support. I’ll probably fork it and see if I can make it do what I want.

roberto20:03:09

it would probably save me some extra work if the s3-client was not private tho simple_smile

weavejester20:03:31

The original idea was that I didn’t want to expose the underlying implementation in the public API

weavejester20:03:47

But in retrospect s3-client probably should be public.

roberto20:03:08

yeah, I need to reuse it so I can call list-object over and over to get a large list of s3 files

roberto20:03:28

yeah ,I was using that initially, but your library was much more easier to use. It just felt ergonomically better

weavejester20:03:28

s3-client should be automatically reused. It’s memoized.

roberto20:03:41

yeah, but I can’t use it in my own function

roberto20:03:00

for example, I need a new list-objects that takes an ObjectList instead of creds and bucket name

roberto20:03:26

so I can call listNextBatchOfObjects

roberto20:03:31

yeah, I was wondering why it wasn’t listing all the files on the bucket, until I read the javadoc.

danielcompton21:03:39

The url is the repo to deploy to. You can just use :clojars, as Leiningen knows about Clojars as a special place. Join #clojars for more help on this if you like.

shriphani22:03:32

Hi a question about schema. I want to define a type as (or A B). I can’t seem to find any docs for it.

jr22:03:27

the comment mentions using conditional instead

bfabry22:03:43

@shriphani: (cond-pre A B)

shriphani22:03:25

@jr: thanks for the links.

kenny22:03:55

Is there a way to have the expected value in clojure test return the result rather than the code that was used to generate that result? Example:

(is (= (let [x 1
               y 2]
           (+ x y)) 4))

arrdem22:03:02

(let [res (let [x 1 y 2] (+ x y))]
  (is (= res 4))
  res)

kenny22:03:56

Do you need the double let?

arrdem22:03:03

@kenny: no you can collapse them, so long as you let-bind the result you want to is test and then return.

arrdem22:03:23

(let [x   1
      y   2
      res (+ x y)]
  (is (= res 4))
  res)
would be better