clojure-uk

A place for people in the UK, near the UK, visiting the UK, planning to visit the UK or just vaguely interested to randomly chat about things (often vi and emacs, occasionally clojure). More general the #ldnclj
jiriknesl 2020-10-22T03:30:07.250400Z

Good morning

dharrigan 2020-10-22T06:25:47.250600Z

Good Morning!

mccraigmccraig 2020-10-22T06:44:46.250900Z

!!måning

alexlynham 2020-10-22T08:37:15.251Z

morning

dharrigan 2020-10-22T09:55:55.251800Z

Style question, when using type hinting (for interop stuff), do people perfer this

dharrigan 2020-10-22T09:56:37.252600Z

(defn foobar ^FunkyReturnType
      [some-magic-variable]
      ....

dharrigan 2020-10-22T09:56:39.252800Z

or

dharrigan 2020-10-22T09:56:58.253300Z

(defn foobar
   ^FunkyReturnType
   [some-magic-variable]
   ....

dharrigan 2020-10-22T09:57:43.253800Z

type hint on same line or separate line of the defn name

alexlynham 2020-10-22T10:01:31.253900Z

separate lines if you do args on separate lines prob?

mccraigmccraig 2020-10-22T10:39:39.254200Z

mild preference for separate lines

dharrigan 2020-10-22T10:43:46.254600Z

I think I'll go with separate lines, as yes, my variables are on a separate line

2020-10-22T10:54:03.255100Z

I prefer alot of short lines because it make stacktraces more precise to diagnose what bit actually went wrong

2020-10-22T11:03:34.255700Z

and often enough a stacktrace is all you have got to go on...

thomas 2020-10-22T11:30:11.256Z

mogge

dominicm 2020-10-22T11:47:53.256400Z

@dharrigan neither. Same line as args.

dominicm 2020-10-22T11:48:19.257200Z

You can have different return type per arity, so the type isn't on the function per se.

alexlynham 2020-10-22T13:27:57.257300Z

ah good i see boris whipped the tories to block free school meals over school holidays

alexlynham 2020-10-22T13:28:22.257400Z

a really good look at a time of already acute food poverty x coronavirus crisis

alexlynham 2020-10-22T13:28:30.257500Z

long sigh

alexlynham 2020-10-22T13:29:06.257600Z

imagine getting up in the morning, looking in the mirror and going 'yes i am the sort of person that actively wants children to be hungry'

alexlynham 2020-10-22T13:29:10.257700Z

what a motivator eh

dharrigan 2020-10-22T13:48:17.257800Z

ah, so you would have something akin to:

dharrigan 2020-10-22T13:48:33.258Z

^FunkyReturnType [some-magic-variables]

dharrigan 2020-10-22T13:48:54.258400Z

I don't think Boris would see his reflection in the mirror

😆 3
2020-10-22T15:13:19.259400Z

yeah hes got a picture of a mirror; and that picture shows the reflection of Chris Tarrant

2020-10-22T15:29:52.259600Z

so he lives his life blissfully unaware

seancorfield 2020-10-22T16:53:18.260700Z

(with a "docstring" on the line(s) between the function name and the return type/args)

dharrigan 2020-10-22T17:06:28.260900Z

cool, thank you.

dominicm 2020-10-22T17:11:23.261100Z

^ I like that one