This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-19
Channels
- # aleph (9)
- # announcements (1)
- # asami (21)
- # aws (1)
- # babashka (4)
- # babashka-sci-dev (95)
- # beginners (35)
- # calva (27)
- # cider (17)
- # cljsrn (1)
- # clojure-europe (8)
- # clojure-norway (1)
- # clojuredesign-podcast (4)
- # clojurescript (18)
- # code-reviews (28)
- # core-logic (1)
- # cursive (3)
- # datalevin (2)
- # holy-lambda (3)
- # honeysql (1)
- # introduce-yourself (11)
- # kaocha (12)
- # lsp (11)
- # malli (9)
- # off-topic (46)
- # polylith (16)
- # re-frame (3)
- # reitit (2)
- # releases (2)
- # tools-deps (9)
- # web-security (1)
- # xtdb (2)
I'm still struggling with setting up my environment properly, which is probably why I still can't get my first program up and running.
Hey here's a tutorial for setting up the environment with vs code (I tried emacs at first and I much prefer vs code): https://www.clojurehub.com/post/10. Sorry if this isn't the help you're looking for - hopefully someone who is experienced with emacs will respond as well.
Briefly looking at your post, it looks like when you switch namespaces, you might still need to require the namespace first? And that might be why the compiler doesn't know what "train" function is. That's something I had an issue with a lot when I first started.
@U037SG1L9PV YMMV of course but as a rule of thumb don't try to learn multiple things at once. Just use the editor/IDE/whatever you're already most familiar with. emacs is really powerful and has an amazing ecosystem. I love it so much that I can't imagine using anything else today but when I started with Clojure I hadn't used emacs before and didn't dare to touch it until after about a year. The learning curve was too steep then. Clojure for the Brave and True has helped a lot of people learn Clojure (myself included) but much has changed since it was written. Assuming no familiarity with any editors at all I think the most beginner-friendly approach today is https://calva.io/getting-started/. #calva is a VSCode extension for Clojure. @U0ETXRFEW has done an excellent job there and is always eager to help 🙂

Yes, we have spent a lot of effort in Calva to make it easy for beginners. Lots of work still to do there, but anyway. However, Emacs is nice, and if you know your way around it, prefer it, I think it is the best choice. I added an answer to your http://ask.clojure.org question, @U037SG1L9PV.
The Emacs chapter in the Brave Clojure book is quite dated. If using Emacs, I would recommend either Spacemacs, Doom or Prelude. It is also useful to know the basics in a command line UI to the REPL, to test if there is an issue with the editor setup for Clojure or something wrong with a Clojure project. As your follow Brave Clojure, Leiningen should be installed. Open a terminal in the root of your project (where project.clj is), then run the command
lein repl
Require a namespace to load the code into the REPL
(require '[my.namespace])
The code in that namespace can the be called with its full name (fully qualified name)
(my.namespace/function-name)
Switch to the specific namespace to use the short name
(in-ns 'my.namespace)
(function-name)
There is an example here https://practical.li/clojure/clojure-cli/repl/coding-in-the-repl.htmlThanks everyone.
I'm going to try Calva for now, because Emacs and the Terminal are frustrating me.
Welcome to Calva, @U037SG1L9PV. And welcome to ask for help in #calva. I recommend reading about getting started on http://calva.io and also to use the Getting Started REPL to prepare. That should make it easier to follow along the Brave and True book.
Can anyone help? Here's my original post: https://ask.clojure.org/index.php/11640/all-kinds-of-problems-trying-to-run-my-first-clojure-program
what's the recommended REST API library for clojure, and most mainstream Text editor choices?
REST API: Client or server? Editor: Oh god, do you really want to start this flame war? 🙂 (Many LISP users like Emacs. There are great extensions for VS-Code, Atom, IntelliJ to choose from).
REST API is a server thing
so I'm looking to make endpoints on a server yes
as for editor, I have no interest in flame war, i just want information
People like and use emacs, vim, vscode, intellij. All are good and will work well. I suggest using the editor you're most familiar with, mostly so you're not learning two big things at once. There are helpful channels here for each editor.
For REST API server libraries, I'd recommend either http://pedestal.io/index or https://github.com/juxt/yada. Yada is the one I've used. Both have a bit of a learning curve depending on your background.
Yes +1 for Reitit. Here is the classic Todo app example with Reitit + Swagger.js configured: https://github.com/prestancedesign/todo-backend-reitit
I built a REST API for work using Reitit and found it really simple to work with, all the routes are defined as a data structure. Ring is the most common request/response library, decoding and encoding http to/from Clojure data structures. Reitit has a ring handler and ring middleware.
https://practical.li/clojure/clojure-editors/ is a quick guide to many of the Clojure aware editors. I use Emacs myself, but also have used neovim (conjure) and VS Code (VSpaceCode+ Calva) for the Live Code feature.
clojurescript doesn’t hoist function definitions, right?
@hello514 what do you mean?
like override stuff?
In JS, you can do
function foo() {
bar();
}
foo();
function bar() {
console.log('hello');
}
and bar will be defined before foo is called.Clojure and ClojureScript are single-pass
thanks!
Execution error (FileNotFoundException) at app.core/eval2041 (form-init15186151634269250230.clj:1).
Could not locate cheshire__init.class, cheshire.clj or cheshire.cljc on classpath.
does anyone know why i would get this error?thanks i spent at-least 30 mins at this point.
I've been there with this exact library, unfortunately