why del is not a function or method?
Marko Rauhamaa
marko at pacujo.net
Tue Oct 17 12:01:07 EDT 2017
Terry Reedy <tjreedy at udel.edu>:
> On 10/17/2017 1:07 AM, Steve D'Aprano wrote:
>> -- unless the interpreter
> made del a special case, not a regular function.
>
> This is what Lisp does. Most functions are 'normal': unquoted argument
> expressions are evaluated. Some are 'special': at least one of the
> argument expressions is automatically quoted or treated specially is
> some way. Users have to memorize which functions are special and which
> arguments are automatically quoted. Learning the exceptions and
> quoting rules was for me a barrier to learning Lisp.
Yes, Lisp (including Scheme) has three kinds of forms:
functions:
Argument forms are evaluated before passed on to the "callable".
The result is returned as is.
macros (syntactic forms):
Argument forms are passed on to the callable without evaluation.
The result is evaluated and then returned.
special forms:
Argument forms are passed on to the callable without evaluation.
The result is returned as is.
The biggest ugly spot in the arrangement is that while functions are
first-class objects in Lisp, macros and special forms are not. (There
are dialects, though, where they all are first class.)
Marko
More information about the Python-list
mailing list