Re: What do you want in a new web framework?
Cliff Wells wrote:
Ironically I would prefer to turn Logix block expressions of the kind
var = expression:
SUITE
into statements to avoid deep and awkward nestings: passing the
side-effect created by SUITE to var but preserving the distinction
between expressions and block statements nevertheless. I'm not yet sure
if the Python 2.5 with-stmt cannot be used for exactly this purpose?
Note that I'm not completely against blurring the distinction between
expressions and statements in Python. The Python grammar itself
contains a basic distinction between statements namely simple_stmt and
compound_stmt nodes.
Simple statements are defined by:
simple_stmt: small_stmt ( ";" small_stmt)* [";"] NEWLINE
where small_stmt nodes are nodes for assert, print, raise, return,
assignment etc.
It took me an evening using EasyExtend to define an enhanced lambda
that enables expressions like:
lambda lst: s = sum(lst); return float(s)/len(lst)
or
lambda x: print x; x+1
which are other Logix examples.
Cliff Wells wrote:
My single wishlist item (which will probably never happen) is actually
the *removal* of a single "feature": the distinction between statements
and expressions. Forget list comprehensions, ternary operators, etc.
You get them with no additional syntax in expression-based languages. I
played with Logix a bit (but sadly the project appears dead) and the
expression-based Python syntax it provides gives me goose-bumps.
the *removal* of a single "feature": the distinction between statements
and expressions. Forget list comprehensions, ternary operators, etc.
You get them with no additional syntax in expression-based languages. I
played with Logix a bit (but sadly the project appears dead) and the
expression-based Python syntax it provides gives me goose-bumps.
var = expression:
SUITE
into statements to avoid deep and awkward nestings: passing the
side-effect created by SUITE to var but preserving the distinction
between expressions and block statements nevertheless. I'm not yet sure
if the Python 2.5 with-stmt cannot be used for exactly this purpose?
Note that I'm not completely against blurring the distinction between
expressions and statements in Python. The Python grammar itself
contains a basic distinction between statements namely simple_stmt and
compound_stmt nodes.
Simple statements are defined by:
simple_stmt: small_stmt ( ";" small_stmt)* [";"] NEWLINE
where small_stmt nodes are nodes for assert, print, raise, return,
assignment etc.
It took me an evening using EasyExtend to define an enhanced lambda
that enables expressions like:
lambda lst: s = sum(lst); return float(s)/len(lst)
or
lambda x: print x; x+1
which are other Logix examples.
Comment