Fork me on GitHub
#beginners
<
2017-06-06
>
Drew Verlee00:06:07

@grzm i tried the code and got the same result. So no help there

grzm00:06:16

@drewverlee Thanks for following up. I came across (boot (aot :namespace '#{ex.Example})) and that worked for me.

Drew Verlee00:06:39

In https://clojure.org/about/spec Rich talks about “Informational vs implementational” > Invariably, people will try to use a specification system to detail implementation decisions, but they do so to their detriment. The best and most useful specs (and interfaces) are related to purely information aspects. Only information specs work over wires and across systems. We will always prioritize, and where there is a conflict, prefer, the information approach. This seems like a subtle difference to me. If you specification tells you that a height can’t be negative that seems purely informational. But what if a spec told that an area had to be the height * width? Would that be implementational? And if so, how is that better/worse then telling someone the height can’t be negative? Especially when implmementing the function body of a spec i’m having trouble understanding the subtle points. I’m going through the offical docs again to understand at a deeper level what the trade offs are.

noisesmith00:06:19

but there are many objects where the area is not height * width

Drew Verlee00:06:02

@noisesmith if were limited to universally true statements, would that put us on the same table as proofs/types?

noisesmith00:06:16

sorry, that point isn't even relevant to what your asking

Drew Verlee00:06:11

are you suggesting that a speced keyword should be universally true though? Like if you spec ::area then it should be true for all values of what would be considered area? Wouldn’t that limit us to just mathematical functions? Like if i want to create a spec for the idea of ::name, that would meet anyones definition of what could be in a name it would just be the same as Str. Maybe what i’m missing is some Good Idea Bad Idea Implementations of Spec

noisesmith01:06:15

yeah, that's why I apologized, the point wasn't coherent, and furthermore wasn't relevant to this issue

Drew Verlee01:06:56

@noisesmith lol. I thought you were saying my point wasn’t relevant. 🙂 I think: > if were limited to universally true statements, would that put us on the same table as proofs/types? Isn’t really true, or if it is, i don’t understand it. Which makes what i said more philosophical then,, err informed? There is a lot of material on spec i haven’t read through, ill climb through it and then come back with a bit more familiarity.

Alex Miller (Clojure team)01:06:28

@drewverlee I think you’re missing that ::area is just shorthand for :my.namespace/area and you control “my.namespace” - we can have lots of definitions of area as long as you adequately put it in a context you control/understand.

Drew Verlee01:06:33

@alexmiller thanks, that makes sense. What sparked my investigation was I was specing a greatest common divisor FN and I found myself writing the function definition in the spec :fn. I found that I had no good conceptually framework for what a spec should contain. So I'm revisiting the material and paying more attention to the why rather then the how

Alex Miller (Clojure team)01:06:43

yeah, the :fn spec is the tricky one

Alex Miller (Clojure team)01:06:39

they are good for any case where you can check a relationship between the args and the ret, in a way that doesn’t repeat the meat of the function itself (in which case the ret spec is already verifying that)

Alex Miller (Clojure team)01:06:11

yeah, maybe I’ll have time to answer that tomorrow :)

Alex Miller (Clojure team)01:06:35

or troll Rich into answering it :)

seancorfield03:06:30

@drewverlee Seems to me that the Reddit OP is missing the point of Rich’s talk…

seancorfield03:06:22

It wasn’t that Spec can somehow solve the dependency issue, it’s that the higher-level principle of named things being open for extension and using different names for things that are not “compatible” could be applied to artifacts (and therefore address the dependency issue). At least, that was my takeaway from Spec-ulation.

matan05:06:15

question: how do you get the output of a println in the console, even when the next line of code triggers an exception? I think that some programs frequently (or always?) abort without flushing...

matan05:06:23

(I am running in leiningen)

matan05:06:46

it seems quite idiotic debugging some exceptions in the dark like that 😕

akiroz06:06:14

@matan I didn't have problem getting output from the following code in my nREPL session:

(defn foo []
  (println "Hello")
  (throw (Exception.)))

(foo)
mind sharing your code?

akiroz06:06:25

@drewverlee I always thought the Spec-ulation talk has nothing to do with clojure.spec speaking of deps and artifacts.... I used to think the artifact ID and my clojure namespaces were related (like my artifact ID had to be a prefix of my namespaces)... silly me.

alricu18:06:50

hi all, Is there any tutorial or help about how to secure an API (Rest webservice) with a Certificate

alricu18:06:24

I am trying to look for it; but I cannot find usable information

yogidevbear19:06:41

I'm looking to try setup atom + protorepl (again) and was wondering what the general consensus is on best approach. Is this link's description (https://gist.github.com/jasongilman/d1f70507bed021b48625) what most people do? Are there alternative setup steps? I'm coming from a Windows background with no previous emacs or vim experience, predominantly working with ST3 for the past couple years, so looking for the smoothest / most intuitive setup considering my background. I would like to be able to evaluate code inline with protorepl from within atom.

rubek20:06:56

Yeah Jason’s description is what I used, it’s pretty straightforward.

seancorfield20:06:19

@yogidevbear The only caveat I’d give is to disable the three “refresh” options in ProtoREPL’s settings. Jason’s recommended settings tend to cause confusion to beginners who aren’t doing absolutely everything with Component from the ground up.

seancorfield20:06:50

But overall I highly recommend Atom/ProtoREPL. I switched completely from Emacs after the last Clojure/conj — after two solid years of daily Emacs usage (and I’d used Emacs extensively about 20 years before that). I’ve been very happy with ProtoREPL for daily usage on a large codebase.

seancorfield20:06:03

p.s. there’s also a #protorepl channel if you get stuck.

yogidevbear20:06:27

Thanks for all the feedback 🙂

rubek20:06:00

Oh there’s refresh options? Having the repl NOT refresh automatically weirded me out a lot

billbarnhill22:06:42

Hi all. Pretty new to Clojure, and on my first non-web project in it. For various reasons, I have to make a desktop GUI. My options seem to be Seesaw and fn-fx. I like fn-fx better from the look of it, but tests are failing and last commit was 3 months ago. What do you use for desktop GUIs in Clojure?

billbarnhill22:06:13

Found https://github.com/nblumoe/clj-ui-spikes , which looks promisingly informative

billbarnhill23:06:58

So I've had no luck with fn-fx so far. Tried using javafx directly, per the gist below, and it worked. Not pretty, but working. https://gist.github.com/zilti/6286307

gonewest81823:06:42

@billbarnhill: have you looked at Electron? And, for instance, Reagent?

gonewest81823:06:20

We’re using Electron for a desktop app written in javascript and so far it’s been pretty smooth sailing.