On Sun, 31 Jul 2005 00:30:36 -0400, Mike Meyer [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Bengt Richter) writes:
On Fri, 29 Jul 2005 18:07:31 -0400, Mike Meyer [EMAIL PROTECTED] wrote:
I know, lambda bashing (and defending) in the group is one of the most
popular ways to avoid writing code.
James Richards [EMAIL PROTECTED] writes:
Personally, I can't recall any decent programmer I know who objects
to actually writing out a variable name. In fact, I don't know a
single real programmer (this is one who writes programs he intends
to look at again in, say, 3 weeks) who doesn't
Tim Roberts schrieb:
Scott David Daniels [EMAIL PROTECTED] wrote:
What kind of shenanigans must a parser go through to translate:
x**2 with(x)x**3 with(x)
this is the comparison of two functions, but it looks like a left-
shift on a function until the second with is encountered.
why (x**2 with(x))(x**3 with(x)) is not taken in consideration?
If 'with' must be there (and substitue 'lambda:') then at least the
syntax is clear.IMO Ruby syntax is also clear.
___
Yahoo! Mail: gratis 1GB per i messaggi e
Mike Meyer wrote:
Rewriting a canonical abuse of lambda in this idiom gives:
myfunc = def @(*args):
return sum(x + 1 for x in args)
Nice proposal. Technically you don't need the @ there, it is
superfluous. But then again so is the colon, so whatever floats your boat.
class
D H [EMAIL PROTECTED] writes:
where fdel = def (self):
...
As you can see, it doesn't save much over the traditional way since
you have to name the anonymous lambdas anyway.
It saves polluting the surrounding namespace with superfluous variables
Christopher Subich [EMAIL PROTECTED] writes:
Basically, I'd rewrite the Python grammar such that:
lambda_form ::= expression with parameter_list
I do prefer my parameter list to come before the expression. It would
remain consistant with simple function definitions.
- Cheers, Paddy.
--
on 30.07.2005 10:20 Paolino said the following:
why (x**2 with(x))(x**3 with(x)) is not taken in consideration?
If 'with' must be there (and substitue 'lambda:') then at least the
syntax is clear.IMO Ruby syntax is also clear.
I am sorry if this has already been proposed (I am sure it
Stefan Rank [EMAIL PROTECTED] writes:
I am sorry if this has already been proposed (I am sure it has).
Why not substitue python-lambdas with degenerated generator expressions::
(lambda x: func(x)) == (func(x) for x)
I don't think I've seen that one before, and FWIW it's kind of cute.
But
Mike Meyer schrieb:
I know, lambda bashing (and defending) in the group is one of the most
popular ways to avoid writing code. However, while staring at some Oz
code, I noticed a feature that would seem to make both groups happy -
if we can figure out how to avoid the ugly syntax.
This
Kay Schluehr [EMAIL PROTECTED] writes:
Examples:
f = ( || x=0 then f(x) || True then f(-x) from (x,) )
g = ( || x 0 then self._a -x || self._a - 0 from (x,))
Is this an actual language? It looks sort of like CSP. Python
with native parallelism, m.
--
Paul Rubin wrote:
Kay Schluehr [EMAIL PROTECTED] writes:
Examples:
f = ( || x=0 then f(x) || True then f(-x) from (x,) )
g = ( || x 0 then self._a -x || self._a - 0 from (x,))
Is this an actual language? It looks sort of like CSP. Python
with native parallelism, m.
The
Stefan Rank wrote:
on 30.07.2005 10:20 Paolino said the following:
why (x**2 with(x))(x**3 with(x)) is not taken in consideration?
If 'with' must be there (and substitue 'lambda:') then at least the
syntax is clear.IMO Ruby syntax is also clear.
I am sorry if this has already been
I understand that there are a number of people who wish to remove
lambda entirely from the language. Nevertheless, I find it a useful
and powerful tool in actual development.
Any replacement must support the following: *delayed evaluation*.
I need a convenient (def is not always convenient) way
Seth Nielson [EMAIL PROTECTED] writes:
Any replacement must support the following: *delayed evaluation*.
I need a convenient (def is not always convenient) way of saying,
don't do this now. That is why I use lambda.
How's this: f{args} (curly braces instead of parens) is the same as
On Fri, 29 Jul 2005 18:07:31 -0400, Mike Meyer [EMAIL PROTECTED] wrote:
I know, lambda bashing (and defending) in the group is one of the most
popular ways to avoid writing code. However, while staring at some Oz
code, I noticed a feature that would seem to make both groups happy -
if we can
On Fri, 29 Jul 2005 18:07:31 -0400, Mike Meyer [EMAIL PROTECTED] wrote:
I know, lambda bashing (and defending) in the group is one of the most
popular ways to avoid writing code. However, while staring at some Oz
code, I noticed a feature that would seem to make both groups happy -
if we can
Paul Rubin wrote:
How's this: f{args} (curly braces instead of parens) is the same as
f(lambda: args).
Examples:
launch_thread{targetfunc(a,b,c)}
b = Button{callback=pressed()} # Button remembers callback()
sign_of_a = ternary{a 0, -1, 1}
I'd consider this an interesting
Peter Hansen [EMAIL PROTECTED] writes:
sign_of_a = ternary{a 0, -1, 1}
I'd consider this an interesting idea if it weren't for the fact that
(at least with the fonts I generally use) I can barely make out the
difference between the {} and the () above.
Ok, how about an escaped paren:
On Fri, Jul 29, 2005 at 10:14:12PM -0700, Tim Roberts wrote:
C++ solves this exact problem quite reasonably by having a greedy
tokenizer. Thus, that would always be a left shift operator. To make it
less than and a function, insert a space:
x**2 with(x) x**3 with(x)
Incidentally, I read
Paul Rubin wrote:
Christopher Subich [EMAIL PROTECTED] writes:
My personal favourite is to replace lambda entirely with an
expression comprehension, using and delimeters.
But how does that let you get more than one expression into the
anonymous function?
It doesn't. Functionally, it's
Scott David Daniels wrote:
What kind of shenanigans must a parser go through to translate:
x**2 with(x)x**3 with(x)
this is the comparison of two functions, but it looks like a left-
shift on a function until the second with is encountered. Then
you need to backtrack to the shift and
Paolino wrote:
why (x**2 with(x))(x**3 with(x)) is not taken in consideration?
Looks too much like a generator expression for my taste. Also, expr
.. syntax could be used with 'for' instead of 'with' if PEP343 poses a
problem, whereas (expr for params) is identically a generator expression.
Paddy wrote:
Christopher Subich [EMAIL PROTECTED] writes:
Basically, I'd rewrite the Python grammar such that:
lambda_form ::= expression with parameter_list
I do prefer my parameter list to come before the expression. It would
remain consistant with simple function definitions.
[EMAIL PROTECTED] (Bengt Richter) writes:
On Fri, 29 Jul 2005 18:07:31 -0400, Mike Meyer [EMAIL PROTECTED] wrote:
I know, lambda bashing (and defending) in the group is one of the most
popular ways to avoid writing code. However, while staring at some Oz
code, I noticed a feature that would seem
Mike Meyer wrote:
My choice for the non-name token is @. It's already got magic
powers, so we'll give it more rather than introducing another token
with magic powers, as the lesser of two evils.
Doesn't work. The crux of your change isn't introducing a meaning to @
(and honestly, I prefer
Christopher Subich [EMAIL PROTECTED] writes:
My personal favourite is to replace lambda entirely with an
expression comprehension, using and delimeters.
But how does that let you get more than one expression into the
anonymous function?
--
http://mail.python.org/mailman/listinfo/python-list
Christopher Subich wrote:
g = x**2 with (x)
g(1) == 1
Basically, I'd rewrite the Python grammar such that:
lambda_form ::= expression with parameter_list
Biggest change is that parameter_list is no longer optional, so
zero-argument expr-comps would be written as expr with (), which
On 2005-07-30, Scott David Daniels [EMAIL PROTECTED] wrote:
Christopher Subich wrote:
g = x**2 with (x)
g(1) == 1
Basically, I'd rewrite the Python grammar such that:
lambda_form ::= expression with parameter_list
Biggest change is that parameter_list is no longer optional, so
29 matches
Mail list logo