This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-14
Channels
- # announcements (31)
- # babashka (9)
- # beginners (4)
- # calva (67)
- # cider (6)
- # clj-yaml (10)
- # clojure (105)
- # clojure-austin (8)
- # clojure-bay-area (1)
- # clojure-europe (12)
- # clojure-germany (3)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-uk (2)
- # clojurescript (5)
- # core-logic (4)
- # data-science (29)
- # datomic (6)
- # dev-tooling (5)
- # emacs (3)
- # hyperfiddle (22)
- # introduce-yourself (4)
- # lsp (8)
- # malli (10)
- # off-topic (8)
- # pathom (74)
- # polylith (39)
- # practicalli (1)
- # reitit (3)
- # shadow-cljs (2)
- # spacemacs (3)
- # squint (4)
- # tools-deps (4)
I'm trying to call https://bitbucket.org/snakeyaml/snakeyaml/src/180363cfff5c9334bdd21b0d38145fa56ceed91c/src/main/java/org/yaml/snakeyaml/events/Event.java#lines-54:56
with (. (. event getStartMark) getLine)
and getting No matching field found: getLine for class java.util.Optional
any idea why?
getStartMark
should return a Mark
instance
and getLine
should return an int
https://bitbucket.org/snakeyaml/snakeyaml/src/180363cfff5c9334bdd21b0d38145fa56ceed91c/src/main/java/org/yaml/snakeyaml/error/Mark.java#lines-121:123
I want the int
line number
hmm https://stackoverflow.com/questions/60989912/dealing-with-java-optionalt-in-clojure
maybe this will help https://github.com/fr33m0nk/optional
I don't yet see where things are defined optional
an optional has the .orElse
method to get the value out, or a default value if the optional doesn't have a value
the way to do this in clojure would probably be:
(some-> (.getStartMark event) (.orElse nil) (.getLine))
nice!