Fork me on GitHub
#boot
<
2016-05-18
>
hlolli16:05:35

Just a thought about possible changes in boot. Because I use emacs cider and often change Cider Boot Parameters in Customize options. That would be, send the user a warning if a requested task is not defined instead of not starting boot. I guess this could either be in boot itself, that all undefined tasks in command line will cause a warning, or in cider that looks for if a tasks exists before executing it?

martinklepsch16:05:58

@hlolli: I'm not sure I understand this: "Because I use emacs cider and often change Cider Boot Parameters in Customize options. " What does the customize have to do with unknown Boot tasks?

hlolli16:05:13

So to run a task I do: M-x customize-variable cider-boot-parameters and add there my predefined tasks. Maybe I'm doing it wrong?

hlolli16:05:56

So I may enter a task that exists in one project but not another. And every time I re-run cider, I will remove/add the corresponding tasks. No issue here of course. Mainly thinking about newcomers.

hlolli16:05:50

Well just a thougt, maybe a bad idea.

martinklepsch16:05:19

@hlolli: I think it's good that things break if a task does not exist but I also see why one would want this

martinklepsch16:05:35

@hlolli: I'd probably suggest to have a my-cider like function. That's how I do it (with inf-clojure but that doesn't matter I guess)

martinklepsch16:05:19

(have that function in emacs so you don't customize the default cider function but instead have the default & a customized one)

hlolli16:05:00

Yes good point! Ok, there reason I got thinking about this is that I shared my emacs with a friend of mine to run a boot based app I made. Then he hit the error that the task boot-cider task didn't exists, so I had to explain to him to remove it from my config. I guess an easy solution is not to share an emacs config with any task defined besides the repl 🙂

hlolli16:05:53

ok end of argument (on my behalf), breaking sounds very preventive actually.

martinklepsch16:05:57

you probably should avoid having tasks in build.boot which are defined in places like profile.boot

hlolli16:05:47

yes boot-cider is in ~/.boot profiles.

martinklepsch16:05:21

you could also customize the build.boot to see if boot-cider is defined and only use it in that case

hlolli16:05:02

I actually had that exact idea, I made a check if the symbol was defined.. let me show you...

hlolli16:05:16

the task was actually called cider forgot. But this was my attempt

(if-not (nil? (resolve 'cider))
 (deftask cider nil))

martinklepsch16:05:02

(comp (if (bound? #'cider)
        cider
        identity)
      (repl))

hlolli16:05:38

nice, didn't know about bound? thanks, I think I will add this for safety.

hlolli16:05:57

is there a possibility to see if a user is running from lighttable, I noticed lighttable requires some middleware for boot... well I can research that myself.

martinklepsch16:05:12

I think bound? checks if the var has a value vs. resolve which would also return a (declare foo) var if I understand correctly

hlolli16:05:51

ok, I read about declare long time ago on stackoverflow. So I'm not surprised I'm using it incorrectly

martinklepsch16:05:07

probably not important for your use case but just learned about the difference myself so thought I'd share 🙂

hlolli16:05:47

nice, I read slack channels just to see what people are sharing.

hlolli18:05:29

well, to add to the previous discussion, the problem with bound? is that it will throw an exception instead if just saying false.

richiardiandrea19:05:30

Wowo heroku is launching a Kafka service