Fork me on GitHub
#beginners
<
2016-02-15
>
jonahbenton01:02:35

hey @olegakbarov, can you say more? maybe you want a variant of partial? memoize will return a function that you can call like your original function, but it will use the parameter you pass on calls to that function as a key to cache the results. it will return the cached value on subsequent calls with that same parameter value. it sounds like perhaps you want to ensure that subsequent calls to a function are made with the same parameter value- which is a common use case for partial

Josh Horwitz04:02:02

Learning Clojure is so frustrating!!! I feel like I just suck at it

mikeb05:02:52

@joshua.d.horwitz keep at it, it's worth it! What are you having problems with?

seancorfield06:02:33

Sometimes there can be quite a "hump" and it can be frustrating until the next light bulb moment.

timaeus16:02:56

hello, small question: if in a repl I do (use 'name-of-namespace.core :reload, how do i make libraries required in that namespace available in the repl? For example, I required selmer.parser :as selmer, but am getting a CompilerException java.lang.RuntimeException: No such namespace: selmer error.. What am I overlooking?

timaeus16:02:59

(I have declared the dependency in the project.clj and have ran lein deps)

val_waeselynck16:02:40

@timaeus: please show us exactly what you typed in, just to rule out a typo simple_smile

timaeus16:02:20

(use 'html-templating.core :reload)

val_waeselynck16:02:50

@timaeus: then you probably want to (in-ns 'html-templating.core)

val_waeselynck16:02:12

otherwise, you'd have to recreate the require and use clauses in the user namespace

timaeus16:02:38

@val_waeselynck: ah ok, is this for any particular reason?

val_waeselynck16:02:55

let me be clearer: require is not transitive in what it makes available in your scope

val_waeselynck16:02:25

so using html-templating.core won't give you the aliases defined in it

val_waeselynck16:02:49

So to wrap up: 1. if you just want to call selmer, stay in your user namespace and just (require '[selmer.parser :as selmer]) 2. if you want to recreate the experience of writing html_templating/core.clj in the REPL, (in-ns 'html-templating.core)

timaeus16:02:38

okay simple_smile that’s clear, thanks

Josh Horwitz16:02:21

I’ve learned the syntax, and different functions etc.. but trying to think the Clojure way or functional way is for some reason being incredibly hard.

Josh Horwitz16:02:37

Or even reading and seeing what a program is doing is difficult

meow17:02:14

@joshua.d.horwitz: Read other functional books, like The Little Schemer

Josh Horwitz17:02:08

@meow: Thanks! I do have that, but haven’t worked all the way through it

Josh Horwitz17:02:30

I could maybe do a blog about working through it in Clojure

roberto17:02:09

@joshua.d.horwitz: something that helped me get in the functional mindset was the Programming Language course in Coursera

roberto17:02:24

I don’t think it is offered anymore, but you can find the video lessons on youtube

roberto17:02:40

the SML part of the course was probably my favorite

roberto17:02:48

there is also a Racket part

meow17:02:56

@joshua.d.horwitz: Do a blog. And use Perun - it will help you learn functional thinking.

meow17:02:27

And what @roberto suggests as well.

roberto17:02:09

that link only has the ML portion, you might be able to get the Racket part also. He does a great job of showing the strengths and weaknesses of both.

meow17:02:38

@roberto: I'll be at Clojure/west - what kind of drink am I buying you for your birthday?

roberto17:02:45

hehehe, Cider simple_smile

meow17:02:56

Cider it is, my friend.

Josh Horwitz17:02:21

I really appreciate it

Josh Horwitz17:02:29

What do you guys use as far as blogging?

roberto18:02:23

but you should use whatever you feel comfortable with. Wordpress is a fine to start off with.

roberto18:02:31

you don’t have to worry about deployment nor fees, etc

roberto18:02:10

if you have time to experiment, then try a static site generator

akiva18:02:13

@joshua.d.horwitz, I rolled my own. It’s my favorite way to learn a new language.

Josh Horwitz18:02:55

I have used Cryogen a little bit, seemed pretty cool

akiva18:02:07

Cryogen’s great.

meow18:02:59

I recommend Perun (and boot)

meow18:02:15

Since you want to learn functional thinking.

meow18:02:36

@joshua.d.horwitz: ^

Josh Horwitz18:02:09

Great! I’ll start on that tonight

Josh Horwitz20:02:46

@meow: Perun seems quite complicated

meow20:02:39

@joshua.d.horwitz: So? Go to the #C053K90BR channel for support.