Fork me on GitHub

@thedavidmeister: hoplon webdriver tests are looking great


@micha: thanks for the push!


Hi there, I'm looking into building a toy application to learn about the full hoplon stack (i.e. client- and serverside). I see that there is some documentation to get started with the client side, but the page on castra just says "Hello World". Should I be able to find myself around with just the castra readme, or is there anything else what I should read first?


@dot_treo: documentation is sparse at the moment, the README here is probably okay to get started:


@dot_treo: there's also a hoplon-Castra template that demos minimal app with server side


castra doesn't try to do much at all, so this diagram is maybe a good way to see what it's trying to do:


I'm not sure the diagram does much good without any additional commentary


the readme provides some explanation


along with the diagram


i have to run, but i'll be around later if you have questions


well anyway everyone here is friendly so ask away 🙂


will do, if I get stuck 🙂


I want to map li to a cell with a vector. I get an error "is not ISeqable" if I do it this way (map li (cell= (state :past))) but it works if I do it this way (cell= (map li (state :past))). state is a cell defined as a dictionary with :past, :present, and :future. Why doesn't the former method work? (state :past) is a cell and cells aren't sequences, but what if that cell contains a sequence? I'm trying to make undo and redo.


also, how could I make this more efficient? instead of re-rendering all the list items each time an item is added or removed from the vector?


@mhr: (ul (for-tpl [x (cell= (state :past))] (li x))) perhaps?


alandipert: the for-tpl macro takes care of the re-rendering problem?


it still seems to slow down when I call my undo function. I think it probably has more to do with how I wrote undo than the rendering. this is my undo function:

(defn undo! []
  (when (> (count (@state :past)) 0)
    ; move present to front of future
    (reset! state (assoc @state :future (vec (cons (@state :present) (@state :future)))))
    ; set present to final past item
    (reset! state (assoc @state :present (peek (@state :past))))
    ; remove final past item
    (reset! state (assoc @state :past (pop (@state :past))))))


is resetting state an expensive operation?


this is state's definition:

(def state (cell {:past [] :present 0 :future []}))


Can you post the whole page? I can take a look


Nothing sticks out as slow


I've found that if I focus on any of the buttons and press enter so it continuously presses them, then it gets bogged down. if I press inc continuously, for instance, and present is incremented past 100, it gets slower. if I try to undo or redo continuously on a past or future of over 100 items, it also is slow. but on a past or future of about twenty items, it's still quick.


oops, line 55 should have :future, not :past, I made a copy-paste error from your earlier suggestion