This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-08
Channels
- # announcements (6)
- # babashka (78)
- # beginners (84)
- # bristol-clojurians (5)
- # calva (50)
- # chlorine-clover (45)
- # cider (14)
- # clj-kondo (18)
- # cljs-dev (2)
- # clojars (2)
- # clojure (387)
- # clojure-android (3)
- # clojure-europe (6)
- # clojure-gamedev (3)
- # clojure-germany (3)
- # clojure-nl (18)
- # clojure-spec (5)
- # clojure-uk (36)
- # clojurescript (8)
- # clojurex (1)
- # conjure (1)
- # css (1)
- # cursive (32)
- # data-science (1)
- # datomic (11)
- # docker (61)
- # duct (17)
- # emacs (7)
- # figwheel-main (3)
- # fulcro (19)
- # jobs-discuss (3)
- # joker (1)
- # leiningen (23)
- # malli (11)
- # mount (6)
- # off-topic (30)
- # pathom (14)
- # pedestal (2)
- # phzr (1)
- # re-frame (11)
- # reagent (3)
- # reitit (5)
- # ring-swagger (3)
- # rum (1)
- # shadow-cljs (113)
- # slack-help (9)
- # spacemacs (16)
- # specter (4)
- # sql (14)
- # vscode (2)
- # windows (3)
- # xtdb (12)
Any ideas as to why Cursive refuses to recognize arity>1 method implementations within deftype
definitions in .cljc files, while the same code is fine inside .clj files? (It seems that this does not happen for everyone so maybe there's a setting somewhere)
Or more precisely, it's the method implementations inside a deftype
that are not recognized as such, instead I get complaints about wrong arities
The problem actually occurs only when a method's arity is 2 or more. And just for cljc, not for clj. This screenshot is for cljc, and the bar
method shows an "incorrect arity 2" error.
I've been able to get confirmation of this issue from a couple of colleagues using the latest Cursive, and one instance of "works for me" from one Cursive 1.8.x user. Which version do you have?
Thanks for the help, I submitted an issue about this. Unfortunately there's almost a thousand open ones already...
is there a way to change the template used for “create namespace” files of various types? (I want to remove :refer :all
on new test namespaces)
You can do this in Editor > File and Code Templates and change the Clojure Test Namespace template.
I am trying to setup REPL in Cursive, for learning Clojure. I’ve got the REPL setup for prompted inputs and outputs, which also receive the output of println commands within a function within a file, but I can’t figure out how to get output the function values of the file to the repl.
I want to do what this guy is doing at 12:40 minutes in: https://www.youtube.com/watch?v=AmP6rW30wjE
Any help would be greatly appreciated.
The output from the println command is a side affect (akin a console log), not a function value. I want to see the return value of functions in repl.
he's executing that function in the repl via send form to repl
command (or Alt+Shift+P
if you're on linux)
which is basically (or perhaps literally): "Cursive, copy and paste the S-Exp I'm in to the repl window"
This works for some but not all.
(ns brave.core)
'("hi") ; ("hi")
(if true 1 2) ; 1
(+ 1 2) ; Syntax error compiling at (core.clj:12:1).
; Unable to resolve symbol: + in this context
(defn foo
"I don't do a whole lot."
[x]
(println "Hello" x "!"))
(foo "katie") ; Syntax error compiling at (core.clj:8:1).
; Unable to resolve symbol: foo in this context
I assume for the + function, I need to import another dependency in the project.clj file:
(defproject brave "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url " "}
:dependencies [[org.clojure/clojure "1.10.0"]]
:repl-options {:init-ns brave.core})
but I dont know what to add.+ is part of core. it sounds like you don't have clojure.core referred