Fork me on GitHub
#beginners
<
2015-07-25
>
meow13:07:58

I just came across something I haven't noticed before. In some code the following var was def'd: (def foo nil) and then later was referenced as #'foo

meow13:07:47

I'm curious about the #' pound-quote usage.

meow13:07:48

so its a reader macro that expands to (var foo)

meow13:07:53

my interpretation of how this is being used is within a function to delay the lookup of the symbol until runtime because by then the value of foo will have changed and the function needs the value of foo at that point in time, rather than the nil value that foo is initially given.

meow13:07:16

somewhat related to (declare foo) I believe

meow13:07:40

no, that doesn't make sense

meow13:07:35

it's being used to get the Var object itself, instead of the value of the Var

meow13:07:08

funny how long it takes to grok such simple things as vars and symbols, in spite of many years of programming experience

colin.yates13:07:34

it is a useful trick to access private vars in a different namespace when testing as well

meow14:07:44

@colin.yates: yeah, SO actually had some really good answers to this question

meow14:07:25

makes me think "how have I been able to do any programming in clojure at all without fully groking vars and symbols?"

meow14:07:58

and the more I learn, the more it feels like I've only started down the rabbit hole

colin.yates14:07:14

I don’t think that feeling ever ends 😉

meow14:07:06

in a way its a good sign that the language/ecosystem is alive and flexible and growing

meow14:07:42

and there are definitely parts that are way more familiar now that I've been working with clojure for several weeks

meow14:07:24

so there is some progress and familiarity with at least part of this infinite rabbit hole

colin.yates14:07:07

add emacs into the mix (although I would strongly recommend Cursive over emacs if the choice is there) and it never ends!

meow14:07:28

I've used emacs in the past, though never at an expert level. I tried to use/like spacemacs but didn't. I just started using Cursive and really like it.

colin.yates14:07:59

I use Cursive for Clojure but I am trying to invest in emacs for everything else (book reviewing, writing, note taking etc.)

meow14:07:12

For a while now I've been using LightTable as a crutch, since I started with it first.

colin.yates14:07:52

org-mode is my current black hole. I find this tension though on the mac to use all the pretty things simple_smile

meow14:07:41

I think I just have to accept that I'm not going to be one of those people who do amazing things with their editors.

meow14:07:05

For me I just want to know it well enough to have a productive workflow.

meow14:07:27

A super-productive workflow would be nice, I'm just not sure I'm capable of it, and that's okay.

colin.yates14:07:08

yeah, me too/neither

colin.yates14:07:50

I do like the fact that no learning is ever wasted in emacs though - I love the ‘one way to do everything’ approach it has.

meow14:07:25

Very true. I may go back to emacs, but for now it's Cursive and REPL stuff I'm focusing on. And with all the changes happening with tooling for cljs I just want something stable, although I think the emacs and cider stuff has improved a lot lately as well.

meow14:07:47

Structural editing is my current rabbit hole there. Never worked that way in the past.

colin.yates14:07:19

ohh - you will hate it and then love it simple_smile.

colin.yates14:07:57

To be honest (might get shot) but I think the Cursive story is much more capable than the emacs story for hybrid Clojure/ClojureScript projects.

meow14:07:43

I'm really focusing on ClojureScript so, yeah, that makes Cursive pretty appealing.

jwm15:07:36

lighttable is pretty amazing

jwm15:07:44

kind of blows cursive out of the water too hehe

jwm15:07:54

unfortunately it lost its main maintainer

jwm15:07:28

sublime-like keymappings meets instarepl, cljs websocket browser integration

jwm15:07:37

codemirror that you can theme indefinitely

jwm15:07:57

starts up faster than intellj also and is completely opensource simple_smile

kamn15:07:02

lighttable was great for beginning Clojure. I got though a lot of the 4clojure problems with it but I think that Cursive is better for heavier programs

jwm15:07:27

I’ve switched over to emacs land

jwm15:07:43

added ctrl+enter and ctrl+shift+enter for evaluation to cider

meow18:07:57

Can someone explain the difference between alter-var-root and set! in the context of (def foo nil) followed by some function that needs to modify the value of foo?