This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-10
Channels
- # announcements (1)
- # babashka (5)
- # beginners (44)
- # calva (45)
- # cider (8)
- # clj-kondo (9)
- # cljdoc (12)
- # clojars (7)
- # clojure (20)
- # clojure-czech (1)
- # clojure-dev (26)
- # clojure-europe (24)
- # clojure-france (8)
- # clojure-uk (1)
- # clojurescript (12)
- # conjure (8)
- # datascript (10)
- # fulcro (7)
- # leiningen (2)
- # malli (19)
- # meander (5)
- # off-topic (113)
- # pathom (3)
- # precept (4)
- # re-frame (13)
- # reagent (19)
- # reitit (3)
- # rewrite-clj (69)
- # shadow-cljs (9)
- # spacemacs (16)
- # tools-deps (1)
- # vim (1)
- # xtdb (10)
@vincenz.chianese is cond->
what you want?
(cond-> 10
true inc)
;; => 11
(cond-> 10
false inc)
;; => 10
moved to #leiningen
Is there a library that parse the fixed with file in Clojure?
Quick google gave me this article - http://www.lexicallyscoped.com/2015/01/05/parsing-flat-files-in-clojure.html but it seems to be overkill for me.
Thanks will give that a try then.
Yes, read in the file with slurp
, then do a (str/split yourstring #"\n")
so you have one array entry per line, then just use subs
with whatever field length you have repeatedly over each line
I am reading in huge file, so will do that lazily
@U39K1NXHP line-seq
lets you handle a line at a time lazily
https://clojuredocs.org/clojure.core/line-seq
This technique can also be used: https://blog.michielborkent.nl/2018/01/17/transducing-text/
You could also get fancy with a spec and use conform
@setzer22 REBL works "in process" so you could use it on the remote machine if you can "project" the UI from that machine onto yours (say via X11 if it's a *nix machine or remote desktop if it's Windows/Mac)...
When I'm on my Windows laptop, I use Xlaunch so that I can run X11 UIs from WSL2 and then appear under Windows. Similar concept but not really "remote".