4 ms·
Looks really good! F:"\n"/:0::;C:,[;"\n"];I:`:index.txt;f:-<I;h:C F I;H::F`:chat.htm .z.ws:{s:(" "/:($"du"$.z.Z),,x);{x y}\:[-!.z.W;s];h,::C s;f s}
by geocar 12y ago
Looks really good!
F:"\n"/:0::;C:,[;"\n"];I:`:index.txt;f:-<I;h:C F I;H::F`:chat.htm
.z.ws:{s:(" "/:($"du"$.z.Z),,x);{x y}\:[-!.z.W;s];h,::C s;f s}
.z.po:{(-.z.w)h};.z.ph:{H}
1. "\n"/:0:: occurs twice and can be made a function (F)
2. You can project the `y` argument by itself (C)
3. Shorten symbols (I)
4. No need to (-f) all over the place when -< will do. (f)
5. You can load chat.htm once (H; .z.ph), but unfortunately K4 won't notice changes to the file, so am a bit divided about this one.
6. Save brackets! Join-enlist (,,), negate til (-!), and amend (,::) (.z.ws)
- srpeck 12y agoThanks for the feedback; I pushed your cleaned up version to Github (https://github.com/srpeck/kchat/commit/5669fcca67fa609a9128b0ba65e34aea7adf5486 https://github.com/srpeck/kchat/commit/5669fcca67fa609a9128b...). As for your comment in #5, I noticed that I can hot load new versions of the server and client without impacting the existing clients' web socket connections. A production change to chat.htm only requires me to \l chat.k; any existing connections still have the older client running without interruption until they refresh, but all new connections get the new client. However, I am not all that concerned about hot loading new versions, as this is only deployed for a small team on the intranet.
- geocar 12y agoIndeed! I sometimes use emacs and use an after-save-hook to send a command (e.g. to reload a file).