Fork me on GitHub
Ian Fernandez04:12:36

Help with sente, I need to force a receival of a message in a channel before the channel closes / webserver turns off. I'm using gniazdo for websocket client

Ian Fernandez21:12:41

There's no way to make a blocking call to a sente socket or something like this?


Forcing another computer on a network to do anything is a tall order

😂 1
😢 1

Anyone know why I'm getting Must hint overloaded method: get when I try to load this code (`TemporalAccessor` is from java.time.temporal)? Doesn't seem like there's anything else to hint...

(defrecord DefaultingDateTime [^TemporalAccessor date-time
                               ^TemporalAccessor default]
  (^int get [_this ^TemporalField field] (or (^int .get date-time field)
                                             (^int .get default field)))
  (getLong [_this field] (or (.getLong date-time field)
                             (.getLong default field)))
  (isSupported [_this field] (or (.isSupported date-time field)
                                 (.isSupported default field)))
  (query [_this query] (or (.query date-time query)
                           (.query default query)))
  (range [_this field] (or (.range date-time field)
                           (.range default field))))


I don't think (^int .get date-time field) is valid, is it?


it might not be, it was an attempt to Hint All The Things! 😆 and didn't affect the error I was getting on load


get is a default method on the TemporalAccessor interface -- I wonder if that's throwing Clojure's reflection off? Otherwise, it does seem you have everything hinted.


yeah I wondered about that too


I suppose I could work up a minimal test case for that to see if it's a bug


It's not a bug. A method named get is also automatically provided by one of the interfaces that defrecords automatically implement


@U050ECB92 ah, that makes sense. I wondered if it was related to how generic and common get is as a method name. so... no workaround then?


perhaps not using a record


yeah, just using reify fixes it. thanks again @U050ECB92!


In this case, the message did not hit the nail on the head. Hints were not the problem; a collision was the problem. Would it be feasible for the message to juxtapose the two(+) things that were not distinct? e.g., Associative/get and TemporalAccessor/get? I do not see this "Must hint..." message in the Clojure Jira. If I am barking up the right tree, would an enhancement suggestion to clarify the message be well received?

👍 1