https://github.com/ruricolist/cloture Skip to content Sign up * Product + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Skills + GitHub Sponsors + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} ruricolist / cloture Public * Notifications * Fork 6 * Star 309 Clojure in Common Lisp 309 stars 6 forks Star Notifications * Code * Issues 7 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights ruricolist/cloture This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 2 branches 0 tags Code Latest commit @ruricolist ruricolist Merge pull request #9 from travv0/master ... 623c15c Jan 30, 2021 Merge pull request #9 from travv0/master change cl-arrows dependency to arrows 623c15c Git stats * 485 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time clojure Specialize fset:empty? for Sycamore maps. Mar 4, 2020 t Maps and sets aren't seqs. Mar 4, 2020 .gitignore Ignore fasls. Nov 20, 2019 README.md Minor: fix readme example. Mar 3, 2020 asdf.lisp Start implementing clojure.test. Nov 2, 2019 clojure-packages.lisp Define a Clojure ns named "cloture". Mar 1, 2020 clojure-printer.lisp Use Iterate drivers for fset as well. Dec 10, 2019 clojure-repl.lisp Actually set REPL history. Dec 5, 2019 cloture-test.asd Successfully call run-tests on an empty ns. Nov 20, 2019 cloture.asd change cl-arrows dependency to arrows Jan 20, 2021 cloture.lisp Compiler macros for truthy? and falsy?. Feb 16, 2020 core-syms.txt Add a dumped list of clojure.core symbols. Oct 26, 2019 epl-v10.html License under EPL. Nov 18, 2019 errors.lisp Basic defrecord implementation. Dec 8, 2019 fset-hacks.lisp Use Iterate drivers for fset as well. Dec 10, 2019 interpol.lisp Remove unused argument. Feb 17, 2020 iterate-drivers.lisp Declare variable ignored. Mar 4, 2020 package.lisp Use Sycamore to implement sorted maps. Mar 3, 2020 pprint-syms.txt Get started on clojure.pprint. Oct 30, 2019 quasiquote.lisp Shorter names for Lisp-side literal constructors. Nov 9, 2019 readtable.lisp Expand top level splicing conditional into do. Mar 1, 2020 walk.lisp Support splicing reader conditionals. Feb 29, 2020 View code [ ] Cloture Clojure vs. ClojureScript A note about FSet Starting a REPL Interoperation Using Clojure from Lisp Using Lisp from Clojure Reader conditionals License Why? Why "Cloture"? README.md Cloture Cloture is an implementation of Clojure in Common Lisp. It is designed above all to interoperate well with Common Lisp; Clojure is read by the Lisp reader and Clojure namespaces are Lisp packages. Cloture is in very early (pre-alpha) stages, but it has progressed far enough to load clojure.test, allowing the test suite to actually be written in Clojure. Work so far has been focused on the critical path to get real Clojure code working in CL. But if there is interest from Clojurists I may work toward making it a more complete Clojure implementation. Clojure vs. ClojureScript Cloture is closer to Clojure than to ClojureScript. Among other things, the plan is to support Clojure's concurrency primitives (atom, ref, agent, future, promise). However, Cloture follows ClojureScript in making exclusive use of protocols - interfaces are not used or supported. Protocol names are also derived from ClojureScript. Like ClojureScript, Cloture supports (catch :default) to catch everything. A note about FSet Cloture uses FSet seqs, maps, and sets to implement Clojure vectors, maps, and sets, respectively. This involves a few hacks to FSet that might possibly affect other programs using FSet. Starting a REPL Use (cloture:repl) to start a Clojure REPL. You can exit the REPL with (quit) or (exit). Note that not much work has been done yet on Clojure-style printing, so the "Print" in REPL is still mostly the Common Lisp printer. Interoperation Using Clojure from Lisp The design goal of Cloture is to keep things as close to Common Lisp as possible: Clojure is read by the Lisp reader and Clojure namespaces are just packages. Clojure packages and functions, however, usually have lower-case names, so to call them from Lisp you will need to quote them with pipe characters: (|clojure.core|:|cons| 1 '(2)) => '(1 2) Lisp's nil is used only as the empty list; Clojure nil, true, and false are singletons. To use Clojure predicates from Lisp, you can use cloture:truthy? to translate. (cloture:truthy? (|clojure.core|:|=| '(1 2 3) #(1 2 3))) => T In this case, however, you should use cloture:egal, which tells you if two objects are equal according to Clojure's idea of equality. Cloture exports Iterate drivers for working with collections that satisfy Clojure protocols: * cloture:in-seq iterates over ISeq. * cloture:on-seq iterates over the rests of ISeq. * cloture:in-indexed iterates over IIndexed. * cloture:index-of-indexed iterates over the indices of IIndexed. Clojure files can be integrated into Lisp systems by making the system definition depend on Cloture (:defsystem-depends-on ("cloture") and using "cloture:cljc" as the file type. (defsystem ... :defsystem-depends-on ("cloture") :components ((:file "cloture:cljc" "my-clojure-code"))) You can also use "cloture:clj" or "cloture:cljs" to load straight Clojure or ClojureScript files. Using .cljc is recommended, however. Using Lisp from Clojure Since Clojure uses the Lisp reader, you can call Lisp functions just by uppercasing them. (letfn [(fst [xs] (CL:FIRST xs))] (fst '(1 2 3))) You will also need to spell out CL:QUOTE and CL:FUNCTION (or refer them), as Clojure quote is not the same thing as CL quote and sharp-quote is used in Clojure for a different purpose. (ns ... (:require [CL :refer [QUOTE FUNCTION]])) Cloture defines a Clojure namespace, cloture, with exports whose names (and keyword arguments!) are already conveniently lowercased and otherwise follow Clojure conventions: (ns ... (:require [cloture:refer [parse-integer]])) (parse-integer "1234x" :start 1 :junk-allowed true) => 234 All Lisp sequences (lists, vectors, and extensible sequences on implementations that support them) implement ISeq. Reader conditionals In reader conditionals in .cljc files (and at the REPL), Cloture looks for a :cl key. License Eclipse Public License. Why? I would like to be able to use Clojure libraries from Common Lisp. Why "Cloture"? Beside the obvious: cloture is a parliamentary procedure to end debate on a subject, and I would like to end certain debates. Yes, Common Lisp is "modern." Yes, Clojure is a Lisp. About Clojure in Common Lisp Resources Readme Stars 309 stars Watchers 19 watching Forks 6 forks Releases No releases published Packages 0 No packages published Contributors 2 * @ruricolist ruricolist Paul M. Rodriguez * @travv0 travv0 Travis Languages * Common Lisp 75.0% * Clojure 20.2% * HTML 4.8% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.