Deviations
Conformance is partial by design. Where behavior departs from the Clojure oracle (Clojure CLI 1.12), it does so here, on every backend alike:
falseis a distinct object fromnil. Both are falsey, soif/when/cond/and/or/nottreat them alike, while=andnil?tell them apart;false?/true?/boolean?answer accordingly.println/printjoin their parts with a single space and spell the three valuestrue/false/nil;strconcatenates bare and spells themtrue/false/""(a collection inside it spells readably, strings quoted, like the oracle'stoString);pr/prn/pr-strare the readable arms (strings print quoted,pr-strjoining its parts with a space likepr);print-str/prn-str/println-strare the same arms answered as a string. The print family answersnil, like the oracle.- Collections print in Clojure notation (
[1 :a s],{:a 1},#{1},(true false nil :k)); a quoted symbol demangles from behindc%.nilstaysnil(never()). A map or set prints its entries, andseq,keysandvalswalk them, in insertion order on every backend -- the oracle's order for a map of at most eight entries (its array map), not past eight (its hash map) nor for a set (its hash set). A value that closes a cycle prints with a datum label (#0=(1 . #0#)), like Scheme'swrite; sharing without a cycle prints twice. An atom prints unreadably (#<Atom value>), a function as#<procedure>, an exception as itstoString(clojure.lang.ExceptionInfo: m {}; the oracle prints#error {...}), an unbound var's root as#<Unbound: #'user/x>(the oracle's#objectcarries a hash). A stream prints as the oracle's#objectof the host class its kind is without the identity hash (#object[java.io.StringWriter "ab"],#object[java.io.OutputStreamWriter "java.io.OutputStreamWriter"]), andstranswers itstoStringthe same way: a string input stream is aclojure.lang.LineNumberingPushbackReader(with-in-str's), also where the oracle's is ajava.io.PushbackReaderover aStringReader; a(java.io.StringReader. s)construction is one too, so it prints and answersclassas that rather than as ajava.io.StringReader. *print-meta*writes a value's metadata ahead of it like the oracle, but no quoted list carries the oracle reader's:line/:columnmetadata;*print-dup*is a plain value the printer does not read.assertreads*assert*where it expands, so a top-levelset!of it to a literal switches off the asserts after it; aset!inside a function, or to a computed value, does not (the oracle's takes effect once it runs). A Common Lispformat's~S/~Aon Clojure values stay Common Lisp notation (it is a CL surface;clojure.pprint/cl-formatwrites them as Clojure). print-method takes a program's own records, deftypes, protocol interfaces and:typekeywords, and a host class no core value belongs to but an instant or a UUID, whose method writes host objects only (an instant or a UUID made here keeps its#inst/#uuid): any other class is refused by name (a computed one when thedefmethodruns),methodsof it is too, andget-methodof a type without one answersprint-methoditself where the oracle's answers its default method. A deftype orreifymatches no printer's own method beside a protocol interface's, and preferences that settle only some of the rows are read in a fixed order where the oracle's follows its method table's hash order.- A wrong argument count is the oracle's
Wrong number of args (N) passed to: name, but a localfn's name is the oracle's class name without its generated parts: the enclosing function's name (adefn'smy.app/f, the namespace outside any), then thefn's own name orfn(my.app/f/fn; the oracle'smy.app/f/fn--177, and at the top levelmy.app/eval176/fn--177/named--178, with theevalNand the function atryis wrapped in). A var's function -- adefn, afnthat is adef's value -- names the var as the oracle's does. - A map, set or memo key finds an
=key like the oracle's, vectors, lists, maps and sets included, but a stored collection key is the first=key of its kind (vector, list, lazy seq) the program stored, so its metadata and the spelling of a nested member follow that earlier object; those keys stay alive for the whole run, one per distinct value and kind. An earlier deftype key is stored for a later=one only when both are of one type holding the same field values (never for areifyor a type with mutable fields), so a field=does not read stays the stored object's own.=compares vectors, lists and lazy seqs element-wise like the oracle, and sincenilis the empty list,(= [] nil)and(= (java.util.ArrayList.) nil)aretruewhere the oracle answersfalse. As keys[]andnilstay apart like the oracle's, so an empty list or seq misses an empty vector key:(get {[] 1} ())isnil(the oracle:1).=asks a Java object on the left itsequalslike the oracle, but hands it only a number, string, character,true,nilor Java object:false, a keyword, a symbol or a collection is=to no Java object but a JavaList,MaporSetof its kind. A map or set finds a Java collection key by its ownequals, like the oracle's hash maps and sets, never by=, which the oracle's small array maps use:(get {[1 2] :v} (java.util.ArrayList. [1 2]))isnilhere,:vthere. hash,hash-ordered-coll,hash-unordered-coll,mix-collection-hash,hash-combineand.hashCodeanswer the oracle's numbers but for a value hashed by its identity -- a function, an atom, a var, an exception, a deftype or reify implementing neitherhasheqnorhashCode--, whose number differs (between backends and runs too, as between the oracle's runs);()and an emptyrest,nilhere, which hash to0(the oracle's are an empty seq's); and aCalendar, hashed as theDateof its milliseconds.hash-ordered-collwalks a map's, set's or record's members in this implementation's order (the unordered hashes agree). A refusal'sClassCastExceptionmessage leaves out the oracle's module and loader text.seqand the verbs over it,count,empty?,get,contains?,keysandvalsread a JavaIterable,MaporCharSequence, andfind,select-keys,reduce-kv,update-vals,update-keys,conj,mergeandmerge-witha JavaMap, like the oracle, but the seq is read whole when it is taken (the oracle's walks the iterator lazily) and aMap's entries are[k v]vectors (the oracle's are the Java entries, printed#object[...]).clojure.set/unionwhose largest input is a map signals, where the oracle conjoins the other inputs'[k v]members into it; aclojure.setanswer carries no metadata.- A map entry is a plain two-member vector, so
map-entry?istrueof every[k v](the oracle:falsefor one the program built) andkey/valread any such vector. For the same reason(conj {} #{[1 2]}),(conj {} (seq [[1 2]]))and(merge {} (seq [[1 2]]))answer{1 2}(the oracle:ClassCastException, the members must be real entries). Keywords are not interned, sofind-keywordanswers the keyword for a spelling no keyword ever used (the oracle:nil). - The type predicates follow the representation.
nilis the empty list, soseq?,list?,coll?,sequential?andcounted?answerfalsefor(); a seq a verb answers over a strict input is a list, solist?,counted?andrealized?answertruefor it (the oracle's lazy or chunked seq:false), unless the verb's function names the definition it stands in, whose seq is lazy like the oracle's; no seq is chunked (chunked-seq?is alwaysfalse), and aniterate/cycleseq isrealized?only once forced.identical?compares numbers, characters and symbols by value ((identical? 1000 1000)istrue) and two keywords of one spelling as one object. - An integer inside the long range is a plain integer whatever made it: an
Nliteral (2N),bigint,biginteger, aBigIntsum or product ((+ 1N 2)) and an integral ratio answer ((* 1/2 2),(rationalize 1.0)) print without the oracle'sN(3, not3N),int?answerstrueandclass:java.lang.Longfor them, and a bit operation takes them where the oracle refuses itsBigInt. An integer past the long range is the oracle'sBigIntand prints itsNunderprandprint(strleaves it out, like the oracle's toString); abigintegerpast it prints theNtoo, where the oracle'sBigIntegerprints none. An integer answersBigInteger's.negateand.bitLength, aLongtoo (the oracle's refuses them). - A decimal (
1.50M,bigdec, a read of one,(BigDecimal. "1.5"),BigDecimal/valueOf) is the oracle'sBigDecimalin its scale, spelling, arithmetic, comparisons, hash,with-precisionrounding and Java methods, and Java takes it as ajava.math.BigDecimal. ABigDecimalmethod beyond the common ones (.sqrt,.divideAndRemainder) runs only where a host is. ABigDecimalJava answers is a decimal where the member declaresBigDecimal; where it declaresObjectorNumber(JDBC'sgetObject) it is one only in a program that makes a decimal itself, and stays a host object otherwise. A wrong argument to a method on a literal receiver ((.add 1.5M 2)) is the reflector's refusal, where the oracle's compiler casts it. AMathContextorRoundingModeprints without its identity hash. Where an index or a count is read (nth,take,drop,repeat,subvec,char,dotimes) a decimal refuses, where the oracle casts it to an int;subsandrangetake it. - A program's own top-level definition of a core name (
(defn peek ...)) shadows the core verb in the whole file, calls above the definition included (the oracle's calls above it still reach the core verb); a local binding shadows it in its scope, like the oracle. - The seq family's empty
restof a strict collection isnil, where the oracle prints();nthpast the end answers the default instead of throwing; strings seq to characters printing in Common Lisp notation. Lazy seqs realize one element at a time (no chunking);next,nthnextand a&rest realize the element they reach, so over aniterateseq they call its function where the oracle's waits for the element to be read, andmapcatover a lazy input realizes only what is read, where the oracle's realizes up to four mapped elements ahead;strof a lazy seq spells its members, where the oracle answersclojure.lang.LazySeq@<hash>;maptakes any number of collections. - A
forover strict collections answers a strict list, realized when theforruns (the oracle's waits to be consumed); with no elements it isnil, where the oracle prints()(the same empty-as-nilposition asrest/takeover a strict collection). From its first lazy collection on, it is lazy like the oracle's, and so is a wholeforwhose bindings or body name the definition it stands in. condkeeps the lenient reading: an odd trailing arm is the default, where Clojure signals. A threading step over a collection literal signals (collections are not functions here).- A function that calls itself by name in tail position (a
defn, a namedfn, aletfnentry) runs in constant stack on every backend, asrecurdoes, and so do functions that call each other in tail position (letfnentries,defns). The oracle keeps a frame per such call, so a deep one overflows there and runs to completion here: a test asserting that overflow ((is (thrown? StackOverflowError (tail-fibo 1000000N)))) fails. clojure.testruns the tests in definition order (the oracle's order is its namespace map's); an error report prints the exception'stoString(a runtime error its report) with no stack trace, at theisform's line where the oracle names the frame that threw; a failedthrown-with-msg?shows the condition's message where the oracle prints#error {...}; a host stack overflow (catch StackOverflowError,(is (thrown? StackOverflowError ...))) is no condition on the interpreter, where it ends the program with the one-line report, and a trap on WASM; only the JVM backend catches it, like the oracle. Naminguse-fixturescompiles, and only the call signals.reportstays silent for every type but:pass/:fail/:error/:summary(the oracle prints the map and runs custom:typemethods); a:fail/:errormap's:file/:linewin, but conditions carry no portable stack trace, so test.check's file-and-line reads host frames where the oracle names the test file.- A
catch(andthrown?) takes a runtime error by the class the oracle throws where the runtime signals its Common Lisp condition, and a refusal of the Clojure runtime by the class the oracle throws for the same call ((first 5)anIllegalArgumentException, a failedassertanAssertionError, which anExceptioncatch does not take). An error naming no class -- a refusal of a construct the oracle accepts (a regex\X,(partition 0 coll)), a Java call on WASM, where no host is -- is thejava.lang.RuntimeExceptionthatclassanswers for it: a catch ofRuntimeException,ExceptionorThrowabletakes it, a catch of a subclass (NumberFormatException) or of anErrordoes not. A misuse a lower verb refuses first carries that verb's class:(shuffle 5)is theIllegalArgumentExceptionofseq, where the oracle casts tojava.util.Collection. An index past its bound is anIndexOutOfBoundsExceptionthat a catch of any of its subclasses takes too (the oracle'sagetthrowsArrayIndexOutOfBoundsException);subs,.substringand.charAtpast a string's bounds throw itsStringIndexOutOfBoundsException(a double bound past the int range too, where the oracle'ssubsthrows anArithmeticExceptionor anIllegalArgumentException). A catch must name a class that resolves on this host (java.*,clojure.lang's throwables, a class of the program's Java class path:--java-classpath,--java-dep); one the oracle finds on its class path only is refused. - An exception is a condition carrying its class, a message, data and a cause. A runtime
error is the Common Lisp condition the runtime signals, whose message is the Common Lisp
report (
(.getMessage e)of a failed(inc nil)is+: The value NIL is not of type NUMBER, the oracle's aNullPointerExceptiontext; a division by zero's is the oracle'sDivide by zero) and whosestris that report without the oracle's class prefix. A throwable construction is an exception only for a class that carries nothing but a message and a cause; one with members of its own (java.net.URISyntaxException) stays a host object. On the interpreter and the JVM, an exception a Java member throws, and a host object thrown, is the host's own, like the oracle's: a catch takes it by its class and binds that very object.classof an exception the program built answers its class name as a keyword (:java.lang.Exception, where the oracle answers the host class),:java.lang.RuntimeExceptionfor an error naming no class;.printStackTracewrites thetoStringline to*err*(the oracle writes it and a line per frame to the process's stderr, whatever*err*is bound to) and.getStackTraceanswers an empty vector (soThrowable->mapanswers:trace []and no:atin its:viamaps);.getClassanswers whatclassdoes. On the interpreter and the JVM, any other method is called on, and a Java member is passed, a host exception of the exception's class built once from its message and cause (anex-info's is aRuntimeException):(.getCause (UncheckedIOException. "u" e))answers that host exception, noteitself (the oracle's isidentical?toe). A runtime error and a refusal of the runtime have no such host exception: a Java member taking aThrowablefinds no match for one.throwof a value that is no exception is aClassCastExceptionwhose message is the value's rendering, where the oracle's message names the two classes. - Six deprecated or internal
clojure.corenames resolve per name rather than as the oracle spells them.EMPTY-NODEis the empty vector (EMPTY-NODE):(= EMPTY-NODE [])and(identical? EMPTY-NODE EMPTY-NODE)aretrue, and a call reads like one of[](a key and an optional default, any other count refused) -- where the oracle's persistent-vector node is=to no vector,count/nthof it throw, and calling it is aClassCastException.StackTraceElement->vecanswers the oracle's[class method file line]vector of a host stack-trace element (StackTraceElement->vec): the class and the method as symbols,nilthe oracle'sNullPointerException, anything else itsClassCastException. Elements exist only on the interpreter and the JVM (.getStackTraceanswers[]).add-classpath,Inst,PrintWriter-onandprimitives-classnamesstay refused: no class loader exists here (dependencies come fromdeps.edn,--java-depand--java-classpath; the oracle deprecatedadd-classpathin 1.1),Instis the host protocol objectinst-ms*extends, which exists on no backend (inst?andinst-mscover the predicate and the reading),PrintWriter-onbuilds a hostPrintWriterover a proxied writer (print into a string withwith-out-str, or rebind*out*, instead), andprimitives-classnamesis the print-dup helper map for primitiveClassobjects (a class prints by its name here). A library reaching for the host class loader (clojure.lang.RT/baseLoader, e.g. integrant'sload-hierarchy) refuses at call time the same way: no class loader exists here. - Multimethod dispatch values compare like map keys (by
=, vectors included); dispatch through a hierarchy prefers the strictly most specific method, thenprefer-methodchoices. Adefmethodover a host class stores under the keywordclassanswers for it; a true nil maps onto the(:C%NIL)marker, so no table ever keys on nil, while a dispatch value that literally is:nilkeeps its keyword row, like the oracle (aclasscall inside the dispatch function answers nil itself for a nil argument, so the null test maps it onto the marker too -- bare, wrapped in another function, through a nameddefn/def'd function re-lowered from its recorded definition, or a call to one nested inside an inline dispatch datum (inlined at the call site the same way), like the oracle); anObjectmethod catches past the search but ahead of the default. A throwable, stream or number class stores under its name as a keyword (the oneclassanswers::java.lang.Long,:java.lang.Double,:clojure.lang.Ratio,:clojure.lang.BigInt,:java.math.BigDecimal,:java.lang.Number), and the search follows its Java supers like the oracle's inheritance, interfaces (java.io.Serializable,java.io.Closeable) andObjectincluded;isa?,derive,underive,parents,ancestorsanddescendantsread a class spelling as the same keyword, so(isa? (class "a") String)istrueandparents/ancestorsof a class add its Java supers like the oracle. A core kind (:string,:map, ...) adds the supers of the values it stands for: a functionisa?clojure.lang.IFnand itsancestorshold it, interfaces andObjectincluded, like the oracle's inheritance; a class name in value position reads as that keyword ((= clojure.lang.IFn (class (fn [])))staysfalse), so does any other class of the oracle'sclojure.lang(a keyword no value here answers: adefmethodonclojure.lang.PersistentVector$ChunkedSeqnever matches), and so does a number's class ((= Long (class 1))istrue;Longprints as:java.lang.Long). A record or a deftype stands for host classes that are no one value here: itisa?Objectand the interface of each protocol its body implements (user.P, so a method on the interface takes it, like the oracle's), and itsancestorsaddObject, but its host class's other supers are not modeled. Since the keyword is the class here, a keyword spelled:java.lang.Exceptionis that class too. A host class object (classof a host object, interpreter and JVM) is the same class as its name's keyword and, by its simple name, a core kind's, so(isa? (class (java.util.ArrayList.)) java.util.List)istrue-- and so is itsisa?ofclojure.lang.IPersistentList, which also spells:list, where the oracle answersfalse. Any other class (java.util.AbstractList) is its class object, in a dispatch value too, like the oracle. Protocol dispatch reads no hierarchy (derive): past the exact tag it tries only the classes the protocol was extended to, then theObjectdefault. Twoclojure.langinterfaces one value implements are ordered by the kinds of value each holds (IRefahead ofIDeref), sinceclojure.langis not on this class path. (methods mt)andget-method,remove-method,prefer-methodread a multimethod's name (adefmultivar, through an alias or a referred one) where the program lowers, so a name nodefmultimade is refused there; any other argument (a local, a var's deref) reads the run-time registry below, like the values. The mapmethodsanswers keys a host class row by the keywordclassanswers for it, where the oracle keys it by theClass.prefersanswers each dispatch value with the set preferred over it, andremove-all-methodsclears the methods and the preferences, answering the multimethod; both take the name the same way. As values (methods,get-method,remove-method,prefer-method,prefers,remove-all-methods) they check the argument count in the call's words, then read the run-time registry thedefmultipopulates beside the dispatch function, running what the call runs:get-method/remove-methodread under the same key the call's shape reads,remove-methodof theObjectclass andremove-all-methodsclear the slot, answering the multimethod like the calls. A function holding no registered multimethod still refuses there.get-method, and a multimethod's.getMethodand.dispatchFn, answer what the oracle'sMultiFndoes, but a multimethod'sObjectmethod also answers a keyword dispatch value (classanswers a keyword for a value's class here).satisfies?takes the protocol's name and a value,extendthe type's name and then a protocol and a method map any number of times: a local bound to a protocol or a type is refused at lowering.extends?of two names reads the tables at lowering; of a computed protocol or type (a form such as(class x), or a local) it reads the registry below, as its value does. As values they check the argument count in the oracle's words, then read the run-time registry thedefprotocolpopulates beside the methods table, running what the calls run:satisfies?the tag's row, the inline table's first, the walk behind the registry's flag or guard, else theObjectdefault;extends?the key's row, the inline table's too, else the default;extendeach protocol and method-map pair in order (a trailing odd entry dropped), answering nil. A value the registry holds no protocol for is the oracle'sNullPointerException, a type that is no class itsClassCastException(without the JVM's module tail), a pair whose protocol is none itsIllegalArgumentException.nilnever consults theObjectdefault, like the oracle (an explicitnilrow still satisfies); anextendreplaces the type's whole row like the oracle'sassoc-in(an empty map replaces with an empty row,nilremoves it); a non-map method map stores as-is, satisfying and extending but dispatching nothing, like the oracle (a computed map, and a value arm's, still skips an entry naming no method of the protocol, where the oracle stores it; a literal map refuses a non-method key at lowering). Extending a record or deftype to a protocol its own body already implements refuses like the oracle's (class X already directly implements interface I for protocol:#'ns/P), at lowering for the head forms and when it runs for a value's. An interface-walk second row needs a literalextend.- A record prints as its literal (
#user.R{:a 7}, like the oracle), butstrof one spells that literal too, where the oracle answersuser.R@<hash>. A deftype prints as its wrapper list ((:C%TYPE ...)), a reify as(:C%REIFY ...); only the entry maps print deterministically. One whose body overridestoStringprints as the oracle's#object[user.T "text"]without the identity hash, a reify's class spelleduser$reifywithout the oracle's number. - A deftype's
^:volatile-mutablefield is the same plain slot as an^:unsynchronized-mutableone (no cross-thread ordering). split/replaceleave a plain string literal (only pattern values match by pattern);index-ofanswers-1when missing, like the oracle (whereclojure.string/index-ofanswersnil).definside a body sets the global when the body runs;defninside a body works only in statement position.definlineisdefn: its inline body is a documented no-op (nothing here inlines call sites), so the definition is the function itself.- Verbs assume the right collection kind; misuse may signal the Common Lisp type error instead of the oracle's.
- Macros expand while lowering, so every backend runs expanded code; the interpreter's
evalof a macro call expands the same way. A macro body runs at compile time, apart from the program: it sees the top-level definitions above the call site (functions, multimethods, protocol extensions, and adef's value, built when the body first reads it), but no other top-level statement runs there, and what the body changes (aswap!of a program atom) the program never sees -- the oracle compiles and runs in one process. A var the body interns while it expands (intern, as specter's inline caches do) is the program's from there on, but holds no root when the program starts, as the oracle's AOT compile (compile) leaves it:bound?of it is false, so code that fills an unbound var (specter's caches do) fills it. On the wasm backends the body runs the code the program compiles to -- the values of this front end's own where the program has them -- but the compile runs on a host, so a Java object the body makes of a class with no such value answers its methods there. Adefmethodor protocol extension a program macro expands to is not seen there. A call above a macro's definition is refused, and a program macro's bare name has no value, like the oracle's. Adefmacroof a special form (if,do,let*,new, ...), of a head the reader spells (deref,syntax-quote,ns,in-ns) is refused by name, where the oracle accepts it (and ignores it at call sites, for a special form). A core macro's bare name answers its var's root as a value ((def x when)), where the oracle refuses a bare macro name in value position at compile time;bound-fn*answers its function, capturing the bindings where the value is called. macroexpand-1,macroexpand,clojure.walk/macroexpand-alland a core macro's function expandlet,loop,fn,letfn,when,when-not,if-not,cond,condp,and,or,case,if-let,when-let,if-some,when-some,when-first,->,->>,as->,cond->,cond->>,some->,some->>,doto,..,dotimes,doseq,for,while,comment,declare,defn,defn-,binding,assert,locking,with-open,future,reify,deftypeanddefrecordto the oracle's forms, but for the gensym numbers; any other core macro (lazy-seq,delay,defmacro,ns, ...) answers the call itself, where the oracle answers its expansion. A malformed call's refusal propagates as the expander throws it, where the oracle wraps it in aCompiler$CompilerException(Syntax error macroexpanding ...), and acasewhose tests collide in two or more hash buckets lists the skipped hashes in ascending order, and a type body's interfaces keep the body's order where the oracle's set may swap two (the set-order deviation). Adefrecord's expansion has the oracle's shape -- thedeftype*over the fields and the record's__meta,__extmap,__hashand__hasheq, the oracle's interfaces, one method per method of them under itsclojure.core/name, ahead of the body's -- but each of those methods' bodies is written here: it answers what the oracle's answers, spelled differently, as does the->Nameof a type of more than twenty fields. A program calling one of these as it runs carries the expanders; a program expanding only in its macro bodies carries none.deftype*andreify*, the special formsdeftype,defrecordandreifyexpand to, lower over the same machinery. A typedeftype*defines is a deftype to every function: a record's expansion through it isrecord?and prints as a record, but reads through its own methods, slower than adefrecord; its name resolves without the oracle'simport. An expansion of one of these macros where the program runs keeps a protocol group's symbol as written, where the oracle names its interface (user.P; one a macro body makes while the program lowers names it). A deftype adeftypeform defines is noinstance?ofclojure.lang.IType. A method of a reference interface (IAtom,IRef...) answering another type than the interface declares is not cast, where the oracle throws itsClassCastException.eval,resolve,find-var,ns-resolveandrequiring-resolveof a computed symbol,require,use,refer,alias,in-ns,load,load-fileandload-stringof computed arguments, andload-readerlower as the program runs on the interpreter, which keeps the program's lowering for its run (the REPL its session's), and in a JVM class, which carries its program and the compiler: the first such call lowers the program again, and each call compiles what it lowers to into a class linked against the running one, so every call loads a class (the output carries the compiler: beside a.class, inside a.jar). A wasm module carries no lowering, so on both wasm backends they throw anUnsupportedOperationExceptionat run time, where the oracle evaluates and resolves. A name the program only declares and such a call defines answers the program's own forms from then on, as the oracle's. Such a call lowers like one REPL input, in the namespace*ns*holds: what it defines joins the program for the later calls and inputs, and a redefineddefnreaches every caller, as in the REPL, on the interpreter and in a JVM class alike. A name only such a call defines is unknown to the program's own forms (aninternof a quoted name is not: it defines the var where it stands). A program that may make such a call as it runs -- the call itself, or the verb taken as a value or as a var -- lowers open, like a session, so its protocols dispatch through the class walk and a name it only declares stays open. A call in a macro body, or in a function only macro bodies call, runs while the program lowers and opens it only where the program also expands macros as it runs or takes that macro's var; a verb taken out of a namespace's mapping (@(get (ns-map 'user) 'eval)) never opens it, so called over computed arguments in a program nothing else opens, it throws theUnsupportedOperationException. A value no literal spells (a function, an atom) stands in aneval'd form as itself, where the oracle embeds a function but refuses an atom (Can't embed object in code); a form that does not lower throws aCompiler$CompilerExceptionwith the lowering's words. In a macro bodyevalandresolveof a computed symbol run while the program lowers on every backend, and a definition such aneval'd form makes runs only there: the program's var starts unbound, as the oracle's AOT compile leaves it.resolveanswersnilfor aclojure.corevar this front end lacks (the oracle's var) and for a var of a namespace built into the lowering (clojure.string); a quoted symbol resolves in the namespace the call lowers in, where the oracle reads*ns*when the call runs, and to a definition below the call too.#(...)reads as the oracle's(fn* [p1__N# ...] (body))in source, under a quote and inread-string/read, but N restarts at each top-level form (each datum read), where the oracle's counter runs across the process: the parameter names differ, and two reads of one text answer=forms here. A regex literal passed to a macro reaches the expansion as a fresh pattern compiled from the same source, where the oracle's expansion holds the onePatternobject.#=evaluates while the program lowers, so every backend carries the answer as a literal. Like the oracle's read, the head applies as a function to the unevaluated rest,*read-eval*gates it, and a quote never shields one -- but the answer must have a literal spelling here, so a class (#=java.lang.String), a constructor or a static call, and any other value with none (an atom, a function, a host object other than a UUID or Date) is refused (Can't resolvefor an unknown name,Can't embed object in codewhere the oracle embeds the object). A macro head is the oracle's arity refusal whatever the count; of two or more arguments the oracle runs the macro body on the shifted arguments instead. A discarded#_drops its form without evaluating it, where the oracle evaluates an#=inside first. A map or set literal refuses duplicate keys on the read forms, so two#=answers only equal once evaluated stay two members here, where the oracle refuses the second. An unqualified#=(var x)resolves in the current namespace, where the oracle throws.- Syntax-quote qualifies every symbol but a special form, like the oracle: a core name
spells
clojure.core/name(one a(:refer-clojure ...)filter hides spells its own namespace instead), any other unresolved spelling the defining namespace, an alias head its namespace, a class head its fully qualified name. Eachx#binds one gensym per expansion -- the oracle resolves one per compilation, so two expansions share its suffixes where ours differ (fresher, never captured).macroexpand-1/macroexpandanswer the mangled data itself, so=against a quoted form holds and printing spells the oracle's lowercase. Nested syntax-quote evaluates its levels in the one expansion. - A var's metadata comes from the definitions lowered above the
#'site: a body lowered above a redefinition sees the older docstring until a#'site lowered below the redefinition has run, where the oracle's var shows the newest at once.:nsis the namespace's symbol (the oracle's is a Namespace object),:fileof the entry file is the path as given (the oracle absolutizes it), and a var defined by anything butdef/defn/defn-/defmacro(defmulti,deftest, a record's factory, ...) carries only:nameand:ns. Deref of a macro's var answers its function of the call, the environment and the call's arguments, like the oracle's. Aclojure.corevar's metadata is only:name,:nsand a macro's:macro(the oracle's also carries:arglists,:doc,:addedand the position), and a core var with no value here (#'add-classpath) is refused. - A namespace prints as the oracle's
#object[clojure.lang.Namespace "user"]without the identity hash, andclassof one answers:clojure.lang.Namespace.the-nsandfind-nsknow the namespaces the program created above the call, the libraries it required and the fourclj -Mloads first (clojure.core,clojure.edn,clojure.java.io,clojure.string);in-nsanswersnil(the oracle's answers the namespace).set!andbindingof*ns*change what*ns*reads, not the namespace the forms below resolve in, whichnsandin-nswith a literal name decide. A compiled program's*file*is the entry file's path when it was compiled. The namespace mappings (ns-publics,ns-map, ...) answer what the lowering knows when the call lowers: aclojure.corevar the subset lacks stays out, an import maps to a symbol of its class, and anything computed answers when the call runs on the interpreter and in a JVM class and refuses in a wasm module.alias,refer,ns-unmapandns-unaliaswire while the program lowers, so inside a body they still reach the whole file (the oracle's run when the body runs); aload-stringof a literal declares ahead like a file, so the same form may already name what it defines (the oracle's needs a later form). The standalone(refer-clojure ...)wires the same(:refer-clojure ...)filter that way (:only,:exclude,:rename, answeringnil). As values ((apply require nses)),require,useandin-nsload and switch when the call runs on the interpreter and in a JVM class; a wasm module refuses every application at run time with anUnsupportedOperationException, since its libraries load and namespaces switch while it lowers, where the oracle loads and switches (of no spec,requireandusethrow itsNothing specified to loadeverywhere).bounded-countof a seq a lazy-or-strict verb realized strictly counts whole, where the oracle's stays lazy and stops at the bound;print-dupof a record or a queue prints asprprints it, where the oracle prints itstoString. classanswers a keyword naming the kind (:string,:keyword,:map, ...); the oracle answers host classes, which no wasm backend has. A number answers its class's name as a keyword (:java.lang.Long,:java.lang.Double,:clojure.lang.Ratio,:clojure.lang.BigIntpast a long,:java.math.BigDecimal);1Nis aLonghere, since it reads as a plain integer. A record or deftype answers its tag keyword instead; a host object (interpreter and JVM) its host class.- A byte array prints as the oracle's
#object["[B" ...]without the identity hash, andstranswers[B(the oracle's[B@1b6d3586).asetstores any integer from -128 to 127 in one, where the oracle's reflection takes only aByte((aset bs 0 5)is refused there,(aset bs 0 (byte 5))is not). A seq over a byte array holds the elements the array had when the seq was taken, where the oracle's reads the array as it walks. - A narrowing cast (
byte,short,int) answers a plain integer (g02, measured clj 1.12.6 2026-10-13); the oracle answersByte/Short/Integer. Printing,=, hashing,compare,sort,case, map and set keys, arithmetic (which answers plain integers there too), conversions and truthiness all read the oracle's values, and a byte array reads plain integers where the oracle readsBytes. What needs the box diverges: a member takingbytetakes only aBytethere, so(.put bb (byte 7))is refused like(.put bb 7)-- write a single byte through a one-element byte array instead ((.put bb (byte-array [7]))puts[7 0]on both); a loneshort,intorlongmember converts its fixnum argument as the oracle converts its number (one candidate of the arity takes its arguments however they convert, on both).instance?ofByte/Short/Integeris false for a cast (and ofLongtrue),classanswers:java.lang.Long, and.compareToreads the cast as itsLong(the oracle throws handing aLongtoByte.compareTo). Boxing the casts would move the whole value model (+,=, printing, everyunmarshal) on every backend for that one overload family, so the casts stay plain integers. - A typed array (
object-array,to-array,to-array-2d,into-array,int-array,long-array,double-array,float-array,short-array,char-array,boolean-array) is a vector, as onemake-arraymakes:classanswers:vector,strandprprint the vector,=compares elements,coll?,vector?,sequential?andcounted?are true,asetstores any value, andalengthandaclonetake a vector -- where the oracle answers its array classes, prints#objectwith the identity hash, compares by identity, takes no collection predicate, refuses a mistypedaset, and refuses a vector toalength/aclone. A typed array crosses into ajava:member as the Java array it stands for (object-arrayasObject[],int-arrayasint[]), and a Java array a member answers is a vector stamped with its component the same way; what a member writes into an array argument is copied back when it returns.to-array-2danswers a vector of vectors, read through nested aget (several indexes over one is a rank error, as over any nested vector). Anaset-int,aset-long,aset-double,aset-float,aset-short,aset-booleanoraset-charstores the value its primitive casts into any vector, answering the value itself, where the oracle checks the component; several indexes store through nested vectors, where the oracle's rows areObjectarrays its reflection refuses. Anints,longs,doubles,floats,shorts,charsorbooleansnarrows any vector, where the oracle refuses what is no primitive array. Afloatholds a double, likefloat, so(first (float-array [1/3]))prints long where the oracle's prints0.33333334. Ashorttwo-argument init fills for any integer in the short range, where the oracle fills only for aShort(aShortis an integer here). A smallNliteral is aLong, so it takes aLongcomponent ininto-arraywhere the oracle'sBigIntrefuses, and a computedClassobject is refused as noClass. - A
java.nio.charset.StandardCharsetsfield orCharset/forNameof a string literal (a charset) prints as the oracle's#objectwithout the identity hash, andclassanswers its class's keyword. Only UTF-8, ISO-8859-1 and US-ASCII encode and decode:.getBytesorString.with another (UTF-16, say) is the oracle'sjava.io.UnsupportedEncodingExceptionof its name.Charset/forNameof anything but a literal, and aCharseta Java member answers, stay host objects (interpreter and JVM),=to a charset named in the program only by being the same object. - A transient prints as the oracle's
#objectwithout the identity hash, andstranswers its class name. A bang verb answers the transient it was handed, where the oracle's may answer another object (an array map'sassoc!past eight entries), so a program that ignores the answer keeps every edit here and loses some there.nthpast the end of a transient vector answersnil, as of a vector. - A persistent queue prints as the oracle's
#objectwithout the identity hash, andclassanswers the type's keyword:PersistentQueue. - A
clojure.lang.LispReader$StringReaderor$RegexReader(read) is a function:fn?of one is true, where the oracle's is false. - A delay prints as the oracle's
#objectwithout the identity hash, a failed one's:valthe exception's report where the oracle prints its#errormap, andstranswersclojure.lang.Delay(the oracle'sclojure.lang.Delay@hash). - An instance call on a collection, keyword, symbol, ratio, atom or fn answers through the core
functions and shares their deviations (
.getClassanswers whatclassdoes, but of a fn: the class the oracle compiles it to, whose.getNameis a core function'sclojure.core$name, adefn's or adef'd fn literal'sns$name, and any other fn's that of an anonymous fn,clojure.lang.AFunction$fn, where the oracle spells the enclosing function and a namedfn's name in it; adefninside another form isns$nametoo, the oracle'sns$eval123$name__124). A method of a JDK interface the oracle's class implements (.toArray) is refused on the wasm backends asMethod m taking N args is not supported for class C, and so is, on every backend, a method the oracle's class may have that nothing here answers (.reduce,.meta, an atom's.compareAndSet); a method one value class has is refused that way on every receiver, where the oracle names it missing from another class. Such a call on the interpreter and the JVM reaches the read-only Java object the value crosses to Java as, whose mutators throw only when they would change something (.removeof an absent key,.clearof an empty collection answer), where the oracle's always throw. The class named for a map is an array map up to eight entries and a hash map past them, by size alone.nilis the empty list here, so a collection method answers on it ((.count nil)is0) where the oracle throws aNullPointerException; any other method onnilis one. On a record, deftype or reify, a name that is no protocol method and no field of a record or deftype the program defined is treated as on a collection; a site lowered before a later REPL input defines a protocol, record or deftype does not see that protocol's methods or the type's fields (a later type's methods of a protocol the site saw it does). - A zero-argument
(StringBuilder.)(or(new StringBuilder),(StringBuffer.)) is a string output stream on every backend, the same object as(new java.io.StringWriter):classanswers:java.io.StringWriterand it prints as one's#object,(.length w)answers on aStringWritertoo (the oracle has no such method there), and.appendof one value appends itsstr(nil appends"null"), where the oracle resolves overloads and refuses an ambiguous argument ((.append sb nil)). A one-argument construction pre-fills the stream with the text, an integer argument being a capacity (ignored); any other argument is refused asNo matching ctor found for class ..., nil among them, where the oracle throws aNullPointerException. A one-argumentjava.io.StringWriteris an empty such stream instead: a number is a capacity (ignored), any other argument the oracle'sClassCastExceptiontoNumber(nil itsNullPointerException), whose message carries no module tail.classandinstance?see the builder as theStringWriterit is ((instance? CharSequence (StringBuilder. "a"))isfalse)..internof a string is the string, so onlyidentical?could tell the interning apart.java.util.Locale/US(andROOT,ENGLISH) is itstoStringtext ("en_US","","en"):strand.toStringmatch the oracle, whilepr,class(:string) andstring?read the string..toUpperCase/.toLowerCaseof one argument map as the bare call whatever the argument is, where the oracle casts it to aLocale. - A zero-argument
(java.util.HashMap.)(or(new java.util.HashMap)) is the empty map and a one-argument construction of a map the map itself on the wasm backends, where no mutable map exists;.getand the other lookups read it,.putthrows the oracle's message-lessUnsupportedOperationException(as the read-only map Java is handed the value as throws it on the interpreter and the JVM), and nil builds to the oracle'sNullPointerException. A two-argument construction of two numbers ((java.util.HashMap. 1024 0.25)) is the empty map too, and.putAllof a map stores its entries into the map and answers nil; on a record or a sorted map it throws the sameUnsupportedOperationException..putAllinto a non-empty map literal stores into the literal's own table there, where the oracle throws; the canonical empty map (every empty literal) throws the oracle's exception, since its table is shared.strandclassread the Clojure map ({:a 1}, an array- or hash-map keyword), where the oracle spells theHashMap; a capacity argument answers itself, where the oracle builds an empty mutable map. Where the host is (the interpreter and the JVM) the construction stays that mutable object. - A zero-argument
(java.util.LinkedList.)is a mutable list of this front end's own on the wasm backends, where no host object exists:class,instance?ofjava.util.LinkedListandprintread it as that list (printwrites its members likepr, where the oracle writes the host object), and.removeof an integer is always the removal at that index (the overload the oracle's reflector picks for a long). Where the host is (the interpreter and the JVM) the construction stays the host'sLinkedList. - A zero-argument
(java.util.IdentityHashMap.)is an identity-keyed map of this front end's own on every backend, so a Clojure key never crosses into Java (where each crossing would make a new Java object of it, missing every lookup). A number or a character keys by its value, where the oracle compares the boxed objects;class,instance?andprintdo not read it as the host's map (it prints as(:C%IDENTITY-MAP {...})). - A
(java.util.StringJoiner. delimiter [prefix suffix])construction is a joiner of this front end's own on the wasm backends:class,instance?ofjava.util.StringJoinerandprintread it as that joiner, and.mergeis not offered. Where the host is it stays the host'sStringJoiner. - On the wasm backends a zero-argument
(java.util.WeakHashMap.)is a map of this front end's own keyed by=, as the host'sequals-keyed map is:.put,.get,.containsKey,.remove,.size,.isEmptyand.clearanswer like the host's, and no key is ever dropped (nothing collects one). Ajava.util.Collectionssynchronized wrapper (synchronizedMap,synchronizedList...) is its argument there, no other thread existing. A zero-argument(java.util.ArrayList.)is the mutable list aLinkedListis,RandomAccesstoo, sonthreads it (and refuses aLinkedList, as the oracle does). An(java.util.concurrent.atomic.AtomicReference.)or(AtomicReference. x)construction is a cell of this front end's own:.get,.set,.lazySet,.getAndSet,.compareAndSet(by identity),.updateAndGet,.getAndUpdate,.accumulateAndGet,.getAndAccumulateandstranswer like the host's.class,instance?andprintread each as the value of this front end's own. Where the host is all stay the host's objects; there a value crossing into a hostAtomicReferenceis a new Java object each time, so.compareAndSetof a keyword or a collection never finds the one stored (nil, a boolean or a small integer does). - A zero-argument
(Object.)is a fresh uninterned symbol on the wasm backends, so a load-time lock builds; two constructions are never=oridentical?, like two host objects, but one prints as a gensym where the oracle prints the object's identity. Where the host is it stays the host object. - A
(java.util.Random. seed)(or(new java.util.Random seed)) construction is the JDK's 48-bit linear congruential generator on the wasm backends, answering the oracle's draws bit for bit (.nextInt,.nextLong,.nextFloat,.nextDouble,.nextBoolean,.nextGaussian,.setSeed); a zero-argument construction seeds from host entropy. The seed and bound casts refuse as the oracle's do. Where the host is (the interpreter and the JVM) the construction stays the host object.(Math/floor x),(Math/ceil x)and(Math/log x)of one argument answer the oracle's double on the wasm backends too, refusing as the oracle's casts do.(Math/abs x)of one argument answers the magnitude of an integer in the long range or of a double (Long/MIN_VALUEits own,-0.0answering0.0) on the wasm backends too, refusing as the oracle's no-matching-method does;(Long/bitCount x)and(Long/numberOfLeadingZeros x)of one argument answer the population count and the leading zero count of thelongCastof a number, refusing as the oracle's casts do.Double/MAX_VALUE(andMIN_VALUE, the infinities,NaN) is itself on the wasm backends. A(proxy [ThreadLocal] [] (initialValue [] ...))is a single-threaded cell on the wasm backends (one thread runs there):.getanswers the stored value, computing and storing the initial once when none is stored,.setstores and.removeclears. Where the host is the proxy stays the host's subclass. (System/getProperty k)of a literal key is nil and(System/getProperty k dflt)its default on the wasm backends, where no properties exist (like a host without the property, which is what a library load reads); nil is the oracle'sNullPointerException. A computed key answers the same as it runs (the empty key the oracle'sIllegalArgumentException), and(System/getenv name)reads the WASI environment there.Long/MAX_VALUE(andMIN_VALUE, theInteger/Short/Bytepairs) is itself on the wasm backends, so a load-time constant reads; any other member stays the host field.- A bare class name is its
(:C%CLASS name)designator on the wasm backends, so a class-keyed map builds at load; two literals of one class are equal, like twoforNameanswers. A designator prints as the class's name and answersclass?,.getNameand.getSimpleNamelike the oracle's class object, butstrof one spellsclassahead of the name for an interface too (the oracle:interface). A record's or deftype's class and whattypeanswers are designators on every backend, so on the interpreter and the JVM, where a class literal is the host's class object,(= (type "a") String)isfalse. - A
DateTimeFormatterBuilderchain evaluates on the wasm backends (each builder call threads a marker,toFormatterthe formatter,ofPatternandZoneId/oftheir own), so a load-time formatter builds; parsing or formatting with one is rejected in the oracle's words. instance?answers a class by the oracle classes of each kind of value: a list or strict seq is aclojure.lang.PersistentList, soIPersistentListandCountedaretrueof(map inc [1])andLazySeqis not (the oracle's is aLazySeq); every two-member vector is ajava.util.Map$Entry(map-entry?); an integer is aLong,(int 1)too, never anInteger. Aclojure.langclass of the oracle's jar no kind is an instance of answersfalse;(cons 1 '(2))and(seq (object-array [1]))are lists here, soConsandArraySeqarefalseof them too, where the oracle answerstrue. A protocol's own name (P, a var) is an unknown name, where the oracle throws aClassCastException; its interface (user.P) answers like the oracle's. A class valueclassanswered tells whatclasstells:(instance? (class 1) 1.5)and(instance? (class {}) (sorted-map))aretrue, and a subclass is walked only for an exception or a runtime error, so(instance? (class #inst "2020") ts)of ajava.sql.Timestampisfalse. A keyword is taken for the class keywordclassanswers, so(instance? :a x)through a var answersfalse, where the oracle throws aClassCastException; that exception's message has no module tail.clojure.core$long(anyclojure.core$munged name of a core function) is the classclassanswers for every function here, so it equals(class inc)too. A(clojure.lang.PersistentArrayMap. array)holding a key twice keeps one entry, the later value; the oracle's map holds both. Aclojure.lang.LineNumberingPushbackReader's.unreadhands back the character its last read answered, whatever it is given, and.readLineends a line at a line feed only (a lone carriage return still counts as a line end for.getLineNumber).reduceandreduce-kv(and the verbs built on them) consultclojure.core.protocols/CollReduceandIKVReducefor a record, deftype orreifyonly: an extension of either tonil,Objector a core kind is reached throughcoll-reduceorkv-reducethemselves, where the oracle'sreducealso takes one for a collection that does not reduce itself (a string, a map). A call of a protocol method with a count an inline body leaves out signals anArityException(the oracle: anAbstractMethodError).- A
reify,deftypeordefrecordbody implements theclojure.langinterfaces the core functions consult --IReduceInit,IReduce,IKVReduce,Seqable,Counted,Indexed,ILookup,IFn(withCallableandRunnable),IDeref,IMeta,IObj--,CharSequence, the collection interfaces (IPersistentMap,ISeq,Sequential,Iterable,java.util.List...) and overridesObject's methods (reify); any otherclojure.langinterface (IChunkedSeq...) is refused by name, and any other host interface (Closeable,Lock...) answersinstance?and its methods' calls, a default method the body leaves out refused when called from Clojure (the oracle runs the interface's).first,nextandrestof anISeqtype read it through itsseq, a verb may call a method another number of times than the oracle, andstrof a collection type spells its contents,re-matcherandre-findread aCharSequencetype in prefixes of 16, 32, 64 ... characters (past where the oracle's matcher stops), and the other regex functions andclojure.stringread it whole through itslengthandcharAtonce per call (collection interfaces). A type with a hash and an equality of its own keys a map or a set by value, every map comparing its keys as the oracle's hash map does, where the oracle's array map (up to eight entries) compares them without hashing; a map, set or sequential type is bucketed by its contents rather than itshasheq(map keys).sortanddistincttake a type implementingSeqablealone through its seq, where the oracle refuses both. - A program-defined interface (
definterface) joins the same rows under its own binary name, whichinstance?tests and a.methodcall dispatches on (reify). Deviations: the name's value is the binary-name string (the oracle's class object), soresolveanswers its var andstrspells the name bare; redefining the interface replaces it, and instances made before the redefinition still satisfy it, where the oracle's are instances of the old class only; a wrong-count call on areifynamesjava.lang.Object(a reify's class is no host class here), and the abstract refusal of a method the body leaves out names the method and the interface but no receiver class. clojure.core.reducersfolds on the calling thread, its parts one after the other, andcatof two non-empty collections answers one accumulator (a vector) holding both, where the oracle answers aCattree whose fold combines its halves' folds.- The
unchecked-arithmetic verbs wrap integers at 64 bits (-intverbs at 32) and the castsshort,byte,charandfloatmatch the oracle, with one deviation: an integer past 64 bits is a plain integer here, so the oracle's unwrapped bigint operand ((unchecked-add 9223372036854775807N 1)) wraps too.intandlongare the oracle's casts, range checks and messages included. A literal argument takes the cast of its own type, any other the object cast: a double the oracle's compiler types as a primitive (aletlocal bound to a double literal,(* 2.0 x)) refuses withValue out of range for int: 2.0E10there andinteger overflowhere.doubleof a ratio is its nearest double ((double 2/3)is0.6666666666666666), where the oracle rounds it to 16 significant digits first (0.6666666666666667).inc',dec',+',-'and*'areinc,dec,+,-and*: integers are bignums, so nothing overflows, and anything but a number is refused with the oracle's class.castanswers the value when it is an instance of the class (itsinstance?test for a named class, the protocol tag for a computed one),nilofnil, else the oracle's refusal; a host class no value here has always refuses (host classes exist on no wasm backend). +,-,*,incanddeccompiled under a truthy*unchecked-math*(trueor:warn-on-boxed) wrap a 64-bit-integer sum, difference or product mod 2^64; anything else -- a double, ratio or out-of-range-integer operand -- is the plain verb. The flag is read where the call compiles, like the oracle's: below a top-levelset!of it in the file, a file starting with the flag of the code requiring it and handing it back at its end. Only a call below aset!of a computed value, and a form lowered as the program runs (eval), reads the flag when it runs. No boxed-math warning is ever emitted, so:warn-on-boxedwraps exactly liketrue. As values (+,apply +,map inc, ...) the verbs keep the default promoting behavior on every flag, where the oracle's function values throw on overflow.formatrenders and refuses asjava.util.Formatterdoes (a computed format string parses when the call runs), except:%h,%aand%tare refused (when the call runs); an integer past the long range renders as aBigInteger(the oracle refuses itsBigIntunder%d/%x/%oand renders abiginteger);intanswers a long, so(format "%x" (int -1))is 64 bits off(the oracle's 32), and%crefuses an integer (the oracle takes anIntegercode point).upper-case,lower-case,capitalize,.toUpperCase,.toLowerCase, the uppercaseformatconversions andcl-format's case clauses map as the oracle'sStringmethods do in a locale other than Turkish, Azerbaijani and Lithuanian (ßtoSS, a capital sigma ending a word toς), except in a word holding a character past the BMP, where the JDK can see a word end that is not there:(lower-case "Α𝐀Σ")is"α𝐀ς"here and"α𝐀σ"in the oracle.line-seqtakes an open reader (such as aclojure.java.io/reader, whichwith-opencloses), or a path, a File, a URL or a byte stream it opens, and answers strictly either way but over an HTTP reply, which it reads lazily (the oracle takes a reader only and answers lazily);spit/slurp/line-seq/readerrun on every backend, on wasm with a--dirpreopen covering the file.- The Ring adapter (
ring.adapter.rontolisp/run-server) puts:content-typeand:content-lengthin the request map but not:character-encodingor:ssl-client-cert. An asynchronous handler and a second concurrent server are refused or replaced, and ajava.io.Filebody naming no file signals (500) where Jetty answers an empty 200 (see the adapter). - The built-in Ring utilities name a charset by a string (UTF-8,
ISO-8859-1, US-ASCII and the JDK's aliases for them; any other is refused), have
ring.util.request/body-stringas a function rather than an extensible multimethod, and read only ASCII digits incontent-length. - A sorted map or set orders, prints and finds keys like the oracle's, but every verb
copies it (an association costs the collection's size, like a hash map's);
classanswers:map/:set; asubseqorrsubseqwalking from the first member that finds nothing answersnil(the oracle()); a test passed tosubseqas a value is recognized by how it answers(1 0),(0 0)and(-1 0), where the oracle compares it with the core functions.compareorders strings by code point (the oracle by UTF-16 unit, which differs past U+FFFF). - String indexes and lengths count Unicode code points on every backend, past the BMP
included:
count,subs,.substring/.subSequence,.charAt,nth/get,clojure.string/index-of/last-index-of,.indexOf/.lastIndexOfandcompareall read that space (.indexOfof anintsearches its character). The oracle counts UTF-16 units instead, so every astral answer differs there ((count "a🌍b")is 3 here and 4 there). A UTF-16 offset from Java, JavaScript, the LSP or another editor crosses the boundary converted: index arithmetic composed from one of these calls to another keeps working, but a foreign offset must be translated first.lower-case(and.toLowerCase) folds the same code-point word scan, so the astral word edge stays divergent too ((lower-case "Α𝐀Σ")is"α𝐀ς"here and"α𝐀σ"in the oracle). floatanswers a double, so(float 1/3)is0.3333333333333333(the oracle's Float prints0.33333334); a value past the float range still signals.modandremof a NaN or infinite dividend throw anArithmeticException(the oracle: aNumberFormatException).vector-ofanswers an ordinary vector: a laterconjorassocstores its value as given, where the oracle's keeps casting, and:floatholds doubles.emptyof a list, a lazy seq or a seq answersnil(the oracle(), the empty-as-nilposition ofrest), so it carries no metadata, and of a map entry[](the oraclenil).partition-allwith a non-positive size or step signals, where the oracle answers an endless seq of().pmapruns one future per element on the interpreter and the JVM, dereferenced in order with the oracle's lookahead, so the printed seq is the sequential one's (sequentialmapon the single-threaded WASM legs).pvaluesruns one future per expression, dereferenced in order (nilwhen empty, where the oracle's empty lazy seq prints(); sequential in order on the WASM legs); a failure in either surfaces at thederefin order, wrapped in the oracle'sExecutionException(the sequential legs throw the raw condition).take-nthwith a zero step signals, and its seq arity steps by the magnitude of a negative one, where the oracle's repeats the first member forever.- Transducers are the oracle's functions over reducing functions, but an
eductionis thesequenceof its input through them, computed once (strictly over a strict input, lazily over a lazy one), where the oracle re-runs the transformation every time it is reduced;printlnprints it as that seq where the oracle prints the object. An input reducing through its ownCollReducerow is reduced at theeduction, so itsseqanswers where the oracle's refuses. Areducedvalue prints as its wrapper list. - Transactions detect conflicts by version:
dosyncruns its body without holding any lock, tracking every deref,alterread andensurein a read set, and at the commit point retries the body when another transaction committed a write to a read ref -- so a body may run more than once and its side effects may repeat, like the oracle's. Writes only log until commit, so a concurrent body never reads an uncommitted write.commuteapplies at commit, running its function twice uncontended, like the oracle's; analteror aref-setafter acommuteof the same ref in the same transaction is the oracle's "Can't set after commute" refusal.syncis the same run with its flags dropped unevaluated (a nestedsyncjoins the running transaction like a nesteddosync);io!refuses inside one with the oracle'sIllegalStateException(I/O in transaction);with-loading-contextis its body as-is. A body that waits for another thread's transaction never finishes, and a read outside a transaction may see a running one's write, where the oracle's sees only committed values. - Agents run their actions on a shared pool of up to four worker threads on the
interpreter and the JVM, a worker ending once no agent waits: a send only queues the action and answers the agent at
once, and one agent's actions run one at a time in send order.
send-offshares the pool (the oracle gives it an unbounded pool of its own), and no creation-time bindings reach the new thread (onlybound-fn*conveys any). On the WASM legs, by contrast -- single-threaded modules -- a send to an idle agent still runs its action on the sender's thread beforesendreturns, and one to an agent another thread is running joins that thread's queue; likewiserestart-agentruns the queue kept behind a failure on its own thread there, and an error handler runs on the thread running the failing action. An agent prints unreadably,#<Atom ...>, not the oracle's object;shutdown-agentsanswersnil, and*agent*is bound only while an action runs (niloutside one, where the oracle leaves it unbound).(await-for 0 a)races the pool and may answerfalse, like the oracle's; on WASM the actions run first, so it answerstruethere. tap>on the interpreter and the JVM queues its value for a tap thread, like the oracle's (1024 values; a full queue answersfalse), so a value tapped just before the program ends may never reach its taps. On the WASM legs -- single-threaded modules --tap>calls every tap before it returns and always answerstrue. Taps are called in the order they were added, andremove-tapfinds a tap byidentical?(the oracle's set: by=).- A
defnwith no value cell validates its new function only once its definition is bound: where the validator refuses it, the call still reports the oracle'sInvalid reference state, but later calls reach the refused definition (the oracle keeps the old one). A refuseddefmacroredefinition still serves its new expander (the call sites below it expanded with it while lowering and the table holds it), where the oracle keeps the old root and drops the macro. swap!,reset!,compare-and-set!,swap-vals!andreset-vals!also take a ref or a volatile, whose cell an atom shares (the oracle's refuse anything but an atom).bindingrebinds only^:dynamicvars (anything else is refused, like the oracle's non-dynamic error); a^:dynamicdefnis rebindable too (its calls go through the var while the definition stays direct); reader metadata on names and locals otherwise parses and drops, never affecting dispatch.with-precisionbinds*math-context*to the math context of the evaluated precision and rounding mode around its body, which the decimal arithmetic rounds under like the oracle's; it prints as the oracle's#objectwithout the identity hash.bound-fnisbound-fn*overfn: the captured creation-time bindings are pushed over the caller's own, so a call on another thread sees them; a var bound nowhere at creation stays out of the map, and abound-fn*created under a dynamically enteredwith-local-varsextent does not see that cell.with-local-varsbinds each name to a fresh var cell, unbound at the root and restored by leaving (anunwind-protectrestores every cell, so a throw still restores); the cells print#'ns/name(the oracle's are unnamed),alter-var-rootof one is refused, and arecuracross the body is refused like the oracle'stryboundary.- In the REPL, a local named like a
^:dynamicvar that a later input defines binds that var for its extent once it is defined, so a function called there reads the local's value; the oracle binds a local lexically, and the function reads the var. In a file such a local is lexical. - The root
with-redefsandalter-var-rootreplace is the var's value cell, so inside abindingof a^:dynamicvar they change that binding (the oracle changes the root and the binding stays). Aclojure.corevar is refused by name, and so is a multimethod, record constructor or test thatalter-var-rootreaches; in the REPL, so is adefnan earlier input defined without^:redefand a protocol method an earlier input defined. A protocol method's replaced root reaches every call, where the oracle's call site with a target implementing the protocol in its body calls the type's method directly (schema'ss/defprotocoladds:inlineto defeat that). - A fn has no protocol method cache:
(.__methodImplCache f)isniland aset!of it stores nothing. Aset!of a record's declared field isNo matching field found(anIllegalArgumentException), the oracle's anIllegalAccessException(Can not set final ... field). lockingholds a mutex kept per value, and the lock table keeps every value it was handed for the program's lifetime. TheNullPointerExceptionof anillock names the locallocklocal(the oracle names a generated one).with-metaanswers a copy carrying the metadata;assoc(andupdateandassoc-inthrough it) keeps the source's metadata, like the oracle, while any other value derived from it (conj,dissoc, ...) starts without metadata, where the oracle keeps it, and a symbol keys a map or set without its metadata ((meta (first (keys {(with-meta 'x {:a 1}) 1})))isnil, the oracle's{:a 1}); a definition's:arglistsleave out its parameters' type hints, which the oracle keeps on each parameter symbol. A:tagfrom reader metadata on a collection literal stays the symbol as written (String), where the oracle resolves the class (java.lang.String); a{:tag Type}on adefnaming a record or deftype keeps the quoted symbol for the same reason (a type is no class here), where the oracle stores the class.with-opencloses through theclosemethod, so only closeables the backend reaches work (aclojure.java.iobyte stream on every backend, a Java closeable on the interpreter and the JVM);timeanswers its value but its millisecond count never pins, and it counts whole milliseconds (42.0) where the oracle's carries nanosecond digits.read-string/readanswer what a quote answers:@xreads(deref x)and a syntax-quote stays unexpanded, where the oracle reads(clojure.core/deref x)and expands it. A record literal reads for any class the program defines, also one a laterrequireloads (the oracle needs the class loaded first); a deftype literal is refused.readtakes a stream -- a plainclojure.java.io/readertoo, where the oracle requires aPushbackReader-- and refuses a host reader.#instand#uuidread as the oracle'sjava.util.Dateandjava.util.UUIDon every backend, and so do thejava.util.Date,java.sql.Timestampandjava.util.UUIDconstructions and statics; Instants and UUIDs lists the few differences (strof an instant answers in UTC, a host Date or UUID a Java member answers is=to one made here but prints as the host object and is another map key).clojure.java.io'sjava.io.File,java.net.URL,java.net.URIand byte streams are values of this front end's own on every backend; clojure.java.io lists the differences (three charsets, anhttp:URL read only by a program that usesrontolisp:fetchfor it, a resource found on the source path rather than the class path, WASM's directories, a byte-array streaminput-streamanswers unwrapped).- A data reader runs as the program compiles, so its answer in source loses its metadata
and needs a spelling here: a function, a deftype instance and a host object other than a
UUID or Date are
Can't embed object in code, where the oracle compiles one itsprint-dupprints;()isnilhere, so an empty list answer isNo dispatch macro. Aset!of*data-readers*or*default-data-reader-fn*changes whatread-stringandreadread, never the program's source, where the oracle's load reads the file's later forms (and the REPL its later inputs) with it. Thedata_readersfiles of the entry file's own root count too, where the oracle reads only its classpath's. *out*/*in*/*err*are*standard-output*/*standard-input*/*error-output*(rebinding rebinds the standard streams); read at the root,*out*and*in*are stream values over the process standard streams;defoncekeeps the root on reload wheredefresets it.- A fn passed where a Java interface is expected implements every abstract method of
any interface, each called with the method's arguments; the oracle converts a fn only
to an interface annotated
@FunctionalInterface(aPropertyChangeListeneris aClassCastExceptionthere). As in the oracle, a fn Java takes as aRunnable,Callable,ComparatororObject, inside a collection too, is the fn Java hands back ((.comparator (java.util.TreeSet. f))isf,(.invokeAll pool [f g])runs both), and where the method answers an object the fn's answer is the value's own object; the fn's Java object spells itselfclojure.lang.AFunction@1b6d3586, where the oracle's names the fn's own class. Where the method answers a primitive the answer is cast as the oracle's adapter casts it, a boolean by its compiler's(Boolean)cast where the call resolves before it runs and by its reflector's truthiness where it does not: a call the oracle resolves only through a type hint (dropped here) or a collection literal's class ((.filter (.stream [1 2]) pred)) reads a predicate'snilasfalsehere where the oracle throws. Aproxybody's primitive answer is unboxed as the oracle's proxy class unboxes it. - A value passed to Java is an object of this front end's classes that Java reads as the
oracle's own: a vector, list, lazy seq, set, map, record or sorted collection a read-only
java.utilList,SetorMap(a vector alsoRandomAccessandComparable) printing as Clojure prints it, a keyword, symbol or ratio an object hashing, comparing and printing as the oracle's (a ratio aNumber), a deftype or reify whose body implements a Java interface or overrides anObjectmethod, or a record whose body implements a Java interface, an object implementing those interfaces (a record's also itsMap) and calling the type's methods, a fn the object the fn is (above), and an atom, other deftype or reify or other value an object equal only to itself, spelled as the oracle'sObject.toString(clojure.lang.Atom@1b6d3586). Java hands each back as the value itself. What differs: the class Java sees (getClass, and the JDK'sClassCastExceptionmessages naming it; the front end's own cast failures name the oracle's class but lack the module tail; a reify's class is its namespace'sns$reify, where the oracle numbers each); the members are converted once, when the value crosses, a lazy seq realized to its end; thetoStringis whatstranswers here (a lazy seq and a record spell their contents); a value whose oracle class is noComparableis one here whosecompareTothrows the oracle'sClassCastException; Java sees no field of a deftype. A Java array a member answers is a list here, which converts back to an array where one is expected and nothing takes the list whole -- so(java.util.Arrays/asList [1 2])is a list holding the vector, where the oracle throws -- and so does an arraymake-arraymakes, a vector here. A byte array crosses as thebyte[]of its bytes, its own on the interpreter and the JVM alike, so an array a Java object keeps (ByteBuffer/wrap's, aByteBuffer's.array) is the byte array itself. Abyte[]coming back is a new byte array over the same bytes, neveridentical?to one that went out; so is one Java hands aproxy, a deftype or reify method or a fn. System/arraycopycopies between two arrays here itself, on every backend, and does not check that the two hold the same component type (it refuses a byte array and any other array). Where no host is (wasm),java.util.Arrays'copyOf,copyOfRange,sort,parallelSortandfillrun here too; no array records its component there, so a copy of anint-arraypadsnilwhere the oracle pads0.- An integer receiver is called as an
Integerwhen it fits one, else as aLong(the oracle's is always aLong):(.getClass 1)answersjava.lang.Integer. Where no host is (wasm), a number's, a string's or a character's.getClassis whatclassanswers and its.compareTo(a number's or a string's) iscompare's. - A
_param tag leaves that parameter to the cost rule of thejava:surface, so(^[_] Math/abs -2)answers2where the oracle refuses tags that leave more than one overload. - An argument's
:tag-- its own, or a hintedletlocal's or parameter's -- picks the overload where the call's class is known before it runs, as the oracle's compiler does; a receiver's hint is dropped, so(defn f [^ExecutorService e ^Runnable r] (.submit e r))calls by reflection, which reads no hint. Only its refusal follows the hint: where the hinted class is a host class with one method of that name and count, a value that has no such method (an unbound var's root, a keyword) is the oracle'sClassCastException, not the reflector'sIllegalArgumentException; a string or number is still called by reflection. A fn passed whereCallableand another interface both take it is aCallable:(.submit e (fn [] 1))answers a future of1where the oracle refuses an unhinted call on a typed receiver (More than one matching method found: submit), and reflectively on aScheduledThreadPoolExecutorpickssubmit(Runnable)(itsgetMethods()order; a future ofnil). (.thenComparing c (fn [a b] ...))takes the fn argument as aComparatorand compares by it, where the oracle refuses a fn literal or local there at compile time (More than one matching method found: thenComparing: theFunctionoverload takes it too).- A dependency's Java class compiled against
clojure.lang(a Clojure library's own class over it, such asreitit.Trie) cannot link here, and every call on it refuses withCannot link class C: missing class M, naming the missing class -- catchable by(catch Exception e ...)on the interpreter and the JVM alike (on wasm everyjava:call is a call-time error). A class whose static initializer needs the missing class (a static field of its type, as insci.impl.FISupport) refuses the same way: itsExceptionInInitializerErrorcarries the missing class, so construction, calls and static-field reads answer the same refusal, while a genuinely broken initializer propagates as it did. There is noclojure.langbridge, and none is planned: no value here is anIPersistentMap, so dependency code taking one could not read it anyway. Libraries that need one also ship a portable path (reitit'sclojure-trie-compileranswers the oracle's lines), and the reader takes a library's:rontolispbranch where one names it first. - A namespace whose
.clj(or.cljc) imports such a class in itsns-- one whose superclass or interface is missing -- is read from the.cljsbeside it in the same jar, the library's ClojureScript port: the jar's.cljis not what runs. persistent-sorted-set'sme.tonsky.persistent-sorted-set(and so datascript's indexes) and datascript'sdatascript.storageare read so, on every backend, wasm included. A var the.cljdefines and the port does not (store,restore-by, datascript's file storage) refuses when it is called, naming the port. The port is read as ClojureScript reads it: itscljs.corenames are referred, acljs.coreprotocol in adeftypeis theclojure.langinterface standing for it (ISeqableisSeqable,ICountedCounted...),^:mutablemarks a mutable field,:require-macrosrequires the namespace,js/MathandMathanswer an integer where the result is whole (ClojureScript prints(js/Math.pow 2 5)as32),js/Error.makes aRuntimeException, and.sliceof an array is JavaScript's. Other differences:seqof a port's collection is a list like every seq here, not the port's own seq object, so a port function taking that object (persistent-sorted-set's(seek (seq set) k)) does not take it --slice's answer is the object;/of two integers is a ratio, as in Clojure; anotherjs/name refuses where it is reached. - On the wasm backends a plain Java class a dependency ships beside its sources --
specter's
com.rpl.specter.MutableCellandUtil-- is read from its class file as the Clojure it amounts to: its constructors, methods, static methods and static fields run where no host object exists, andclass,instance?andprintread it as the class it names. The class must extendObject, implement no interface, have no public instance field and keep to its own fields and methods: locals, constants, arrays,int,longanddoublearithmetic, branches and switches, but nofloat, no exception handler and no other class's member (a string concatenation calls one). A cast inside it checks nothing. Any other class stays the host's and refuses when called there, as everyjava:call does. Where the host is (the interpreter and the JVM) the class is always the host's. - Only
.cljand.cljcfiles below the source roots are read, and a.cljsonly as such a port. A dependency's jar holding classes also joins the Java class path; a directory's classes do not (give a prepped library'starget/classeswith--java-classpath). The project'sdeps.ednis the nearest one at or above the entry file, where the oracle reads the working directory's. Without the command line (an embedder, the browser playground) a Maven or git coordinate is not fetched: a namespace only it could hold is refused, naming it, and the rest of the program runs. A built-in library fetches nothing, its own dependencies included; the built-in Ring namespaces load without aring/ring-corecoordinate (the oracle needs one) and stand in for an older ring-core than the one shipped. Without the command line apom.xmlproject is not read either. A library not fetched gives no data readers either: a tag only itsdata_readers.cljmaps has no reader function, naming it.settings.xmlcredentials answer Basic authentication only (the oracle also answers Digest and NTLM), and a download,maven-metadata.xmlincluded, is always checked against its.sha1(the oracle's default only warns). A file no repository had is not asked for again until the repository's update policy says so,:dailyunless its:updatenames another (the oracle asks on every run). A git tag is checked against the local clone, which is fetched only when the tag is missing or names another commit (the oracle fetches on every resolution); checkouts live in~/.rontolisp/gitlibs, not~/.gitlibs. Two commits of one library neither of which descends from the other are refused naming both, where the oracle throws without a message. A dependency's:deps/prep-libis checked, never run. Top-level dependencies are expanded in the file's order, where the oracle takes a map of more than eight in its hash order: the two differ only where the selection rests on which was seen first (one version spelled two ways,1.0and1.0.0). -M -mand-Xname a namespace or function that is missing the way any program does (Could not locate my/app.clj ...,No such var: my.app/-main), where the oracle saysNamespace could not be found on classpath,loaded but function not found, or throws aNullPointerExceptionfor a missing-main.clojure.main's-e,-iand--report,-Xarguments read from standard input (-) and-Ttools are refused.:jvm-optsis ignored, and a selected alias whose value is no map adds nothing. A run without a file (-M -m,-X,-e, the REPL) searches the working directory first, which the oracle's classpath does not hold.rontolisp testis nocljcommand: it follows the cognitect test-runner's defaults (namespaces ending in-testundertest).- A reader conditional takes
:rontolisptoo, ahead of:cljwhere a form names it first. Under{:read-cond :preserve},classof a reader conditional or tagged literal answers:clojure.lang.ReaderConditional/:clojure.lang.TaggedLiterallike every class keyword here, and(reader-conditional nil false)prints#?(), as one read from#?()does. In a branch not taken,::alias/kwof an unknown alias reads (the oracle refuses it); the runtime reader splices#?@(:clj nil)as nothing (the oracle refuses it) and takes:featuresas a hash set only. - A bare class name no import names resolves to the one record or deftype of that name another namespace defines (the oracle needs the import); a name the namespace imports is the imported class.
- A name referred from two namespaces keeps the later refer (the oracle refuses it), and a definition replaces a refer of its name without the oracle's warning.
clojure.spec.alphaloads from its own jar, butexplainnames a bare predicate that is a namedfn((fn pos [x] ...)) or adefwhose value is a macro call expanding to a fn:clojure.spec.alpha/unknown, where the oracle names it (adefn, adefof a fn literal, a core function and every predicate a spec macro takes keep their names).clojure.spec.test.alpha'sinstrumentreaches a function itsfdef(or any quote) names: a function named only by a symbol the program builds keeps direct calls, so itsalter-var-rootis refused. What resolves a symbol or requires a namespace computed as the program runs --instrument,check,explainof a regex spec over a value that is no sequence,formofnilable, the generators (gen,exercise, over test.check from thedeps.edn) -- runs on the interpreter and in a JVM class and is refused in a wasm module.clojure.lang.RT/checkSpecAsserts, whichcheck-assertssets, starts false: theclojure.spec.check-assertssystem property is not read.