This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-30
Channels
- # admin-announcements (10)
- # beginners (7)
- # boot (216)
- # cider (10)
- # cljs-dev (3)
- # clojure (71)
- # clojure-denmark (2)
- # clojure-italy (3)
- # clojure-seattle (1)
- # clojurescript (124)
- # cloxp (1)
- # code-reviews (5)
- # core-matrix (2)
- # cursive (34)
- # datomic (3)
- # editors (1)
- # hoplon (201)
- # immutant (2)
- # jobs (3)
- # ldnclj (7)
- # off-topic (3)
- # re-frame (19)
- # reagent (76)
@micha: hi! I see that you posted (input :change ...)
as an example, didn't you say all of these were removed and one should use on!
and do!
?
but you can override them with do!
or on!
multimethod dispatches of your own if you don't like those
(defmethod on! :crazy-event
[elem attribute-key callback]
(.addEventListener elem "crazy-event" callback))
if you do (defmethod on! :click [elem key callback] ...)
then your omplementation will be used instead
how does the call know if to look into the on! or do! multimethods? What if you defined :crazy-event on both methods?
for example, if the value is a function then it knows to call on!
because it's a callback
it's unidirectional in that do!
deals only with setting properties on the element and on!
deals only with receiving events fired by the element
it's either do!
ing something to the element, or calling a callback on!
some event fired from the element
so javelin is for the FRP stuff, and castra is the RPC thing. Why use it instead of ajax?
funny that rest states rpc as complex and now you say the opposite. I guess there are different opinions on the topic
I was asking why all castra requests are POST in a previous post, so I guess you still remembered that
the problem with RPC is when you want to have rpc stubs in the client that are indistinguishable from regular functions
I asked because I remember someone telling me in short that GET is for when you make no side effects on the server. In the case a query would be a GET, which castra surely does
there is no such thing as "no side effects" when talking to the server in a real application
the person's words actually where 'when you fire the GET method n times and you always get the same result'
if you have an immutable thing you just write it to a file and serve it from a cdn, right?
I understand, thanks! I have another question but I have to ask another question before asking the first question - do you mind all these questions?
This is still all very theoretical, but a thought you could clear for me - in the om talk David said it's good to have all state in 1 var. Before hearing him I actually thought of it as a limitation. I understand it can be useful to have all state in 1 place so that it is easy to dump it as a whole. But it seems to have drawbacks, like how do you "listen" to changes deep in the state. Which is probably what cursors were invented for, right. Still the whole thing seems to me upside-down. Wouldn't it be nicer to keep state in small chunks that are a) easy to understand, b) easy to listen on? And you can always just write something that composes them together into 1 var. Does this make any sense?
the big problem with having everything in 1 atom is that everyting in there needs to be named
yeah, seems more logical to me than dumping everything in 1 var. I mean that's why we have vars and scope etc
if you find yourself reimplementing lisp in your program you're probably doing it wrong
who wants to code in a programming language where you can only define 1 global variable
the reason why they like it is because it gives a more or less atomic update kind of semantic
but javelin cells also accomplish that, without requiring a single atom contains all state
on a side-note, I just cloc
d hoplon, javelin, castra and cljson, wth? It's like 4k loc altogether
the entire project in hoplon is about the same amount of lines of code as a single spark template file in the c# app
so you end up doing all kinds of unnecessary or suboptimal things just to get somehting that isn't filled with bugs
when you have 4k LOC total you can add features and maintain your application way more efficiently
I think a lot about productivity when I have to write these VBA monstorsities at my work
reminds me of @alandipert 's comment from your clojurewest talk about the pile of garbage that circles around in the oceans
i'll think a little more and be on later
i'm not a huge fan of .core, i think if we're going to have something redundant in a package name it should be meaningful
the way a hoplon segment would be
e.g. (ns hoplon.javelin) vs (ns javelin.core)
i suppose i would advocate:
hoplon/hoplon -> hoplon(/hoplon) -> hoplon.hlisp?
hoplon/javelin -> hoplon(/javelin) -> hoplon.javelin
hoplon/castra -> hoplon(/castra) -> hoplon.castra
@alandipert: consider the redundancy question in this light:
@xifi: see ya!
hoplon.good-word-for-things-that-interface-with-browser
but then again, it's not something which a beginner can easily guess or keep it mind...
if you're using the hoplon boot task you don't need to know about those namespaces really
alandipert: here is a challenge which might cast a better light on the question:
would you rename javelin.core
to hoplon.javelin
?
micha: what's the usual problem if i get this javelin.core
is not found?
java.util.concurrent.ExecutionException: clojure.lang.ExceptionInfo: failed compiling file:/Users/onetom/.boot/cache/tmp/Users/onetom/p/hoplon-mini-example/n7y/yuvvjw/boot/cljs/main969.cljs {:file #object[java.io.File 0x4bf0aa08 "/Users/onetom/.boot/cache/tmp/Users/onetom/p/hoplon-mini-example/n7y/yuvvjw/boot/cljs/main969.cljs"]}
clojure.lang.ExceptionInfo: failed compiling file:/Users/onetom/.boot/cache/tmp/Users/onetom/p/hoplon-mini-example/n7y/yuvvjw/boot/cljs/main969.cljs
data: {#object[clojure.lang.Keyword 0x4b6d72ef ":file"] #object[java.io.File 0x4bf0aa08 ".../main969.cljs"]}
clojure.lang.ExceptionInfo: Could not locate javelin/core__init.class or javelin/core.clj on classpath.
data: {#object[clojure.lang.Keyword 0x4e7f763e ":tag"] #object[clojure.lang.Keyword 0x4d29351 ":cljs/analysis-error"]}
java.io.FileNotFoundException: Could not locate javelin/core__init.class or javelin/core.clj on classpath.
this is the file it's complaining about:
(ns boot.cljs.main969 (:require tailrecursion.hoplon.app-pages._index_DOT_html))
(do)
@onetom: i would, because hoplon is the name of the effort and group of people aware of that effort who have the most interest in javelin
i suppose the hlisp part is the 1 of 3 parts that isn't useful outside of a "hoplon" app
since it depends on javelin
i guess castra does too
so it would seem that if anything, hoplon is defined more by javelin than anything else lol
maybe we should switch the names