This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-07
Channels
- # admin-announcements (4)
- # beginners (63)
- # boot (67)
- # clara (29)
- # cljs-dev (38)
- # cljsjs (10)
- # clojars (7)
- # clojure (336)
- # clojure-belgium (3)
- # clojure-dev (22)
- # clojure-greece (30)
- # clojure-nl (1)
- # clojure-russia (9)
- # clojure-spain (3)
- # clojure-spec (169)
- # clojure-uk (12)
- # clojurescript (45)
- # clojurex (4)
- # core-matrix (3)
- # cursive (58)
- # datascript (3)
- # datomic (18)
- # events (38)
- # hoplon (228)
- # immutant (5)
- # lambdaisland (6)
- # leiningen (3)
- # luminus (8)
- # off-topic (11)
- # om (113)
- # om-next (2)
- # onyx (10)
- # parinfer (7)
- # planck (22)
- # re-frame (11)
- # reagent (25)
- # robots (7)
- # spacemacs (3)
- # specter (10)
- # yada (3)
cross-post from lein channel
---
Hello all,
I have this specific use case where i need to run $ lein run
with sudo
(i know bad idea, but its just for testing).
does anyone know what this warning is trying to tell me:
WARNING: You're currently running as root; probably by accident.
Press control-C to abort or Enter to continue as root.
Set LEIN_ROOT to disable this warning.
is LEIN_ROOT something i set on my .bashrc
or my .lein
config ?@dviramontes: you can also set it just one time if you add it before lein run
LEIN_ROOT=true lein run
yeah i'm aware that works, but wondering if there's a way to do it the other way... perhaps writing a macro? I'm just being a bit stubborn about it
(let [t (transient [])]
(dotimes [i 10]
(conj! t i))
(persistent! t))
=> [0 1 2 3 4 5 6 7 8 9]
conj
takes an immutable data structure and returns a new immutable data structure that contains the given value
You need to accumulate the intermediate t
values if you want all the integers from 0 to 9 in it
Interesting. I just wanted to wrap both of them into a time
to do a side-by-side comparison, but apparently it's not as easy as it seems 🙂
@alexmiller funny you mentioned it, I am just reading the 2nd chapter of your Clojure Applied
where you are explaining it and doing various experimentations with code snippets of my own. Serendipitous...
why would the space between (inc 199)
and (/ 100 (-7 2)
cause the solutions to differ by 5000?
open a new repl from scratch, try putting and removing how many spaces you want, there's no way that can happen
interesting, it only holds the 5 after it errors from the /100
form and then when eval-ing the next runs (+ (inc 199)(/ 100 (- 7 2)))
returns the 5 and 220
I don't know what repl you're using, but the default clojure REPL doesn't exhibit that behaviour
user=> (+ (inc 199) (/100 5))
RuntimeException Invalid token: /100 clojure.lang.Util.runtimeException (Util.java:221)
5
RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221)
RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221)
iDave-MBP:~ dmbennett$ which lein repl
/usr/local/bin/lein
iDave-MBP:~ dmbennett$ lein -version
Leiningen 2.6.1 on Java 1.8.0_25 Java HotSpot(TM) 64-Bit Server VM