This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-24
Channels
- # beginners (19)
- # boot (118)
- # capetown (4)
- # cider (37)
- # cljs-dev (69)
- # cljsjs (23)
- # clojure (212)
- # clojure-austin (10)
- # clojure-india (3)
- # clojure-italy (2)
- # clojure-mke (1)
- # clojure-nl (1)
- # clojure-russia (5)
- # clojure-spec (52)
- # clojure-uk (86)
- # clojurescript (31)
- # core-async (9)
- # cursive (123)
- # datomic (91)
- # emacs (22)
- # events (3)
- # hoplon (68)
- # klipse (4)
- # lambdaisland (10)
- # leiningen (2)
- # off-topic (14)
- # om (14)
- # onyx (44)
- # perun (14)
- # proton (20)
- # re-frame (15)
- # reagent (10)
- # ring-swagger (9)
- # specter (18)
- # untangled (3)
- # vim (26)
- # yada (4)
Where is the documentation on writing new boot tasks from scratch? Suppose I wanted to wwirte a task whose only job in life was (clojure.java.shell/sh "cp" "foo" "bar")
https://github.com/boot-clj/boot/wiki/Tasks <-- weird, do I need to pass some fileset around?
(deftask cp
[]
(with-pass-through _
(clojure.java.shell/sh “cp” “foo” “bar”)))
I think that should work@qqq all tasks get and return filesets by design but there’s the with-pass-through
helper to to the kind of thing you want to do (i.e. plain side effects)
@qqq Once you have something working please consider extending that wiki page to include with-pass-through
🙂
@martinklepsch : minor correction: on my version of boot, with-pass-through seens to have been renamed with-pass-thru ; do I need to update my boot?
@qqq ah, no, it’s with-pass-thru
, my mistake
haha, you’re welcome 🙂
Where should I put load-data-readers
If I want to be able to use clojure.edn/read-string
?
looks like this is being done done in boot: https://github.com/boot-clj/boot/pull/439/files
@alqvist are you on latest boot?
@alqvist I think you may need to do that for pods individually — try googling I think there should be a few good results
https://github.com/boot-clj/boot/issues/47 & http://hoplon.discoursehosting.net/t/question-about-data-readers-with-datomic-and-boot/99 most notably
I think the gist is to use something like this but probably there’s a better/simpler solution by now:
(#'clojure.core/load-data-readers)
(set! *data-readers* (.getRawRoot #’*data-readers*))
you could try adding this to your build.boot: (boot.core/load-data-readers!)
boot.core/load-data-readers!
yeah! @pesterhazy was faster ;D
just add it just after set-env! ...
off-topic but I just solved the SICP eight queens problem 🙂
status: feeling good about myself
congrats! (don’t know the problem. reminds me that I should get back to SICP some day)
You doing it in clojure?
scheme
debugging with racket is really hard for me
I'm using #lang sicp
but that's a very basic language 🙂
so I had this bug slash misunderstanding
Racket is nice and weird at the same time somehow, I just can’t wrap my head around the idea that someone thought it would be a good idea to be able to return multiple values 😄
and you sort of forget how you use pretty-printing and other tools to debug
@martinklepsch it's a perf thing
I feel like in a foreign and deceptively familiar country, but I don't know what to do when I need help
> He [Rich] left out multiple value returns exactly on the grounds that the consing cost for a small returned value is so cheap these days, ephemeral GC's being so damned good. Dan Weinreb http://blog.h2o.ai/2008/11/a-brief-conversation-with-david-moon/
returning multiple values on old lisps was nice because you could put each value in a register and pay no added GC cost
arguably still nice today.. for that reason
Thanks to both of you. Seems like I must provide an argument to clojure.edn/read-string
something like: (clojure.edn/read-string {:readers *data-readers*} (slurp "schema.edn))
@alandipert cool link, thanks!
I don't understand why read-string doesn't use it by default, but there is always a reason.
@alqvist did you try the approach @pesterhazy suggested?
yeah looks like only clojure.core/read-string
takes default-data-readers into account
clojure.edn/read-string
expects readers to be passed explicitly
probably a good idea because default-data-readers is an "implicit argument", could be confusing
you bet
shoud my boot version in build.boot and build.properties match ? Is it okay to have build.boot use 1.9.0-alpha14, and build.properties say 1.7.0, or should they both be 1.9.0-alpha14 ?
https://github.com/alandipert/boot-war-example/blob/master/build.boot#L4 is how i've been doing it recently
since it's usually best if they match
...ime
yes, should build.properties/BOOT_CLOJURE_VERSION and build.boot/set-env!/:depenedencies/org.clojure.clojure versions match ?
yeah it's usually good for them to match
the build.boot file is executed with some version of clj, the one given by BOOT_CLOJURE_VERSION/boot.properties
calling (clojure-version) is a way to sense what version is running
it's clojure.core/clojure-version
the semi-magical thing going on there is boot.core/template
which is a templating macro like ` except it doesn't try to resolve symbols
maybe a bot?
i guess a 'hook' is the term
@micha how do you feel about supporting multline comments in boot files?
in order to support racket-style multiline shebang https://rosettacode.org/wiki/Multiline_shebang#Racket
i almost got it without, kinda
#!/usr/bin/env bash
true; echo "hello from bash"
true; exec boot "$0" "$@"
^^ all valid clj
problem with it is boot doesn't sense shebang
woah nice
yeah that works lol
but not useful because you want to stay in pwd
maybe edit self in place, and un-edit with shutdown hook? lol
oh, like copy to hidden randomly named file in cwd you mean?
less than ideal, since you can't always creat files in dirs you're exec-ing from
(not to derail the topic) -- is this the legendary micha we needed to talk to about edit distance / potential optimizations for templates / lists ?
haha yes but best to do it in #hoplon
> ruby -x skips every line until the first Ruby shebang. This line must start with "#!" and must contain "ruby". (So "#!ruby" is the shortest shebang to work.)
I’m not sure if this is a fundamental misunderstanding of clojurescript or cljs-repl or boot or emacs (because all are relatively new to me) - but I can’t seem to figure out how to cider-eval-last-sexp against a running cljs-repl… am I misunderstanding cljs-repl ?
@mattyulrich cider
does not have support for cider-jack-in
directly landing in a cljs repl
you have to jack in, then execute start-repl
, are you doing that?
multi-line comments ticket in clj http://dev.clojure.org/jira/browse/CLJ-714
declined by rich, so available for boot!
@richiardiandrea That was it… I think I had tried something like that initially, but thought it didn’t work because the start-repl
didn’t put me back on a prompt.. Thanks for the help!
@mattyulrich no problem, it is a bit annoying, I was planning to work on it a bit, glad it helped
@alandipert : bad idea to diverge from clojure in this way imho. where does it stop? there's no real problem here, i think. go with rich (TM). 😉
why's it bad not to stop?
i guess the further we get from clj, the less about build.boot you know if you already know clj
supporting multiline shebang is really handy tho
maybe there is another way. research will continue
strikes me as a shell language issue rather than a boot issue. must be a way without messing with the lang.
like any meaty problem there are many concerns
ultimately it's a developer convenience issue, and so is totally subjective
ie the problem statement begins at taste
that it's more convenient for me to write a single small boot shebang script instead of 2 scripts, 1 shell and 1 boot, and shell launches the boot one
well, i'm kinda out of my league here, but wtf. i would not want boot to make a special language thingie to support shellish stuff. otoh, shellish stuff is very useful. what about a micro-language, e.g. bootsh? i prolly should have thoughr about this some more before commenting.
i definitely agree, alignment with clj is a good default
and this would be our first syntactic departure