tools-deps 2023-10-19

Is there a way to specify a default namespace to be loaded when I start a REPL?

There is a default namespace loaded — user . You can create user.clj and require all necessary namespaces from there.

Ah, of course

Thanks 🙂

you can also say -e "(require 'some.ns) (in-ns 'some.ns)" which will call that when the repl loads

-e option is the only reasonably reliable way to set the namespace, although personally I do not recommend this approach. The user namespace is an effective way of interacting with the program when using a command line REPL prompt, as it contains additional tools useful for development. Requiring namespaces into the user namespace keeps those tools available. NOTE: Using an editor and evaluating source code is automatically done in the relevant namespaces, so no switching is required and this approach is generally recommended. Using a custom dev/user.clj file can be used to load libraries and run tools, e.g. https://practical.li/clojure/clojure-cli/repl-startup/#calling-functions . The custom user namespace is loaded via an alias that adds the dev directory to the classpath on startup, so that this custom user is loaded during development (and not released product). I use a custom user namespace to launch Portal data inspector, configure Portal to listen to tap> values over nREPL and send all mulog event logs to Portal for a complete repl history. Many developer oriented tools and libraries can be made available using a custom user namespace. https://practical.li/clojure/clojure-cli/projects/templates/practicalli/ includes a custom user namespace in the projects it generates, including component lifecycle REPL tools when selected as an option.

Here’s an example of dev/user.clj from my linting library: https://github.com/NoahTheDuke/splint/blob/main/dev/user.clj. Has some side effecting dev requires and potemkin imports dev helper.

Hey guys! I posted this in #clojure but I think this is the best place to ask: I’m trying to install the google cloud java lib. Here’s the maven code:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>libraries-bom</artifactId>
      <version>26.25.0</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

<dependencies>
  <dependency>
    <groupId>com.google.cloud</groupId>
    <artifactId>google-cloud-storage</artifactId>
  </dependency>
After reading through the docs I got it to
com.google.cloud/libraries-bom {:mvn/version "26.25.0"
                                :deps/manifest :pom}
but it still does not install correctly using intelliJ Cursive. However I know its there: https://mvnrepository.com/artifact/com.google.cloud/libraries-bom/26.25.0 Anybody has any ideas?

Oh I didn’t know that! Thanks a lot. Should’ve asked earlier!