clj-yaml

Ingy döt Net 2023-08-14T03:20:47.967969Z

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?

Ingy döt Net 2023-08-14T03:21:50.640079Z

getStartMark should return a Mark instance

Ingy döt Net 2023-08-14T03:24:38.678649Z

I want the int line number

Ingy döt Net 2023-08-14T03:29:40.584639Z

maybe this will help https://github.com/fr33m0nk/optional

Ingy döt Net 2023-08-14T03:30:17.812699Z

I don't yet see where things are defined optional

borkdude 2023-08-14T10:45:59.907419Z

an optional has the .orElse method to get the value out, or a default value if the optional doesn't have a value

borkdude 2023-08-14T10:46:34.699169Z

the way to do this in clojure would probably be:

(some-> (.getStartMark event) (.orElse nil) (.getLine))

Ingy döt Net 2023-08-14T15:38:40.488259Z

nice!