This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-10
Channels
- # beginners (7)
- # calva (1)
- # cider (8)
- # clojure (21)
- # clojure-austin (5)
- # clojure-dev (26)
- # clojure-europe (7)
- # clojuredesign-podcast (4)
- # clojurescript (2)
- # code-reviews (4)
- # community-development (4)
- # datomic (1)
- # emacs (14)
- # lsp (21)
- # pedestal (8)
- # polylith (16)
- # reitit (6)
- # releases (2)
- # vim (14)
- # xtdb (5)
There options for doing fancy java-isms from clojure, but sometimes it's easier to just write a bit of java in your clojure project for the non-trivial interop.
Otherwise, which method you use kind of depends on what problem you're trying to solve and why you're trying to extend a class while adding an instance field.
What I am trying to do is to create a record that will store initialisation parameters for Java object and have it implement component/Lifecycle protocol. Upon component startup I need it to return new object extending a Java class but with additional field carrying over the original object with init params so this original object can be returned after the stop is called on component.
You can close over state by defining an atom with a let and then create the proxy object using proxy which can access and mutate the atom
proxy lets you extend a class and interfaces.
i’m away from keyboard, but i can try to give an example later
not sure what you mean by add a new method. you can always create an interface with the method you want and implement it
I would give some example code, but I'm not totally sure I understand the goal
I've built a cli tool, but before releasing it I need to handle config. Including API tokens and URLs. Are there any helpers out there for handling that cross-platform? I've been poking around today but can't find anything.
On Clojure 1.12, can type hinting like ^long*
and ^longs
be used interchangeable everywhere? Or are there any caveats?
I see this cases work the same:
(def sorter ^[longs] Arrays/sort)
(def sorter ^[long*] Arrays/sort)
(defn sorter [^longs arr] (Arrays/sort arr))
(defn sorter [^long* arr] (Arrays/sort arr))
and where aren't they equivalent? Since it looks like they also work the same for selecting methods as values
As a value
Hi guys! I fixed a mistake that I really don't understand. Our CI use github action
. Yesterday, we update the default runner to a custom machine (4cpu, 16GB, ubuntu 22). With this update, some tests started to fail. The tests focused on a function that used io/resource
inside a promesa
futur. The io/resource
inside the futur returned nil
! I tap> to debug and outside the futur the io/resource
returned the good result! Of course, on my local machine (M2 pro) no worries. When I came back to the original runner (default github ubuntu 22) the tests pass! Have you seen something like this.