Fork me on GitHub
#beginners
<
2017-03-16
>
danp06:03:14

In this snippet, I'm creating a protocol for WereCreature at ➊, with full-moon-behaviour [x] as a method signature at βž‹. When I get to ➌, I'm defining a record WereWolf with fields name and title, but just wanted to check my understanding on the next few lines (5-7).

danp06:03:15

The doc for defrecord is as such:

clojure.core/defrecord
([name [& fields] & opts+specs])

danp06:03:41

Am I right in thinking that lines 5-7 constitute a spec for implementing the WereCreature protocol, defining the full-moon-behaviour method for the WereWolf record type?

noisesmith06:03:24

Each spec consists of a protocol or interface name followed by zero
  or more method bodies:

danp06:03:00

@noisesmith Cheers, I saw that pretty much immediately after I sent the last message!

danp06:03:36

looking at your answer to @sifou yesterday, this looks similar in the subject matter...

danp06:03:07

is there any reify going on here, when a WereWolf is created in line 9, for instance?

noisesmith06:03:50

reify creates an instance of an anonymous class

noisesmith06:03:09

defrecord defines a class that acts kind of like a hash-map but has extra methods you specify

danp06:03:26

Ok, that makes sense. Thanks very much πŸ™‚

yonatanel16:03:49

Is there a way in leiningen to disable deploy to clojars? It seems way too easy to deploy private jars by mistake.

lucianboboc21:03:23

Hi guys, i’m having a hard time to configure the InteliJ Community IDE for Clojure

lucianboboc21:03:30

Are there are tutorials for this?

shaun-mahood21:03:49

@lucianboboc: Are you just getting started with Cursive? Or trying with just IntelliJ?

lucianboboc21:03:28

my issue is that the IDE can’t find any Clojure SDK

lucianboboc21:03:00

i have installed Clojure throug leiningen

shaun-mahood21:03:49

There are some issues that can occur if you have older versions, not sure specifically which things to check though - did you follow the instructions from the Cursive site?

lucianboboc21:03:43

yes but those seems to be a little old to, the IDE is a little different