It's not really implicit though, the first element of a list that is evaluated is always a function. So (FUN 1 2) is an explicit function call. The problem is that it doesn't look like C-like languages, not that it's not explicit.
In theory ' just means QUOTE, it should not be overloaded (although I've mostly done Common Lisp, so no idea if in other impl that changes). Can you show an example of overloaded meaning?
Still unsure, whether a naked single quote character for (quote …) is really a good idea.
Got used to it by typing out (quote …)-forms explicitly for a year. The shorthand is useful at the REPL but really painful in backquote-templates until you type it out.
CL:QUOTE is a special operator and (CL:QUOTE …) is a very important special form. Especially for returning symbols and other code from macros. (Read: Especially for producing code from templates with macros.)
Aside: Lisp macros solve the C-fopen() fclose() dance for good. It even closes the file handle on error, see WITH-OPEN-FILE. That alone is worth it. And the language designers provided the entire toolset for building stuff like this, for free.
No matter how unusual it seems, it really is worth getting used to.
There's an example I saw where `'` was used as a way to denote a symbol, but I can't find that explicit example. It wasn't SBCL, I believe it may have been Clojure. Its possible I'm misremembering.
That said, since I work in C-like languages during the day, I suppose my minor complaint has to do with ease of transition, it always takes me a minute to get acquainted to Lisp syntax and read Lisp code any time I work with it.
Its really a minor complaint and one I probably wouldn't have if I worked with a Lisp language all day.
that's correct, but its not that it denotes a symbol as a different function of ', its the same function. Turn code into data. That's all symbols are (in CL at least).
For example in a quoted list, you dont need to quote the symbols because they are already in a quoted expression!
'(hello hola)
' really just says "do not evaluate whats next, treat it as data"
to be a bit more precise, everytime you have a name in common lisp that is already a symbol. But it will get evaluated. If its as the first item of an evaluated list it will be looked at in the function name space, if elsewhere it will be looked up at the variable name space. What quote is doing is just asking the compiler not to evaluate it and treat it as data.
The tricky bit is that it doesn’t quite denote a symbol.
Think of a variable name like `x` usually referring to a value. Example in C89:
int x = 5 ;
printf("%i\n", x) ;
The variable is called `x` and happens to have the value of integer 5. In case you know the term, this is an "rvalue" as opposed to an "lvalue".
In C-land (and in the compiler) the name of this variable is the string "x". In C-land this is often called the identifier of this variable.
In Python you also have variables and identifiers. Example Python REPL (bash also has this):
>>> x = 5
>>> x
5
In Common Lisp they are called symbols instead of identifiers. Think of Python 3's object.__dict__("x") .
Lisp symbols (a.k.a. identifiers a.k.a. variable names) are more powerful and more important than in C89 or Python, because there are source code templates. The most important use-case for source code templates are lisp macros (as opposed to C89 #define-style macros). This is also where backquote and quasiquote enter the picture.
In Lisp you can create a variable name (a.k.a. an identifier a.k.a. a symbol) with the function INTERN (bear with me.)
(intern "x")
is a bit like adding "x" to object.__dict__ in Python.
Now for QUOTE:
Lisp exposes many parts of the compiler and interpreter (lisp-name "evaluator") that are hidden in other languages like C89 and Python.
Like with the Python example ">>>" above:
We get the string "x" from the command line. It is parsed (leave out a step for simplicity) and the interpreter it told to look up variable "x", gets the value 5 and prints that.
(QUOTE …) means that the interpreter is supposed to give you back the piece of code you gave it instead of interpreting it. So (QUOTE x) or 'x — note the dangling single quote — returns or prints the variable name of the variable named "x".
Better example:
(+ 1 2)
Evaluates to number 3.
(quote (+ 1 2))
and
'(+ 1 2)
both evaluate to the internal source code of "add 1 and 2" one step short of actually adding them.
In source code templates you sometimes provide code that has to be evaluated multiple times, like the iconic increment "i++" has to be evaluated multiple times in many C89 loops. This is where QUOTE is actually useful. (Ignored a boatload of detail for the sake of understandability.)
In theory ' just means QUOTE, it should not be overloaded (although I've mostly done Common Lisp, so no idea if in other impl that changes). Can you show an example of overloaded meaning?