Clojurians
#hoplon
<
2016-03-19
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

thedavidmeister06:03:04

@dm3: wouldn’t that have the same problem i had?

dm306:03:34

yeah, I'm highlighting the fact that there's no good solution to that currently

thedavidmeister08:03:55

hey, so, maybe a dumb question, but if i use symbol to build a symbol, how do I get at what that symbol refers to?

dm309:03:11

a symbol doesn't refer to anything

dm309:03:29

in Clojure you have Vars interned in a namespace

dm309:03:40

so a namespaced symbol may be resolved to a var

dm309:03:50

or a non-namespaced resolved to var in the current ns

dm309:03:52

Clojurescript didn't have Vars until recently, things just compiled into javascript functions/variables

dm309:03:10

not sure how dynamic things are now

dm309:03:40

you can certainly eval clojurescript in clojurescript now

thedavidmeister09:03:51

i’ll see if i have the latest version

thedavidmeister09:03:28

these tests are written in clj

thedavidmeister12:03:52

@dm3: yeah, OK, thanks

thedavidmeister12:03:12

so, if i have (def foo “bar”) and i run foo i get ”bar”

thedavidmeister12:03:29

how do I get ”bar” from (symbol “foo”)?

dm312:03:17

in Clojure you get Var using (def foo-var (resolve *ns* 'foo)) then deref the var to get its value @foo-var

dm312:03:33

in Clojurescript I don't think you can do that

thedavidmeister12:03:08

lol, i never would have figured that out

dm312:03:15

you can try (var foo)

dm312:03:27

or look at cljs.test sources

dm312:03:37

to see how it's implemented

thedavidmeister12:03:49

(var (symbol "foo”)) did not work

dm312:03:52

no, I don't think it will

thedavidmeister12:03:16

@(resolve (symbol "foo”))

dm312:03:29

in clojurescript?

thedavidmeister12:03:46

just in the repl

dm312:03:02

var is a special form, not a function

dm312:03:17

so only (var foo) will work

dm312:03:27

that's what #'foo is read into

thedavidmeister12:03:42

thanks for the help

thedavidmeister14:03:07

yay, tests are passing. thanks again @dm3

thedavidmeister15:03:06

is with-page-load broken?

flyboarder17:03:12

@thedavidmeister: you can create these multimethods in your own app and hoplon will use them, so they are available across all elements

flyboarder17:03:27

I also recently learned this