4,530 reputation
11733
bio website langnostic.inaimathi.ca
location Toronto, Canada
age 30
visits member for 4 years, 3 months
seen Oct 28 at 18:38

Common Lisp/Haskell/JavaScript/Scheme/Elisp hacker with a degree in Graphic Design, an eye for layout and a hungry, hungry mind.


Sep
18
awarded  Yearling
Sep
16
revised What's a “Professional Fit” interview?
proper conjugation of equidae
Sep
5
awarded  Good Answer
Feb
2
awarded  Popular Question
Oct
24
awarded  Notable Question
Sep
18
awarded  Yearling
Jul
18
awarded  Nice Answer
May
25
comment The rationale behind Falsy values
@MasonWheeler - Hm. So in Java/.NET, the empty string and the null string are distinct values? That's a bit odd. You're right though; that's a separate issue.
May
25
comment The rationale behind Falsy values
@MasonWheeler - That begs the sequence question though: do you go the Python route and declare that empty sequences in general are Falsy, or do you treat String as special among them? Also, at that point, shouldn't you provide some facility to your users to define their own Falsies (since things other than the standard library sequences can be empty)?
May
25
comment The rationale behind Falsy values
@MasonWheeler - Fair enough.
May
25
comment The rationale behind Falsy values
JS also does some odd things with regard to "0". Specifically, "0" == 0, but !!"0". Which leads to the very odd situation that "0" == 0 && 0 == "" && "0" != "". Once you've decided that 0 is Falsy, and that a number should compare to its stringified version under ==, making "0" Falsy seems more consistent, if anything. Thanks for the insight.
May
25
comment The rationale behind Falsy values
@MasonWheeler - JS has the following Falsy values: 0, "", undefined, null and NaN, while Python has 0, None, [], {}, () and "". I don't use C very much, so I'm not sure how it compares. The "anything as a boolean" is not an exclucively C thing either though; Common Lisp also lets you put anything in the test portion of an if or when, but only something that evaluates to NIL (which represents the empty list) will be treated Falsily.
May
25
asked The rationale behind Falsy values
Apr
5
answered Why have a wrapper constructor when storing a function in a data type?
Feb
12
awarded  Guru
Jan
9
awarded  Nice Answer
Sep
18
awarded  Yearling
Jun
8
awarded  Constituent
Jun
8
awarded  Caucus
May
1
awarded  Popular Question