thomas wrote: > > Saving two characters (":" vs "for") isn't worth it in Python. The > > vertical bar *would* be "worth it" to me, because that's what's used in > > SETL, Haskell *and* common mathematical practice for "such that". Alas, > > as Guido is sure to point out, that's too hard to parse > > It's impossible to parse, of course, unless you require the parentheses > around the expression preceding it :) > > [ (n) | n in range(100) if n%2 ] I'm pretty sure Tim meant "|" instead of "if". the SETL syntax is: [ n : n in range(100) | n%2 ] (that is, ":" instead of for, and "|" or "st" instead of "if". and yes, they have nice range literals too, so don't take that "range" too literal ;-) in SETL, that can also be abbreviated to: [ n in range(100) | n%2 ] which, of course, is a perfectly valid (though slightly obscure) python expression... </F>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4