Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
NotificationsYou must be signed in to change notification settings

inclojure-org/intermediate-clojure-workshop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup Instructions

Just do the following one by one, and you should be fine.

Java 8

You will need Java to work with this Clojure workshop content.

First, make sure you have Java 8.

Notes:

  • If you have Java 9+, that should be OK too.
  • The LightTable editor is known to break with Java 9. Use Java 8 if you are keen on using LightTable.
  • We have not tested this project with Java 7 and earlier.

Leiningen

FollowLeiningen setup instructions here.

Fire up a REPL

  • Clone this project
  • Open your terminal, and do the following.
  • cd into this project's root directory
  • Uselein repl command to start a REPL with Leiningen.
  • Wait for it... the REPL will start and print out a message with someuseful information
  • Locate theport andhost information in the message. We will need this information soon.

Note:

  • Boot should be fine too, but you may need to generate your ownboot file(s).

Code Editor and Tooling

Set up an editor and figure out how to evaluate Clojure code with it.We are fine with you choosing the editor as long as your editor can do,

  • Connect to a Clojure REPL from the editor
    • Evaluate snippets and/or entire namespaces in the connected REPL from the editor.
  • Code navigation
  • Paredit / Parinfer

Editors we can help out with

  • Emacs
  • Vim
  • Cursive

Cursive (IntelliJ)

If you don't have an editor setup, we suggest you use Cursive with IntelliJ. Please follow instructions fromhere.Do note that you may need to use it in trial mode or get an appropriate license ahead of time. There's a cost-free license available for personal/non-commercial hacking.

Further reading

Inspiring and insightful source code

This one is not a surprise, but reading sources in the core Clojure library (with the clojure.core namespace being a good starting point) is highly recommended. This one comesdirectly from the masters, and it can not get more idiomatic (and simpler, really) than this.

Monger uses official Java client for talking with Mongo. This is a standard way of writing database wrappers.Few interesting parts,

Carmine is Redis client and is written almost from scratch.

  • API is built with amacro
  • An atom is used to collecttest results
    • Exercise - Can we use core.async here to remove dependency on Thread/sleep?
  • It usesIConnectionPool to create different implementations of connection pool
  • It uses aedn file to map list of commands Redis supports to Carmine API functions usingdefcommands macro

core.cache is Clojure contrib library. It provides in-memory implementations of different caching strategies

  • core.cache/defcache is a macro that reduces repetition of defining a type
  • This shows that mutation to cache creates a new value

This one is old, but it really stands out for a few reasons as far as learning goes

  • A concise example that shows Java inter-op
  • Careful design considerations, and thus what a succinct piece of code within a single namespace can achieve
  • Clever use ofmeta attributes onvars

This one pushes some limits on Clojure-Java interop without descending down into Java (language) land. An instructive piece of source, all within a single namespace.

Links

Copyright and License

Copyright � 2018-2019IN/Clojure.

Distributed under theMIT license.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp