hoplon

The :hoplon: ClojureScript Web Framework - http://hoplon.io/
2018-03-17T14:03:07.000043Z

what's going on here??

2018-03-17T14:03:31.000112Z

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

2018-03-17T14:10:21.000116Z

is this something to do with javelin?

candera 2018-03-17T14:10:55.000001Z

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

candera 2018-03-17T14:11:21.000084Z

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

2018-03-17T14:12:51.000042Z

mmm that's bad

candera 2018-03-17T14:13:02.000151Z

It works most of the time.

2018-03-17T14:13:09.000019Z

completely WSOD me on prod and can't reproduce locally πŸ˜•

candera 2018-03-17T14:13:45.000084Z

Advanced compilation different between the two contexts?

2018-03-17T14:13:58.000003Z

nah, using advanced

2018-03-17T14:14:03.000081Z

ok, hmm now i can reproduce

2018-03-17T14:14:04.000109Z

weird

2018-03-17T14:16:52.000135Z

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

2018-03-17T14:17:00.000002Z

but that could just be a coincidence...

2018-03-17T14:17:43.000197Z

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

2018-03-17T14:19:01.000017Z

i'm just guessing at this point...

candera 2018-03-17T14:20:23.000097Z

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.

candera 2018-03-17T14:20:43.000045Z

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

2018-03-17T14:20:46.000030Z

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?

candera 2018-03-17T14:21:14.000111Z

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

2018-03-17T14:21:44.000032Z

or a weird combination of the two...

candera 2018-03-17T14:22:05.000124Z

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

2018-03-17T14:22:25.000039Z

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

2018-03-17T14:22:31.000024Z

for now i just have to get prod back up πŸ˜›

candera 2018-03-17T14:22:52.000009Z

Good luck!

2018-03-17T14:23:46.000024Z

might need to "borrow" some more of your code in the next hoplon branch πŸ˜‰

2018-03-17T14:23:59.000020Z

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

candera 2018-03-17T14:24:06.000100Z

It’s already part of Javelin.

2018-03-17T14:24:10.000055Z

oh ok

2018-03-17T14:24:21.000088Z

well good then πŸ™‚

2018-03-17T14:25:52.000036Z

@candera ah i c

2018-03-17T14:26:03.000010Z

it's like a magic defn

candera 2018-03-17T14:26:15.000050Z

?

2018-03-17T14:26:33.000091Z

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

candera 2018-03-17T14:26:54.000045Z

Sure, I could see that.

2018-03-17T14:27:01.000076Z

well fn actually

candera 2018-03-17T14:27:25.000018Z

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

candera 2018-03-17T14:27:50.000089Z

And because I had trouble with cell=

2018-03-17T14:27:53.000041Z

mmm

2018-03-17T14:28:32.000001Z

i like it

2018-03-17T14:28:44.000072Z

i'd also support it being called fn πŸ˜›

2018-03-17T14:29:12.000088Z

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

candera 2018-03-17T14:29:32.000121Z

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

candera 2018-03-17T14:29:34.000124Z

πŸ˜‰

2018-03-17T14:29:40.000118Z

tempting

candera 2018-03-17T14:29:57.000067Z

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

candera 2018-03-17T14:30:04.000045Z

It’s not defining a function.

2018-03-17T14:30:25.000081Z

well what does "formula of" mean?

candera 2018-03-17T14:30:34.000055Z

It’s a Javelin concept. Well-defined.

2018-03-17T14:30:40.000026Z

hah ok

2018-03-17T14:30:53.000014Z

formula and function are pretty interchangeable words in other contexts

candera 2018-03-17T14:30:54.000013Z

If you want something short I suggest fm.

2018-03-17T14:31:00.000001Z

yeah

2018-03-17T14:31:10.000080Z

save me some typing

2018-03-17T14:31:19.000120Z

cell= is pretty common

candera 2018-03-17T14:31:22.000106Z

I’m not big on short names myself.

candera 2018-03-17T14:31:34.000022Z

Right. Defines a formula cell. πŸ™‚

2018-03-17T14:32:30.000013Z

yeah you know what, i can just do it

2018-03-17T14:32:39.000007Z

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

2018-03-17T14:32:45.000066Z

i also don't like aliases much

2018-03-17T14:33:00.000094Z

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

candera 2018-03-17T14:33:10.000148Z

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

πŸ‘ 1
2018-03-17T14:33:16.000120Z

me too

2018-03-17T14:33:24.000051Z

very quickly lose track of what letters mean what

candera 2018-03-17T14:33:36.000108Z

Yes, my brain is too tiny to remember more than one or two things. πŸ˜›

2018-03-17T14:33:40.000130Z

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

2018-03-17T14:34:05.000070Z

h, j, d (datascript), spec

2018-03-17T14:34:12.000148Z

that's it for me...

2018-03-17T14:34:39.000017Z

oh, and is and deftest πŸ™‚

2018-03-17T14:37:10.000052Z

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

2018-03-17T15:26:50.000012Z

@candera formula-of fixed it!

2018-03-17T15:26:58.000033Z

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

2018-03-17T15:27:01.000067Z

that didn't fix it on prod

2018-03-17T15:27:02.000141Z

only local

2018-03-17T15:45:30.000064Z

so i don't know what the problem was, but it's fixed now πŸ™‚