Fork me on GitHub
#clojure-uk
<
2020-01-17
>
seancorfield05:01:09

Early... ๐Ÿ™‚

dharrigan06:01:56

Well, my merry little production clojure application is happily chugging along. Over 3,000,000 trips ingested since yesterday

dharrigan06:01:32

Still another 18,000,000 odd to go...but I'm confident ๐Ÿ™‚

8
dharrigan06:01:05

@seancorfield I don't quite follow the statement from yesterday. Okay, in general something is catching the exception, but I don't want it to do that. Since I set the setDefault exception handler, shouldn't it a. overwrite what is there, or b, how on earth then does Stuart's example work, if main catches??

seancorfield06:01:00

If you run a Clojure program via clojure.main -- the -m argument -- then clojure.main is the entry point and it calls your code and it has a try/`catch` so it can do the abbreviated exception reporting (one line, with the stacktrace written to a temp file).

seancorfield06:01:42

You will only get the uncaught exception handler invoked if clojure.main fails to catch it ๐Ÿ™‚ Which it won't. So it only applies if your code is the entry point, i.e., if you AOT and have a main class of your own.

dharrigan06:01:08

so, if I change the code to be (:gen-class), don't I still need clojure.main to launch it?

dharrigan06:01:22

that part is still a bit woolly for me

seancorfield06:01:12

If you make an uberjar with a manifest that specifies your namespace as the main class, and it's AOT'd, then clojure.main is not involved.

seancorfield06:01:21

You're using depstar, yes?

dharrigan06:01:06

yes, and maybe I've missed out a step...

dharrigan06:01:13

java -cp uxh.jar clojure.main -m core

dharrigan06:01:28

works, but java -jar uxh.jar does not

dharrigan06:01:43

so perhaps I'm forgetting to specify the main class

dharrigan06:01:48

during depstar

dharrigan06:01:52

yes, missing the -C option...

dharrigan06:01:55

experimenting

dharrigan06:01:29

% java -jar uxh.jar                    
foooobar

dharrigan06:01:39

verrrrrry good

seancorfield06:01:36

So it would be clojure -m hf.depstar.uberjar uxh.jar -C -m core as long as you've generated a pom.xml file (`clojure -Spom`)

dharrigan06:01:47

yup, did that - just there now

dharrigan06:01:08

it's a pity (can't seem to see) that deps.edn doesn't have like "extra-opts"

seancorfield06:01:13

(not sure Java lets you have a single segment class name like that, BTW)

dharrigan06:01:17

that get's passed in after main-opts

seancorfield06:01:33

You just put them in :main-opts as extra strings

seancorfield06:01:35

:main-opts ["-m" "hf.depstar.uberjar" "uxh.jar" "-C" "-m" "core"]

Ben Hammond11:01:26

oh I didn't know he was in Basil Brush

maleghast11:01:12

I have already posted on #jobs, but on the basis that everyone may not be looking at it or being alerted by it.. https://cervest.earth/jobs-platform-engineer/

๐Ÿ‘ 8
dharrigan11:01:29

He was fantastic in Yes (Prime) Minister

๐Ÿ˜ญ 4
flefik22:01:01

this is very sad news.

Gulli18:01:18

Why is 'low fat' such a big thing in the UK?

guy21:01:57

cos theres lots of fat people ๐Ÿ˜„

mccraigmccraig11:01:23

and the inference that fat makes you fat and/or ill seemed so obvious, despite the lack of evidence

Rachel Westmacott10:01:17

low fat typically means high sugar - which is probably worse for most people - I personally have a mild preference for avioding 'low-fat' food

3Jane18:01:16

it's one step in health fads behind the US - you gotta wait some more years 'til they switch to "sugar kills, eat low carb"