This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-30
Channels
- # admin-announcements (3)
- # aws-lambda (12)
- # beginners (88)
- # boot (73)
- # capetown (6)
- # carry (16)
- # cider (8)
- # cljsjs (7)
- # clojure (90)
- # clojure-belgium (4)
- # clojure-dev (19)
- # clojure-greece (41)
- # clojure-portugal (1)
- # clojure-quebec (4)
- # clojure-russia (25)
- # clojure-spec (172)
- # clojure-taiwan (1)
- # clojure-uk (76)
- # clojurescript (82)
- # cursive (37)
- # datavis (2)
- # datomic (46)
- # devcards (1)
- # emacs (4)
- # euroclojure (6)
- # events (1)
- # hoplon (31)
- # jobs (1)
- # keechma (9)
- # off-topic (4)
- # om (7)
- # onyx (65)
- # other-languages (15)
- # pedestal (1)
- # planck (50)
- # proton (1)
- # re-frame (40)
- # reagent (7)
- # spacemacs (14)
- # spirituality-ethics (37)
- # testing (1)
- # untangled (2)
- # yada (44)
Hi, I'm not clearly understand why a clojure.core (in same way as clojure.string) uses wrong location (before var) for type hints where the http://clojure.org/reference/java_interop#typehints says that the type hints should go before arguments vector. Is the documentation outdated?
@niwinz: it's not wrong location. it's and "outdated" (not really deprecated although I wish it was) way of type-hinting
After reading this: https://groups.google.com/d/msg/clojure/9ZmaZI6NO1I/99XTvn9kAgAJ and 3 following emails
In fact, @alexmiller says in that thread that typehints on var are invalid position... but clojure has a bunch of typehints on supposedly invalid location
No, it's really confusing :)
@niwinz: type hints on argvecs are not problematic anymore since 1.7 or 1.8 can't remember
if you're using <1.8.. then it's confusing. if you're using >=1.8, just put the type hints on the argvec and it's going to do what you mean to do (assuming you're using the correct type hint obviously :) )
@bronsa: you are right, I found very strange errors when using typehints on argsvec but in 1.8 they does not happens
@bronsa: what about functions with multi-arity?
Repeat the type hint on each argvec or put it on the var?