Fork me on GitHub
#boot
<
2015-09-06
>
cigitia06:09:45

If, in one task, you add and commit some new files as resources, how would you access them by filename in tasks after that in the same pipeline?

cigitia06:09:07

boot.core/user-dirs, input-dirs, user-files, etc. return unordered sets, through which one would have to filter through sequentially to find a specific output file at a specific input path.

cigitia06:09:23

…Oh, wait, I can just use . Whoops.

martinklepsch13:09:17

You can also get TmpFile records like this (get (:tree fileset) “your-file.edn”)

micha13:09:11

@martinklepsch: would you be interested in hacking on this guy at clojutre https://github.com/adzerk-oss/zerkdown

micha13:09:20

need to think of a better name for it

micha13:09:02

it's an abstract markdown parser, i.e. you configure it with the tags it will parse and it produces an AST that you can use to generate whatever you want, not just html

micha13:09:36

basically abstracting the markdown syntax

micha13:09:23

it can parse block tags now, no inline tag parsing yet

martinklepsch15:09:02

@micha I don't immediately see what I would do there tbh. :satisfied:

micha15:09:56

it's only half designed and like 1/4 implemented

martinklepsch21:09:50

@micha: why would I use that in comparison to some plain wrappers that are elided when goog.DEBUG is nil?

micha21:09:27

i'm not familiar with that, do you have an example?

martinklepsch21:09:25

(when ^boolean goog.DEBUG
  (js/console.log “x”))
:compiler-options {:closure-defines {“goog.DEBUG” false}}

martinklepsch21:09:08

It’s basically the same as the goog-define stuff we talked about a day ago or so

micha21:09:11

seems like more work to configure

micha21:09:20

and more code to write simple_smile

micha21:09:27

and equivalent to macros

micha21:09:51

also the (spy-> ...) would be difficult to implement with goog.DEBUG i think

micha21:09:13

also the string interpolation is handy, or i think so anyway

micha21:09:21

basically i don't ever want to mess with :compiler-options because it's closed, not open

micha21:09:38

the env is open and can coordinate with other things

micha21:09:51

instead of hidden in a task's options

martinklepsch21:09:55

Is spy basically like a trace? print thing, return thing?

micha21:09:24

you can use it like (-> foo bar (spy-> "the thing") baz baf)

micha21:09:27

for example

micha21:09:40

to see what the value is in there without disrupting the thread

micha21:09:46

it returns the value and logs it

micha21:09:26

it doesn't need to be in a threading macro of course

micha21:09:50

(let [foo (spy-> (+ 1 1) "two")] ...)

martinklepsch21:09:09

Probably I missed some aspect but I think in general totally possible:

(defn spy-> [f msg]
  (when ^boolean goog.DEBUG (log f))
  f)

martinklepsch21:09:45

In theory that when call isn’t even necessary if your log fn already does it of course

micha21:09:27

right, but they're equivalent it seems

micha21:09:42

and using macros avoids messing with the compiler

martinklepsch21:09:00

but it means messing w/ macros and more code you need to maintain

micha21:09:19

i already wrote the code, and i'd have to maintain the function code too

micha21:09:29

so i don't see what the advantage would be

micha21:09:39

and not involving the goog compiler is a plus imo

micha21:09:01

like macros already work well, and the same as all the other lisp things

micha21:09:23

doing some arcane goog compiler magic seems like a regression

micha21:09:45

this will also work with optimizations :none

martinklepsch21:09:54

The above will too.

micha21:09:01

no goog compiler involved

martinklepsch21:09:40

I don’t think one approach is more valid than the other. I happily take the shortcut the closure compiler provides if it does what I need simple_smile

micha21:09:54

it would be a long-cut for me simple_smile

micha21:09:25

in either case you have to write a bunch of functions

micha21:09:46

and i bet if i wrote it as goog.DEBUG functions i'd end up writing macros to generate the functions

micha21:09:51

to avoid mass cutpaste

micha21:09:08

and i'd be right back where i started 😄

micha21:09:47

string interpolation isn't cool enough to warrant macros?

micha21:09:14

(debug "the #{i}th value is ~(nth value i)")

martinklepsch21:09:20

String interpolation is cool

micha21:09:00

i thought the world had gone mad

micha21:09:43

i'm basically factoring things out of the current project at work and putting them in the oss pile

micha21:09:22

it feels like removing code which is satisfying

martinklepsch21:09:33

I’d like to show off an alternative impl but I guess that has to wait for now

micha21:09:12

sweet! i would enjoy to see it

micha21:09:57

lol you have push access to the repo 😉

martinklepsch21:09:28

haha — My feeling is it would be much easier to read but that’s just speculation 😄

micha22:09:59

the js people need goog.DEBUG because they don't have macros

micha22:09:06

so goog makes a special case thing for it

micha22:09:09

when they can

micha22:09:14

but it's still coconuts

micha22:09:46

lisp >> special case compiler directives imo