I can not understand this line of code :
(defun loop?_0 (x) (eql x 4))
"?" is a part of the function's name ? or something else !?
What it means ?
Re: What it means ?
Until it's a reader macro (though ugly) then it's simply a symbol/identifier. CL is quite benevolent in this.
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version). Temporary mirrors of aferomentioned: CLHS and a dark version.
Re: What it means ?
Some times people use "?" in a function name to signal that the function will return a boolean or a generalized boolean value. But your variant looks more like a manga style smiley
I didn't encounter this kind of naming before.
On the same note, the below are also valid function names:
But you don't really have to use them...

On the same note, the below are also valid function names:
Code: Select all
(defun >__< () (princ "(>__<)"))
(defun *.* () (princ "(*.*)"))
(defun @_= () (princ "(@_=)")
(defun ^..^ () (princ "(^..^)")
; which you can use like this:
(>__<) (*.*) (@_=) (^..^)
Re: What it means ?
Lisp allows you to use all ascii-characters (IIRC, could be printable ascii characters) or unicode characters, depending on the native character set of your implementation, in symbol names, with the exception of the space, the #, the \, the @, the `, the ' and the ( and ) (I might be missing one). So, it's perfectly fine to use a!=b? as the name of a function.mparsa wrote:I can not understand this line of code :
(defun loop?_0 (x) (eql x 4))
"?" is a part of the function's name ? or something else !?