Fork me on GitHub
#clojure
<
2015-07-17
>
yedi05:07:30

any good clojure lectures come out in the last few months

kamn05:07:30

@yedi If you want presentations https://www.youtube.com/user/ClojureTV usually has some good stuff. They just put up EuroClojure 2015 and Clojure/West videos were put up 2 months ago.

colin.yates08:07:21

@logaan - I find emacs prelude very sane

Pablo Fernandez09:07:49

So, in Clojure I cannot call a function unless it was defined above in the file?

colin.yates09:07:47

yep. You can can (define my-fn-that-is-declared-below) (defn other-fn (my-fn-that-is-declared-below))

pesterhazy10:07:17

@pupeno: it makes writing the compiler easier (you only need a single pass)

meow11:07:34

@pupeno: From what I've seen declare is only used when absolutely necessary, which is rare.

meow11:07:55

And I think I ran into a situation where it didn't work in something like partial because what partial got called with was nil. So declare only saves you when the function is going to be called after it gets fleshed out.

andrewmcveigh12:07:03

@meow: I think that might be the use of def rather than partial

meow12:07:41

(declare foo)
(def bar (partial some-other-fn foo))

meow12:07:51

I think I was doing something like that.

andrewmcveigh12:07:29

@meow: Yeah, that’s gonna take the “value” of foo - which is an unbound fn

andrewmcveigh12:07:34

consider

(def x nil)
(def f (partial x))
(def x 10)

meow12:07:02

It was easy enough to work around. Just thought I'd point it out. Helped me understand that anything declared is basically nil until finally defined.

meow12:07:58

@andrewmcveigh: yep, that's the mental model I have now.

malcolmsparks14:07:50

I've recently been writing a lot more tests, and have been tweaking a little macro I wrote to help - thought I'd release it

jstaffans14:07:44

nice, an :⊃ operator simple_smile

malcolmsparks14:07:27

Ctrl-x 8 RET 😉

colin.yates14:07:37

I have a form which is taking far too long that I need to debug. I want that form and every form it calls to be printed out with timing - is there such a beast?

malcolmsparks14:07:23

clojure.tools.trace almost does it, could you fork it and add timings?

colin.yates14:07:01

@malcolmsparks: thanks - I will take a look

colin.yates14:07:10

(makes me miss AOP :-))

malcolmsparks14:07:45

@jstaffans: yes, it's a smiley. Definitely a library to use on a Friday afternoon simple_smile

gtrak15:07:04

how do you type :⊃

malcolmsparks15:07:36

1. C-8 x RET SUPERSET OF 2. Use 😆 instead 3. Copy and paste it from somewhere else (like you just did)

malcolmsparks15:07:53

oh gosh, slack turned my :> into a smiley

lvh15:07:35

malcolmsparks: C-x 8

malcolmsparks15:07:52

sorry, yes, you're right, thanks

lvh15:07:52

malcolmsparks: (C-8 x is just 8 x'es)

malcolmsparks15:07:03

1. C-x 8 RET SUPERSET OF

lvh15:07:11

That was more informational for standers-by than anything, I'm sure you know that simple_smile

malcolmsparks15:07:14

(i'm busy spinning plates this afternoon)

malcolmsparks15:07:51

@lvh and hopefully some folks will have also learned how to generate xxxxxxxx simple_smile

lvh15:07:54

't Is a tiny Pacman!

malcolmsparks15:07:14

@lvh I like it! send me a PR! simple_smile

lvh15:07:54

malcolmsparks: Huh? PR for which project?

Lambda/Sierra15:07:17

@malcolmsparks: Where does C-x 8 come from?

malcolmsparks15:07:44

@stuartsierra: Emacs (on my system anyway)

malcolmsparks15:07:55

for inserting unicode

lvh15:07:55

@gtrak: Big fan of the Keen avatar simple_smile

gtrak15:07:05

thank you simple_smile

Lambda/Sierra15:07:12

Oh, I see, it's C-x 8 RET

malcolmsparks15:07:37

@stuartsierra: yes sorry, it's friday, lots of typos this afternoon

Lambda/Sierra15:07:45

Cool, thanks for introducing me to that @malcolmsparks

lvh15:07:55

malcolmsparks: I didn't realize this until I just tried it, but helm automatically gave me a usable search box -- I can never remember which order the words GREEK CAPITAL LETTER DELTA go in

malcolmsparks15:07:22

I think you can mostly copy and paste unicode chars from the web, years ago when I had a Mac with UK layout, I used to keep a files of #'s which I could copy from for writing bash scripts... simple_smile

lvh15:07:11

You can still hold keys on Macs, mostly works OK

lvh15:07:41

I have a Polish layout because using timeouts for łąężźó takes way too long

malcolmsparks15:07:58

@lvh - yeah, I didn't realise that until I'd moved off the Mac

lvh15:07:21

malcolmsparks: What platform are you on now, and how's it treating you?

malcolmsparks15:07:57

@lvh: arch linux on a T420 thinkpad (x2)

malcolmsparks15:07:59

not a superfast environment but I'm used to it - will be hard to move off

akiel16:07:22

@malcolmsparks: iota looks very promising - found a small bug

colin.yates16:07:24

@malcolmsparks: ah arch, brings back warm feelings - pacman FTW

akiel16:07:10

@malcolmsparks: wouldn't it be better to use re-find instead of re-matches for :# ? Most of the times I wan't to test for parts of an error message. I don't like to surround all patterns with .*

zerokarmaleft16:07:37

@colin.yates: you could try something like robert-hooke or dire to add pre and post hooks, and add crude timings or use something more rigorous like criterium

colin.yates16:07:37

thanks @zerokarmaleft - I had looked at robert-hooke before it doesn’t quite fit this use-case as I want to decorate the form and any form that is called. Analogous to AOP ‘around’ advice.