Fork me on GitHub
#hoplon
<
2018-03-17
>
thedavidmeister14:03:07

what's going on here??

thedavidmeister14:03:31

how can email be undefined if it is part of the fn signature?

thedavidmeister14:03:21

is this something to do with javelin?

candera14:03:55

Try it with formula-of instead - cell= is sort of finicky.

candera14:03:21

If it works with formula-of then it’s probably a macroexpansion bug in cell=. It’s pretty much why I wrote formula-of

candera14:03:02

It works most of the time.

thedavidmeister14:03:09

completely WSOD me on prod and can't reproduce locally 😕

candera14:03:45

Advanced compilation different between the two contexts?

thedavidmeister14:03:58

nah, using advanced

thedavidmeister14:03:03

ok, hmm now i can reproduce

thedavidmeister14:03:52

hmm, looks like if i only put email in the cell= once it works

thedavidmeister14:03:00

but that could just be a coincidence...

thedavidmeister14:03:43

like, maybe it potentially breaks in advanced compilation if a cell= references the same cell more than once?

thedavidmeister14:03:01

i'm just guessing at this point...

candera14:03:23

Well, formula-of is way simpler than cell=, which is why I suggest trying it. You can also use the underlying formula form to eliminate code walking from the picture. I don’t really trust code-walking, which is why I suspect it here.

candera14:03:43

formula-of also does not code walk, to be clear.

thedavidmeister14:03:46

the __$1 looks a little suss to me, like it's incrementing to a new symbol name instead of using the same one twice maybe?

candera14:03:14

That could be a variable introduced by cell= or it could just be the cljs compiler - no idea.

thedavidmeister14:03:44

or a weird combination of the two...

candera14:03:05

Yep. Hence my suggestion to pare down towards a more minimal situation.

thedavidmeister14:03:25

mmk i'll checkout formula-of when i've got time

thedavidmeister14:03:31

for now i just have to get prod back up 😛

candera14:03:52

Good luck!

thedavidmeister14:03:46

might need to "borrow" some more of your code in the next hoplon branch 😉

thedavidmeister14:03:59

can you flick me a link to formula-of on github?

candera14:03:06

It’s already part of Javelin.

thedavidmeister14:03:21

well good then 🙂

thedavidmeister14:03:03

it's like a magic defn

thedavidmeister14:03:33

the structure of formula-of looks a lot like defn to me

candera14:03:54

Sure, I could see that.

thedavidmeister14:03:01

well fn actually

candera14:03:25

It’s really just a thin wrapper around formula, mostly because I found it confusing to do by hand.

candera14:03:50

And because I had trouble with cell=

thedavidmeister14:03:44

i'd also support it being called fn 😛

thedavidmeister14:03:12

so i could do (j/fn [x] (* x x))

candera14:03:32

(def fn j/formula-of). Boom.

candera14:03:57

Obviously that would be in your own namespace, so go for it. But I think it’s a mistake.

candera14:03:04

It’s not defining a function.

thedavidmeister14:03:25

well what does "formula of" mean?

candera14:03:34

It’s a Javelin concept. Well-defined.

thedavidmeister14:03:53

formula and function are pretty interchangeable words in other contexts

candera14:03:54

If you want something short I suggest fm.

thedavidmeister14:03:10

save me some typing

thedavidmeister14:03:19

cell= is pretty common

candera14:03:22

I’m not big on short names myself.

candera14:03:34

Right. Defines a formula cell. 🙂

thedavidmeister14:03:30

yeah you know what, i can just do it

thedavidmeister14:03:39

clojure saves so much typing, i can always put a little back in

thedavidmeister14:03:45

i also don't like aliases much

thedavidmeister14:03:00

there's a handful that i use a ton, like h for hoplon and j for javelin

candera14:03:10

Like I said, I’m a fan of more descriptive names, even when it comes at the expense of brevity.

thedavidmeister14:03:24

very quickly lose track of what letters mean what

candera14:03:36

Yes, my brain is too tiny to remember more than one or two things. 😛

thedavidmeister14:03:40

and it's easier to refactor if i can search the whole project for something

thedavidmeister14:03:05

h, j, d (datascript), spec

thedavidmeister14:03:12

that's it for me...

thedavidmeister14:03:39

oh, and is and deftest 🙂

thedavidmeister14:03:10

this is definitely one of those situations where i really didn't need formula-of until i really did

thedavidmeister15:03:50

@candera formula-of fixed it!

thedavidmeister15:03:58

but it wasn't the duplicate use of the symbol...

thedavidmeister15:03:01

that didn't fix it on prod

thedavidmeister15:03:30

so i don't know what the problem was, but it's fixed now 🙂