Welcome! Please see the About page for a little more info on how this works.

+2 votes
ago in Docs by

The reader reference on clojure.org says "Symbols containing / or . are said to be 'qualified'." but qualified-symbol? is defined to return true if the argument is a "symbol with a namespace".

Almost every reference to a "qualified symbol" in the docs (on clojure.org) refers to a "namespace-qualified symbol" or a "fully-qualified symbol" (also with a namespace).

The only other type of "qualified symbol" mentioned is on the evaluation page where it refers to a "package-qualified symbol" for a Java class name.

I suggest changing that original sentence to read "Symbols containing / are said to be 'namespace-qualified' or 'fully-qualified'. Symbols containing . are said to be 'package-qualified' if they identify a Java class name." or something similar.

ago by
Recently I ran into an interesting behavior of "symbols that contain periods but not slashes":
```
(defn page.html [])  ;=> fine
(page.html) ;=> syntax error
((resolve 'my.ns/page.html)) ;=> fine
(my.ns/page.html) ;=> fine
```
They can be used to define functions, but require ns qualification to call. Hehehehe.
ago by
Syntax error (ClassNotFoundException) compiling at (REPL:2:1).
page.html

I was not expecting that :)

1 Answer

0 votes
ago by

"Qualified" means more than one thing depending on context. Java classes are "qualified" by their package name. symbols are "qualified" by their namespace. class names are syntactically represented by a symbol which has overlapping senses - the class package is a dotted prefix that lives in the "name" part of the symbol.

qualified-symbol? is specifically referring to namespace qualification.

My guess is that Rich would say that the original sentence is correct and written as intended.

...