Expression can be simplified on list

Rustom Mody rustompmody at gmail.com
Wed Sep 14 03:24:05 EDT 2016


On Wednesday, September 14, 2016 at 10:17:27 AM UTC+5:30, Steven D'Aprano wrote:
> You're perfectly entitled to dislike duck-typed truthiness. But that makes the 
> majority of dynamically-typed languages (like Python, Javascript, Ruby, Lua and 
> more) a bad fit for your way of thinking.

Yes and No
Here is elisp, one more such dynamic language:
Here is the docs for null and not:

null is a built-in function in `C source code'.

(null OBJECT)

Return t if OBJECT is nil.
null is a built-in function in `C source code'.

(null OBJECT)

Return t if OBJECT is nil.



not is an alias for `null' in `subr.el'.

(not OBJECT)

Return t if OBJECT is nil.



So null and not are the same function ie synonyms
The result of this is that most of these kind of discussions are side-stepped
even though the under-belly of lisp is quite like python:

Just use not when you want to think in terms of bools and null when you want to
think in terms of lists

To be fair, this is the situation in lisp prior to scheme
Scheme introduced #t and #f analogous to python 2.3(?) introducing
True and False
With all the attendant increased confusion from arcanity



More information about the Python-list mailing list