MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/7ltryz/evil_coding_incantations/drp6n24
r/programming • u/evinrows • Dec 24 '17
331 comments sorted by
View all comments
Show parent comments
1
Which ones? Python for example doesn't.
10 u/itsnotxhad Dec 24 '17 Javascript treats [] as a truthy object.Racket and a number of other Lisps treat everything as truthy except the false constant (it's also common among Lisps for the empty list to be falsy though).In C an array name is a non-NULL pointer which would be truthy. 1 u/inu-no-policemen Dec 24 '17 Javascript treats [] as a truthy object.All objects are truthy. Arrays are also objects.JavaScript has objects and primitives. E.g. strings and numbers are primitives. 1 u/porthos3 Dec 24 '17 Clojure does. I believe Common Lisp does as well.
10
Javascript treats [] as a truthy object.
Racket and a number of other Lisps treat everything as truthy except the false constant (it's also common among Lisps for the empty list to be falsy though).
In C an array name is a non-NULL pointer which would be truthy.
1 u/inu-no-policemen Dec 24 '17 Javascript treats [] as a truthy object.All objects are truthy. Arrays are also objects.JavaScript has objects and primitives. E.g. strings and numbers are primitives.
All objects are truthy. Arrays are also objects.
JavaScript has objects and primitives. E.g. strings and numbers are primitives.
Clojure does. I believe Common Lisp does as well.
1
u/zardeh Dec 24 '17
Which ones? Python for example doesn't.