Re: functions without parentheses

2005-07-30 Thread Dan Sommers
On Sat, 30 Jul 2005 18:42:59 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: > or > arr = (ArrayElementAggregator() > 11 12 13 > 21 22 23 > ) What was that again about every other computer language wanting to be Lisp? ;-) Regards, Dan -- Dan Sommers

Re: functions without parentheses

2005-07-30 Thread Bengt Richter
On Sat, 30 Jul 2005 08:14:16 +0100, [EMAIL PROTECTED] (phil hunt) wrote: >On Fri, 29 Jul 2005 06:37:52 GMT, Bengt Richter <[EMAIL PROTECTED]> wrote: >> >>I suggested in a previous thread that one could support such a syntax by >>supporting an invisible binary operator between two expressions, > >

Re: functions without parentheses

2005-07-30 Thread Bengt Richter
On Fri, 29 Jul 2005 20:54:42 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Fri, 29 Jul 2005 06:37:52 +, Bengt Richter wrote: > >> I suggested in a previous thread that one could support such a syntax by >> supporting an invisible binary operator between two expressions, so that >> exam

Re: functions without parentheses

2005-07-30 Thread phil hunt
On Fri, 29 Jul 2005 06:37:52 GMT, Bengt Richter <[EMAIL PROTECTED]> wrote: > >I suggested in a previous thread that one could support such a syntax by >supporting an invisible binary operator between two expressions, That's a truely appalling idea. >so that >examine "string" translates to examin

Re: functions without parentheses

2005-07-29 Thread Josef Meile
Steven D'Aprano wrote: > On Fri, 29 Jul 2005 06:37:52 +, Bengt Richter wrote: > > >>I suggested in a previous thread that one could support such a syntax by >>supporting an invisible binary operator between two expressions, so that >>examine "string" translates to examine.__invisbinop__("stri

Re: functions without parentheses

2005-07-29 Thread Steven D'Aprano
On Fri, 29 Jul 2005 06:37:52 +, Bengt Richter wrote: > I suggested in a previous thread that one could support such a syntax by > supporting an invisible binary operator between two expressions, so that > examine "string" translates to examine.__invisbinop__("string") if > examine as an expres

Re: functions without parentheses

2005-07-28 Thread Bengt Richter
On Thu, 28 Jul 2005 00:59:51 -0700 (PDT), Jerry He <[EMAIL PROTECTED]> wrote: >Hi, > Is it possible to create a function that you can use >without parenthesizing the arguments? for example, for > >def examine(str): > . > . > >Is there some way to define it so that I can call it >

Re: functions without parentheses

2005-07-28 Thread bruno modulix
Jerry He wrote: > Hi, > Is it possible to create a function that you can use > without parenthesizing the arguments? for example, for > > def examine(str): > . > . > > Is there some way to define it so that I can call it > like > > examine "string" > instead of examine("str

Re: functions without parentheses

2005-07-28 Thread Scott David Daniels
Jerry He wrote: > ... Is there some way to define [examine] so I can call it like > examine "string" > instead of examine("string")? Perhaps you are looking for ipython (google for it) if all you are looking for is ease of interactive entry. --Scott David Daniels [EMAIL PRO

Re: functions without parentheses

2005-07-28 Thread gene tani
http://onestepback.org/index.cgi/Tech/Ruby/PythonAndRuby.rdoc this blog talks about design differences, e.g. what "." means, whether functions and methods are 1st-class objects. St -- http://mail.python.org/mailman/listinfo/python-list

Re: functions without parentheses

2005-07-28 Thread Steven Bethard
Jerry He wrote: > def examine(str): > . > . > > Is there some way to define it so that I can call it > like > > examine "string" > instead of examine("string")? What do you want to happen when someone types: examine ??? Or better yet, what if you do something like:

Re: functions without parentheses

2005-07-28 Thread bruno modulix
Simon Dahlbacka wrote: > If you actually want that kind of syntax, then why don't you use Visual > Basic? ;) s/VisualBasic/Ruby/ -- bruno desthuilliers ruby -e "print '[EMAIL PROTECTED]'.split('@').collect{|p| p.split('.').collect{|w| w.reverse}.join('.')}.join('@')" -- http://mail.python.org/

Re: functions without parentheses

2005-07-28 Thread Steve Holden
Simon Dahlbacka wrote [about function calls without parenthesis]: > If you actually want that kind of syntax, then why don't you use Visual > Basic? ;) > Because Perl is far too tempting to ignore. The serious answer to the OP's question, however, is that Python refuses to guess whether a functi

Re: functions without parentheses

2005-07-28 Thread Simon Dahlbacka
If you actually want that kind of syntax, then why don't you use Visual Basic? ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: functions without parentheses

2005-07-28 Thread Steven D'Aprano
On Thu, 28 Jul 2005 00:59:51 -0700, Jerry He wrote: > Hi, > Is it possible to create a function that you can use > without parenthesizing the arguments? What problem are you trying to solve that requires this sort of syntax, and why can't it be solved with parentheses? -- Steven. -- http:/

RE: functions without parentheses

2005-07-28 Thread Delaney, Timothy (Tim)
Jerry He wrote: > def examine(str): > . > . > > Is there some way to define it so that I can call it > like > > examine "string" > instead of examine("string")? No. Python's syntax does not work that way. Why would you want to? For more information about this, read: http://ww

Re: functions without parentheses

2005-07-28 Thread Robert Kern
Jerry He wrote: > Hi, > Is it possible to create a function that you can use > without parenthesizing the arguments? for example, for > > def examine(str): > . > . > > Is there some way to define it so that I can call it > like > > examine "string" > instead of examine("str

functions without parentheses

2005-07-28 Thread Jerry He
Hi, Is it possible to create a function that you can use without parenthesizing the arguments? for example, for def examine(str): . . Is there some way to define it so that I can call it like examine "string" instead of examine("string")? thanks in advance -Jerry