This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-21
Channels
- # beginners (55)
- # cider (13)
- # cljdoc (4)
- # cljsjs (1)
- # clojure (11)
- # clojure-spec (7)
- # clojure-uk (9)
- # clojurescript (42)
- # docs (5)
- # figwheel-main (9)
- # fulcro (4)
- # graphql (4)
- # hoplon (27)
- # keechma (32)
- # leiningen (11)
- # luminus (2)
- # nyc (2)
- # off-topic (73)
- # parinfer (1)
- # re-frame (36)
- # reagent (2)
- # reitit (6)
- # ring-swagger (3)
- # shadow-cljs (51)
- # spacemacs (4)
- # tools-deps (17)
- # uncomplicate (1)
native interop is hard 😧 Just functions wouldn't be so bad, but typedefs complicate things significantly. I'm trying JNAerator at the moment, but I'm not getting quite what I would expect, less than things.
@U5NEPT90U we have a test
profile in project.clj with following injections
:injections [(require 'clojure.spec.test.alpha)
(clojure.spec.test.alpha/instrument)
(.println System/err "Instrumented specs")]
this doesn't instrument anything for me. the code runs, but apparently the specs haven't been defined yet at the point where instrument is called.
i have specs organized in separate files. so for foo.clj
there is foo_spec.clj
. and foo.clj
contains the line (load "foo_spec")
so the specs live in the same namespace.
Is there a way to refer to a generated class inside of the namespace that generates it using shorthand? E.g.
(ns forkjoin.tasks.FibonacciTask
(:gen-class
:extends java.util.concurrent.RecursiveTask
:init init
:constructors {[Long] []}
:state state))
(defn -init [n]
[[] n])
(defn -compute
[^forkjoin.tasks.FibonacciTask this]
(let [n (.state this)]
(if (<= n 1)
n
(let [f1 (forkjoin.tasks.FibonacciTask. (dec n))
f2 (forkjoin.tasks.FibonacciTask. (- n 2))]
(.fork f1)
(+ (.compute f2) (.join f1))))))
Instead of forkjoin.tasks.FibonacciTask
, could FibonacciTask
be used somehow?