Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wdhowe/clojure-snippets

Clojure syntax examples.
https://github.com/wdhowe/clojure-snippets

clojure clojure-snippets

Last synced: 2 months ago
JSON representation

Clojure syntax examples.

Awesome Lists containing this project

README

        

# clojure-snippets

Clojure example snippets.

Short files that demonstrate syntax and concepts.

----

## Execute

Run individual snippet files via clj -M FILENAME.

Example:

```bash
clj -M basic_syntax/hello_world.clj
```

Output

```bash
Hello Clojure world!
```

## Descriptions

Snippets

* abstractions -> Creating abstractions with multimethods, protocols, and records.
* basic_syntax -> Getting started with basic syntax. (hello world, math operators, comparison operators, variables)
* concurrency -> Processing on multiple threads concurrently. (futures, delays, promises, core.async)
* data_structures -> Core data types and destructuring them. (lists, maps, sets, vectors)
* file_operations -> Interacting with files and EDN for configuration.
* flow_control -> Flow control concepts. (case, cond, exceptions, if, do, when)
* functions -> Anonymous functions/lambda, multi-arity, composing functions, functions that accept and return functions (apply, partial).
* http -> Http/get examples.
* iter_recur -> Iteration and recursion.
* java_interop -> Using Java's methods, objects, libraries.
* macros -> Macro definition examples.
* misc -> Miscellaneous items. (date, fizz buzz)
* seq_col_funcs -> Core functions that operate against sequence elements and entire collections. (filter, map, reduce, etc)
* state -> Using state like behavior. (atoms, watchers, validators)

Templates

* template -> Template for a Clojure CLI/deps project with cli args.

----

## Resources to Get Started

* [Install Clojure](https://gist.github.com/wdhowe/e6fc5e372b85ad8a25fdebf446b1a3e6)
* [REPL Help](https://gist.github.com/wdhowe/4125856d72714724072f4f6b007273a8)
* [Creating projects with CLI/Deps](https://gist.github.com/wdhowe/99a4f463f96730002f4c20a058806dda)
* [Creating projects with Leiningen](https://gist.github.com/wdhowe/78bececa96e577bf26139e4bdc501d47)
* [Installing plugins for Leiningen](https://gist.github.com/wdhowe/a7df51d5ad2e7f969d78a3bc395f8a88)

----