Re: [Python-ideas] Light-weight call-by-name syntax in Python

2017-02-19 Thread Ed Kellett
On Fri, 17 Feb 2017 at 10:23 Stephan Houben wrote: > Proposal: Light-weight call-by-name syntax in Python > > The following syntax > a : b > is to be interpreted as: > a(lambda: b) > > Effectively, this gives a "light-weight macro system" to Python, > since it

Re: [Python-ideas] Light-weight call-by-name syntax in Python

2017-02-18 Thread Stephan Houben
Hi Erik, I have changed my proposal to the alternative syntax a:: b (Note my preferred spacing. This is to make it read like some annoation applied to the expression, like delayed:: expensive_function()+1 ) Since :: is a binary operator, we need to think about associativity. My conservative

Re: [Python-ideas] Light-weight call-by-name syntax in Python

2017-02-17 Thread Nathaniel Smith
On Fri, Feb 17, 2017 at 2:22 AM, Stephan Houben wrote: > Proposal: Light-weight call-by-name syntax in Python > > The following syntax > a : b > is to be interpreted as: > a(lambda: b) > > Effectively, this gives a "light-weight macro system" to Python, > since