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 wri
[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 wo
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 d
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, syntax could be used with 'for' instead of 'with' if PEP343 poses a
problem, whereas (expr for params) is identically a generator expression.
> If 'w
Scott David Daniels wrote:
> What kind of shenanigans must a parser go through to translate:
> <
>
> 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 convert it to a pa
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. F
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:
> <
Incidentally, I read in an article by Bj
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
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 inte
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
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
f
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 o
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 alre
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,
"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.
--
http://mail.python.
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
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.
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 i
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, Padd
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 varia
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.
> c
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 al
Tim Roberts schrieb:
> Scott David Daniels <[EMAIL PROTECTED]> wrote:
> >
> >What kind of shenanigans must a parser go through to translate:
> > <
> >
> >this is the comparison of two functions, but it looks like a left-
> >shift on a function until the second with is encountered. Then
> >yo
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'
Scott David Daniels <[EMAIL PROTECTED]> wrote:
>
>What kind of shenanigans must a parser go through to translate:
> <
>
>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 co
On 2005-07-30, Scott David Daniels <[EMAIL PROTECTED]> wrote:
> Christopher Subich wrote:
>> g =
>> 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,
Christopher Subich wrote:
> g =
> 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 , which makes
> a b
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/pyt
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 prefe
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 proposal does away with the wel
31 matches
Mail list logo