{"id":19794632,"url":"https://github.com/code-crash/clojure-examples","last_synced_at":"2026-03-03T03:43:15.337Z","repository":{"id":180049201,"uuid":"663885400","full_name":"Code-Crash/clojure-examples","owner":"Code-Crash","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-14T06:18:31.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T04:44:18.559Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Code-Crash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-08T10:58:04.000Z","updated_at":"2023-07-08T10:58:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"1716a2f6-9d8a-47d6-897f-f10385418c25","html_url":"https://github.com/Code-Crash/clojure-examples","commit_stats":null,"previous_names":["code-crash/clojure-examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Crash%2Fclojure-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Crash%2Fclojure-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Crash%2Fclojure-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Crash%2Fclojure-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Code-Crash","download_url":"https://codeload.github.com/Code-Crash/clojure-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241136854,"owners_count":19916001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T07:13:46.563Z","updated_at":"2026-03-03T03:43:15.310Z","avatar_url":"https://github.com/Code-Crash.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clojure Examples\n\n## Overview\n\nThis repository contains the different examples for clojure language, examples can anything like vector (array), list and dictionary manipulation or any general examples like reading/writing in file, different database connectivity, any logic and optimization tricks within code.\n\nYou can learn about clojure on official website as well, see the [link](https://clojure.org/guides/learn/clojure)\n\n## Examples\n\nTo see the examples with syntax and code, you can read the code base in below sequence:\n\n1. [Literals](./examples/src/examples/basic/literals.clj)\n    1. [List](./examples/src//examples//basic/list.clj)\n    2. [Vector (Array)](./examples/src//examples//basic/vector.clj)\n    3. [Map (Dictionary)](./examples/src//examples//basic/dictionary.clj)\n    4. [Set](./examples/src//examples/basic/set.clj)\n2. [Flow Control](./examples/src/examples/basic/flow_control.clj)\n2. [Functions](./examples/src/examples/basic/functions.clj)\n\n### Run Examples\n\nTo run the examples, first step **install [clojure](https://clojure.org/guides/install_clojure)**, and then follow below steps:\n\n1. **[STEP-1]** : *Clone this repository*\n2. **[STEP-2]** : *open terminal and navigate to cloned directory using `cd` command*\n3. **[STEP-3]** : *now again use `cd` command to change into [`examples`](./examples/) directory*\n4. **[STEP-4]** : *run command `lein run`, on terminal you will see the output of out different examples.*\n5. **[STEP-5]** : *Now, we need to start exploring code base to understand the syntax and code examples for different clojure features.*\n6. **[STEP-6]** : *Start exploring [Examples](#examples) in sequence to understand the basic of Clojure, **Comments are our document, don't miss them ;)** We will also update the [document](./examples/doc/intro.md)*\n7. **[STEP-7]** : *Now, you can try and explore [Examples with REPL](#run-examples-with-repl)*\n\n### Run Examples with REPL\n\nThe REPL (Read-Eval-Print Loop) is an interactive programming environment that allows you to read code, evaluate it, and see the results. The REPL provides a convenient way to experiment, test code snippets, and develop Clojure programs interactively ([more on REPL](https://clojure.org/guides/repl/introduction)).\n\nSee the steps to run our examples in REPL mode:\n\n1. **[STEP-1]** : *open terminal and navigate to cloned directory using `cd` command*\n2. **[STEP-2]** : *now again use `cd` command to change into [`examples`](./examples/) directory*\n3. **[STEP-3]** : *run command `lein repl`*\n4. **[STEP-4]** : *Above command will run our code once and ask for input using prompt namely `examples.core=\u003e`*\n5. **[STEP-5]** : Now, you can try and explore [Examples with REPL](#run-examples-with-repl)\n\nFew examples for REPL to play around:\n\nRun this statement in REPL (`examples.core=\u003e`):\n\nExample 1:\n\n```sh\nexamples.core=\u003e (load-file \"src/examples/core.clj\")\n#'examples.core/-main\nexamples.core=\u003e (#'examples.core/-main)\nHello, World!\nnil\nexamples.core=\u003e\n```\n\nExample 2:\n\n\n```sh\nexamples.core=\u003e (load-file \"src/examples/basic/functions.clj\")\n# ..... output from functions ......\n```\n\nFrom REPL, we can load any specific file or namespace and run and debug the code base, please have a look, how we can use [REPL](https://clojure.org/guides/repl/introduction)\n\n\n## Project Structure\n\nThis project is generate using below command:\n\n`lein new app examples`\n\nThe project directory structure consists of the following components:\n\n```\n.\n├── README.md\n└── examples\n    ├── CHANGELOG.md\n    ├── LICENSE\n    ├── README.md\n    ├── doc\n    │   └── intro.md\n    ├── project.clj\n    ├── resources\n    ├── src\n    │   └── examples\n    │       ├── basic\n    │       │   ├── dictionary.clj\n    │       │   ├── functions.clj\n    │       │   ├── index.clj\n    │       │   ├── list.clj\n    │       │   └── vector.clj\n    │       └── core.clj\n    ├── target\n    │   ├── classes\n    │   │   └── META-INF\n    │   │       └── maven\n    │   │           └── examples\n    │   │               └── examples\n    │   │                   └── pom.properties\n    │   └── stale\n    │       └── leiningen.core.classpath.extract-native-dependencies\n    └── test\n        └── examples\n            └── core_test.clj\n```\n\nExplanation of the directory structure:\n\n- `README.md`: A markdown file containing information and instructions about the project.\n- `examples`: A directory that holds all the project code and related files.\n  - `CHANGELOG.md`: A markdown file that tracks the changes and updates made to the project.\n  - `LICENSE`: A file that specifies the licensing terms for the project.\n  - `README.md`: A markdown file containing specific information and instructions about the examples directory.\n  - `doc`: A directory containing documentation files for the project.\n    - `intro.md`: A markdown file providing an introduction to the project.\n  - `project.clj`: A file specifying the project configuration and dependencies for Leiningen, a Clojure build tool.\n  - `resources`: A directory for storing project resources such as images, configuration files, or templates.\n  - `src`: The source code directory.\n    - `examples`: The main namespace or package for the project's source code.\n      - `basic`: A directory containing basic examples related to the project.\n        - `dictionary.clj`: A Clojure source file containing code related to dictionary operations.\n        - `functions.clj`: A Clojure source file containing code related to function definitions.\n        - `index.clj`: A Clojure source file serving as an entry point or index for the project.\n        - `list.clj`: A Clojure source file with code related to list operations.\n        - `vector.clj`: A Clojure source file with code related to vector operations.\n      - `core.clj`: The main Clojure source file for the project, which contains the core logic.\n  - `target`: A directory generated during the build process, typically used for compiled code and artifacts.\n    - `classes`: A directory containing compiled Java class files.\n    - `META-INF`: A directory containing metadata for the project.\n      - `maven`: A directory containing Maven-specific metadata.\n        - `examples`: The Maven group ID for the project.\n          - `examples`: The Maven artifact ID for the project.\n            - `pom.properties`: A properties file containing project-specific information.\n    - `stale`: A directory that may contain stale or outdated files.\n      - `leiningen.core.classpath.extract-native-dependencies`: A file related to the build process.\n- `test`: A directory containing test code for the project.\n  - `examples`: The namespace or package for the project's test code.\n    - `core_test.clj`: A Clojure test file containing test cases for the core namespace.\n\n## TODO\n\n1. Add more examples:\n    1. File Handling\n        1. Local File Handling\n        2. API Based File Upload and Download\n        3. TODO: Add More.... \n    2. Different Database Connectivity and Operations\n        1. Postgres\n        2. MySQL\n        3. MongoDB\n        4. SQLite\n        5. TODO: Add More....\n    3. Handling For I/O Operations\n    4. Concurrency\n    5. Microservices\n        1. Rest Based Architecture\n        2. Event Based Architecture\n2. Update [docs](./examples/doc/intro.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-crash%2Fclojure-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-crash%2Fclojure-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-crash%2Fclojure-examples/lists"}