Fork me on GitHub
#clojure-uk
<
2016-09-16
>
maleghast05:09:46

@agile_geek @thomas Congrats Thomas, I continue to be mortified by what’s going on back at home - watching from over here in Manila it’s like watching a slow-motion train wreck… 😞

maleghast05:09:35

@martintrojer I don’t have a Euro bank account, but would it be a good idea to go to USD, do you think?

kevin4208:09:39

I’ve heard that there’s isn’t even enough real gold and it’s been oversold.

maleghast08:09:11

@martintrojer I am made nervous by @kevin42’s point, which I have also heard.

korny08:09:01

Goedemorgen!

korny08:09:39

My savings are still in AUD, thankfully, but I’ll be needing to transfer them here next year when we want to move houses.

korny08:09:49

My pension is also in AUD, as well 🙂

korny08:09:40

Though I’m not sure I have any confidence in the Australian economy either - there’s no brexit-style madness there, just a lot of shortsighted governments and lack of any sort of investment in anything but digging fossil fuels out of the ground

korny08:09:03

anyway ObClojure...

korny08:09:49

Anyone got a favourite command-line parsing tool that isn’t tools.cli? My main use case is I want something that can take the same parameter multiple times, which just doesn’t fit the tools.cli model as far as I can tell.

korny08:09:44

e.g. I want to have something like my-prog -input foo.txt -category foo -input bar.txt -category bar -input baz.txt -category baz

thomas08:09:41

@korny couldn’t you do

my-prog -inputs foo.txt baz.txt -category foo baz

korny08:09:22

Not sure that tools.cli lets you have multiple values for a key. I could do my-prog -inputs foo.txt,bar.txt of course

thomas08:09:57

I ever have never used tools.cli so no idea… just a thought that came to mind though

korny09:09:21

I’m not sure it’s going to be very user-friendly to have to match the inputs positionally though. (Not that it’s going to be very user friendly anyway… :)

korny09:09:11

I’ll probably just write something quick and dirty - it should be pretty easy - just always keen to look for a library rather than reinventing the wheel

tcoupland09:09:05

could you use a parse function to produce a vec?

korny09:09:21

yeah - I’m thinking something that returns [ [:input “foo.txt”] [:category “foo”] [:input “bar.txt”] [:category “bar”] ] and so on would be easy enough

korny09:09:36

and then custom code to pair up inputs and categories

tcoupland09:09:04

ah, your not just after multiple entries for one param, but for params to kind of refer to each other

korny09:09:43

of course tools.cli is like it is, because that’s a GNU standard. Maybe I should look at how people recommend handling this sort of param while being GNU-standards compliant

korny09:09:10

(though post #brexit I should of course be ignoring standards inflicted on us by foreigners)

korny09:09:15

hmm, actually GNU allows it "Options may be supplied in any order, or appear multiple times. The interpretation is left up to the particular application program."

korny09:09:48

ah, you can do it with tools.cli, it’s just a bit obscure:

:assoc-fn     A function that receives the current option map, the current
                  option :id, and the current parsed option value, and returns
                  a new option map.

                  This may be used to create non-idempotent options, like
                  setting a verbosity level by specifying an option multiple
                  times. ("-vvv" -> 3)

                  ["-v" "--verbose"
                   :default 0
                   :assoc-fn (fn [m k _] (update-in m [k] inc))]

tcoupland09:09:37

your interdependent options are the tricky bit though 🙂

korny09:09:32

I’ll just have to mandate that for every :input there must be a :category -it’d be enough to validate that the total number of inputs and categories must match

korny09:09:40

My main interest was being able to specify multiple inputs - I’ve had that problem before, it’s good to know that there’s a mechanism other than just making them comma separated and parsing them by hand

jonpither13:09:15

who is Euroclojure-ing?

korny13:09:43

Not this year 😞 A bit too close to our due date, and I’m out of leave / training leave already. Will be at XT16 though

jonpither13:09:40

thinking XT16 is going to sell out now, just a small handful of tickets left

benedek13:09:55

exactly as @korny said 😉

martintrojer14:09:55

man the xt16 hype is crazy

martintrojer14:09:03

think about us speakers

martintrojer14:09:28

I mean, who'll write my slides?

thomas14:09:15

same as @korny here.. no EuroClojure this year (as I’ll be busy moving to my new and super exciting Clojure job, so it is worth missing it this time I reckon) but XT16 here we come!

jasoncourcoux14:09:38

I'm going to be there - I've managed to persuade my fiance she'd like a break in Bratislava, so going to do a couple of days euroclojure-ing and then a couple making up for the fact I've been antisocial...and probably come back to the hotel after a few glasses of wine!

jasoncourcoux14:09:00

Not been to a Clojure conference before so really looking forward to attending two in a row - and hopefully meet some of you

korny14:09:09

I’m a bit sad - been to the last 3 euroclojures, the first one from Australia, and all were excellent. But if nothing else, 3 weeks before the baby is due is not a time to be overseas.