Fork me on GitHub
#clojure
<
2017-04-22
>
vitruvia00:04:51

I'm very new by the way

noisesmith00:04:26

< is not generic

noisesmith00:04:31

it only works on Number

noisesmith00:04:47

try using compare

noisesmith00:04:20

(also there's a #beginners channel)

vitruvia00:04:00

I see it doesn't work on other stuff, I just don't understand the syntax. Like what is 0 and 1 supposed to be in this case, is it a reference to the arguments?

noisesmith00:04:44

0 means equal, less than or greater than 0 tells you which arg is larger https://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html

noisesmith00:04:55

it works on anything implementing the above interface

Alex Miller (Clojure team)01:04:11

You mean less than or greater than 0 :)

noisesmith01:04:35

oh yes, of course, thanks

noisesmith01:04:59

I was thinking 0 and typed 1

qqq07:04:32

what's a good shorthand for "combinator" i.e. something that takes two or more things and creates a new thing out of it

harkonnen09:04:28

How do I import Incanter properly? I have this in my profiles.clj [incanter "1.9.1"] and I get this error: Could not transfer artifact org.clojure:clojure:pom:1.3.0-alpha2 from/to clojure (http://build.clojure.org/releases): Ac cess denied to: http://build.clojure.org/releases/org/clojure/clojure/1.3.0-alpha2/clojure-1.3.0-alpha2.pom , ReasonPhra se:Forbidden. This could be due to a typo in :dependencies or network issues. If you are behind a proxy, try setting the 'http_proxy' environment variable.

harkonnen09:04:47

If I remove the import it works fine

sveri11:04:13

@harkonnen My first guess would be that there is a transitive dependency somewhere in incanter to clojure-1.3.0-alpha2 which cannot be accessed. You can check that by showing all dependencies with leiningen. You could try to exclude clojure-1.3.0-alpha2 from the incanter dependency. I only wonder, you say you have the dependency in your profiles.clj and not project.clj?

dominicm12:04:30

@hiredman could it be the sharing that clojure does when reading strings?

stardiviner12:04:25

What does the _ mean in anonymous function in this code:

clojure
(clojure.string/replace "mississippi" #"(.)i(.)"
                        (fn [[_ b a]]
                          (str (clojure.string/upper-case b)
                               "--"
                               (clojure.string/upper-case a))))
;;=> "M--SS--SS--Ppi"

dominicm12:04:08

_ is an idiom in clojure for "unused var"

dominicm12:04:53

In this case, the first parameter in the vector (`[1 2 3]` for example) is being dropped. So to continue the example, it's assigning b to 2, and a to 3, but ignoring the 1.

stardiviner13:04:04

So in this case, _ is used for the regex sequence like:

stardiviner13:04:13

clojure
(re-seq #"he(ll)o,.*" "hello, world") ;=> (["hello, world" "ll"])

dominicm13:04:32

Yep, it's ignoring the "hello, world" in the matches

bronsa13:04:06

important to notice that _ is a variable name like any other, it's just conventionally used for ignored arguments but it doesn't have any special meaning

harkonnen14:04:38

@sveri I assumed that if I put it in there I don't have to have it in every single project.clj... 😄

lincpa14:04:18

@harkonnen :dependencies [[clj-time "0.8.0" :exclusions [org.clojure/clojure]] [org.clojure/clojure "1.9.0-alpha14"] [incanter "1.9.1" :exclusions [clj-time joda-time org.clojure/clojure org.clojure/clojure-contrib org.clojure/core.cache org.clojure/math.combinatorics]] ] :pedantic? :abort

lincpa15:04:49

it's better using R by JRI

harkonnen15:04:03

Doesn't seem to work... when I just use this :dependencies [ [org.clojure/clojure "1.8.0"] [incanter "1.9.0" :exclusions [clojure-1.3.0-alpha2]] ] then lein deps works

lincpa15:04:51

incanter 1.9.0 has a bug

lincpa15:04:13

must be 1.9.1

harkonnen15:04:15

Okay, thanks

harkonnen15:04:35

Apparently my problem is with ancient and plz

harkonnen15:04:51

If I comment out everything else then it works

harkonnen15:04:06

Well, at least it works now. Thanks!

lincpa15:04:40

:pedantic? :abort let all lib using a new edition

lincpa15:04:31

let R as DB, JRI as JDBC, R lang

lincpa15:04:42

all thing will simple, Example

fantomofdoom16:04:20

Hi, advise the development ide or editor with plugin for clojure, thanks

dominicm16:04:51

@fantomofdoom Cursive is a good IDE. ProtoREPL+Atom is good. Vim+Fireplace is good. Emacs+Cider is good.

hiredman19:04:33

@dominicm I thought it was the reader, but I after @alexmiller said I was I wrong I looked at the code and the only string interning that happens is in the compiler

hiredman19:04:40

user=> (apply identical? (read-string "[\"foo\" \"foo\"]"))
false
user=> 

lxsameer21:04:52

I'm looking for a html->markdown convertor lib , do you know any ?

tbaldridge21:04:27

Is that possible? Theres a lot in HTML that doesn't match directly to markdown

lxsameer21:04:24

yeah but i'm going to parse simple html text

zakwilson21:04:36

@vitruvia (< 0 1) is always true, so the function is your snippet is equivalent to (fn [a b] b), and reducing it over a sequence will always return the last item.

dominicm22:04:18

The metadata on function vars I'm currently seeing. Is that part of clojure core? Cider nrepl? Something else? Curious in it's availability for tooling.

noisesmith22:04:31

it's something clojure.core does and the basis of most of the useful editor tooling

noisesmith22:04:03

it's also useful directly in the repl, it's how clojure.repl/source, clojure.repl/doc etc. work

dominicm22:04:56

Mmhm, I knew it was there. I just wanted to confirm it was a feature of clojure.core. I'm working on a fork of bikeshed, and I want to enhance some output.