“Make [] false-y”
Why? “Add macros”
Why? How? “Bring back `with`”
Why? “Make [] false-y”
Why? “Add macros”
Why? How? “Bring back `with`”
Why?Are they? All of them? 0:1 <≠> F:T? Boolean and binary are and should be distinct, and never the twain shall meet? A bold thesis in the world of computing.
Context-sensitive meaning is something people navigate all the time. You probably do it in some software contexts w/o even realizing it (and we all do it with human language and relationships w/o thinking consciously about it).
It's most likely to be confusing if you're unfamiliar with the context, or if the context-specific rules turn out to be convoluted.
0:1 maps on to F:T or even nothing:something or empty:non-empty pretty effortlessly. Even rigorously, with the right level of attention.
Implicit can mean subtle. Whether that means confusing (or whether there's some other cognitive load imposed by some forms of subtlety) is a separate question. And probably subjective.
Explicit can be a virtue. Concision can also be a virtue, and sometimes context-sensitivity promotes that.
If you want objects to behave like dictionaries, an empty object should also behave the same, by the way.
I'm not sure about macros.
I kind of want to see `with` back also. The problem with it was ambiguity. The syntax could be adjusted to avoid the ambiguity. .e.g `.prop = val;` could be legal inside the block. But "why though" you ask. A `with` block makes it visually obvious that a block of code is specifically relating to getters/setters on a particular object instance.
If I have a cup that's empty, there's still a cup there. It's presumptuous to assume I care about the contents.
Checking for presence of a number with a truthy check is a common source of errors, if 0 is a valid number.
I just don't agree at all that Python's interpretation of truthiness (or equality, for that matter) is inherently the "right" one. If I clone somebody are they equal because they have the same genetic makeup? No. Though a pretty contrived example that requires common understanding of equality.
At least from a programming perspective, I usually care more about instance equality rather than structural equality. Of course Python supports that too via the `is` keyword
But it's also not consistent with the ways that other empty but typed cups are treated ("" for the empty string, 0 for empty count / quantity, both of which are false-y). Different presumptions for different types of cups carries its own implicit hazards from context sensitivity.