python3: 'where' keyword
Steve Holden
steve at holdenweb.com
Sun Jan 9 10:44:20 EST 2005
Alex Martelli wrote:
> AdSR <adsr at poczta.onet.pl> wrote:
>
>
>>I don't know haskell, but it looks SQL-ish to me (only by loose
>
>
> Indeed, the fact that many MANY more people are familiar with SQL than
> with Haskell may be the strongest practical objection to this choice of
> syntax sugar; the WHERE clause in an SQL SELECT has such wildly
> different semantics from Haskell's "where" that it might engender huge
> amounts of confusion. I.e., reasoning by analogy with SQL only, one
> might reasonably expect that minor syntax variations on:
>
> print a, b where a = b
>
> could mean roughly the same as "if a==b: print a, b", rather than
> roughly the same as:
>
> a = b
> print a, b
>
> I wonder if 'with', which GvR is already on record as wanting to
> introduce in 3.0, might not be overloaded instead.
>
IIRC the proposed meaning seems to be most closely related (in my own
experience, annyway) to the use of "where" in BCPL (heavens, *that* was
a long time ago). I never found that entirely natural either.
regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
More information about the Python-list
mailing list