Skip to content

Commit

Permalink
further eval refinement
Browse files Browse the repository at this point in the history
  • Loading branch information
puredanger committed Aug 20, 2024
1 parent 5e49e95 commit 70f66cf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions content/reference/evaluation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ A Symbol is _resolved_:
* If it is namespace-qualified, the value is the value of the binding of the global var named by the symbol. It is an error there is no global var named by the symbol, or if the reference is to a non-public var in a different namespace.
* If the qualifier names a class or a mapping from symbol to class in the current namespace or a primitive name, and the symbol name is:
** a static field in the class, then the value is the value of the static field.
** a method of the class, then the value is a Clojure function that invokes the method (since 1.12).
** `1`-`9`, then the value is the array class with a dimensionality equal to the number supplied
** a static method of the class, then the value is a Clojure function that invokes the static method.
** a `.` prefixing an instance method of the class, then the value is a Clojure function that invokes the instance method (since 1.12).
** `new`, then the value is a Clojure function that invokes the constructor (since 1.12).
** `1`-`9`, then the value is the array class whose component type is the qualifier and dimension per the digit (since 1.12).
* Else, it is not qualified and the first of the following applies to the symbol name:
. If it names a special form it is considered a special form, and must be utilized accordingly.
. If in a local scope (e.g. in a function definition or a let form), a lookup is done to see if it names a local binding (e.g. a function argument or let-bound name). If so, the value is the value of the local binding.
. A lookup is done in the current namespace to see if there is a mapping from the symbol to a class. If so, the symbol is considered to name a Java class object. Note that class names normally denote class objects, but are treated specially in certain special forms, e.g. `.` and `new`.
. A lookup is done in the current namespace to see if there is a mapping from the symbol to a var. If so, the value is the value of the binding of the var referred-to by the symbol.
. If names a class or a mapping from symbol to class, the value is the Java class named by the symbol.
. If it names a class or a mapping from symbol to class, the value is the Java class named by the symbol.
. It is an error.
If a Symbol has metadata, it may be used by the compiler, but will not be part of the resulting value.
Expand Down

0 comments on commit 70f66cf

Please sign in to comment.