RE: Functional programming in Python

2001-05-24 Thread Tom Pledger
Peter Douglass writes: : | but in ( foo ( bar (baz x) ) ) | | You would want the following I think. | | foo . bar . baz x | | which does have the parens omitted, but requires the composition | operator. Almost. To preserve the meaning, the composition syntax would need to be

RE: Functional programming in Python

2001-05-24 Thread Peter Douglass
Peter Hancock wrote: > > foo( bar( baz( x ) ) ) > > it's: > > (foo ( bar (baz x) ) ) > > Clearly the outer parentheses are unnecessary in the last expression. > One undeniable advantage of (f a) is it saves parentheses. Yes and no. In ( ( ( foo bar) ba

Re: Functional programming in Python

2001-05-24 Thread Peter Hancock
Hi, you said > Unfortunately in many cases you need to apply nearly as many > parens for a Haskell expression as you would for a Python one, but > they're in different places. It's not: > > foo( bar( baz( x ) ) ) > it's: > (foo ( bar (baz x) ) ) Clearly t

Re: Functional programming in Python

2001-05-24 Thread Peter Hancock
Hi, you said > Unfortunately in many cases you need to apply nearly as many > parens for a Haskell expression as you would for a Python one, but > they're in different places. It's not: > > foo( bar( baz( x ) ) ) > it's: > (foo ( bar (baz x) ) ) Clearly t