Re: Python and Ruby

2010-02-10 Thread Andreas Waldenburger
On Wed, 10 Feb 2010 09:51:11 -0500 Steve Holden wrote: > [snip] > It's as sensible to complain about people being "*forced* to keep > perfect indentation" as it is to complain about people being *forced* > to use braces to delimit code blocks. > > This is called "syntax", and it's a part of the

Re: Python and Ruby

2010-02-10 Thread Steve Holden
waku wrote: > On Feb 9, 10:41 pm, Jonathan Gardner > wrote: >> On Feb 9, 1:51 am, waku wrote: >> >>> 'stupid', 'wrong', 'deficient', 'terrible', ... you're using strong >>> words instead of concrete arguments, it might intimidate your >>> opponents, but is hardly helpful in a fair discussion. >>

Re: Python and Ruby

2010-02-10 Thread waku
On Feb 9, 10:41 pm, Jonathan Gardner wrote: > On Feb 9, 1:51 am, waku wrote: > > > 'stupid', 'wrong', 'deficient', 'terrible', ...  you're using strong > > words instead of concrete arguments, it might intimidate your > > opponents, but is hardly helpful in a fair discussion. > > In today's day a

Re: Python and Ruby

2010-02-09 Thread Jonathan Gardner
On Feb 9, 1:51 am, waku wrote: > 'stupid', 'wrong', 'deficient', 'terrible', ...  you're using strong > words instead of concrete arguments, it might intimidate your > opponents, but is hardly helpful in a fair discussion. > In today's day and age, I don't know how a text editor which cannot do s

Re: Python and Ruby

2010-02-09 Thread waku
On Feb 2, 10:49 pm, Jonathan Gardner wrote: > On Feb 2, 2:21 am,waku wrote: [...] > > there are languages where indentation can be either enforced and allow > > one to omit some syntactic nuissance like braces or begin-end clauses, > > or made optional, requiring other syntactic means for delimi

Re: YAML (was: Python and Ruby)

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 09:22:03 -0500, Lou Pecora wrote: [...] >> > That's what I needed. 3 lines to write or read a inhomogeneous >> > collection of variables. >> >> Easy, but also quick and dirty -- good enough for small scripts, but >> not really good enough for production applications. [...] >

Re: Python and Ruby

2010-02-05 Thread Ethan Furman
Robert Kern wrote: On 2010-02-04 17:46 PM, Ethan Furman wrote: Robert Kern wrote: On 2010-02-04 14:55 PM, Jonathan Gardner wrote: On Feb 3, 3:39 pm, Steve Holden wrote: Robert Kern wrote: On 2010-02-03 15:32 PM, Jonathan Gardner wrote: I can explain all of Python in an hour; I doubt anyon

Re: Python and Ruby

2010-02-05 Thread Robert Kern
On 2010-02-04 17:46 PM, Ethan Furman wrote: Robert Kern wrote: On 2010-02-04 14:55 PM, Jonathan Gardner wrote: On Feb 3, 3:39 pm, Steve Holden wrote: Robert Kern wrote: On 2010-02-03 15:32 PM, Jonathan Gardner wrote: I can explain all of Python in an hour; I doubt anyone will understand al

Re: YAML (was: Python and Ruby)

2010-02-05 Thread Lou Pecora
In article <00f4bb3a$0$15566$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: > On Thu, 04 Feb 2010 09:57:59 -0500, Lou Pecora wrote: > > > Well, that looks a bit more complicated than I would like, but maybe > > it's doing more stuff than I can grok. Here's what I needed and how I > > did i

Re: Python and Ruby

2010-02-05 Thread mk
Steve Holden wrote: Jeez, Steve, you're beginning to sound like some kind of fallacy zealot... ;) Death to all those who confuse agumentum ad populum with argumentum ad verecundiam!!! Yeah, what did the zealots ever do for us? They produced Python? . . . Oh Python! Shut up! -- http://

Re: Python and Ruby

2010-02-05 Thread Ethan Furman
Robert Kern wrote: On 2010-02-04 14:55 PM, Jonathan Gardner wrote: On Feb 3, 3:39 pm, Steve Holden wrote: Robert Kern wrote: On 2010-02-03 15:32 PM, Jonathan Gardner wrote: I can explain all of Python in an hour; I doubt anyone will understand all of Python in an hour. With all respect,

Re: Python and Ruby

2010-02-04 Thread Robert Kern
On 2010-02-04 14:55 PM, Jonathan Gardner wrote: On Feb 3, 3:39 pm, Steve Holden wrote: Robert Kern wrote: On 2010-02-03 15:32 PM, Jonathan Gardner wrote: I can explain all of Python in an hour; I doubt anyone will understand all of Python in an hour. With all respect, talking about a sub

Re: YAML (was: Python and Ruby)

2010-02-04 Thread Steven D'Aprano
On Thu, 04 Feb 2010 09:57:59 -0500, Lou Pecora wrote: > Well, that looks a bit more complicated than I would like, but maybe > it's doing more stuff than I can grok. Here's what I needed and how I > did it in Python: [...] > # Reading same list in: > instr=fp.readline() > inlist=eval(instr) > x1,

Re: Python and Ruby

2010-02-04 Thread Jonathan Gardner
On Feb 3, 3:39 pm, Steve Holden wrote: > Robert Kern wrote: > > On 2010-02-03 15:32 PM, Jonathan Gardner wrote: > > >> I can explain all of Python in an hour; I doubt anyone will understand > >> all of Python in an hour. > > > With all respect, talking about a subject without a reasonable chance o

Re: Python and Ruby

2010-02-04 Thread John Bokma
Marius Gedminas writes: > On Feb 4, 1:03 am, John Bokma wrote: >> Jonathan Gardner writes: >> > I can explain all of Python in an hour; >> >> OK, in that case I would say give it a go. Put it on YouTube, or write a >> blog post about it (or post it here). I am sure you will help a lot of >> peo

Re: Python and Ruby

2010-02-04 Thread John Bokma
Marius Gedminas writes: > On Feb 4, 1:03 am, John Bokma wrote: >> Jonathan Gardner writes: >> > I can explain all of Python in an hour; >> >> OK, in that case I would say give it a go. Put it on YouTube, or write a >> blog post about it (or post it here). I am sure you will help a lot of >> peo

Re: Python and Ruby

2010-02-04 Thread Lou Pecora
In article <7x8wb9j4r2@ruckus.brouhaha.com>, Paul Rubin wrote: > Lou Pecora writes: > > after much noodling around and reading it hit me that I could just put > > all that output of different types of variables into a list, hit it > > with a repr() function to get a string version, and writ

Re: YAML (was: Python and Ruby)

2010-02-04 Thread Lou Pecora
In article <87eil1ddjp.fsf...@castleamber.com>, John Bokma wrote: > Lou Pecora writes: > > > That's a pretty accurate description of how I transitioned to Python > > from C and Fortran. > > Not C, but C++ (but there are also C implementations): YAML, see: > http://code.google.com/p/yaml-cpp/

Re: Python and Ruby

2010-02-04 Thread Marius Gedminas
On Feb 4, 1:03 am, John Bokma wrote: > Jonathan Gardner writes: > > I can explain all of Python in an hour; > > OK, in that case I would say give it a go. Put it on YouTube, or write a > blog post about it (or post it here). I am sure you will help a lot of > people that way. Someone already did

Re: Python and Ruby

2010-02-03 Thread alex23
"Timothy N. Tsvetkov" wrote: > Jonathan Gardner > > Python is much, much cleaner. I don't know how anyone can honestly say > > Ruby is cleaner than Python. > > I developed on both (Python was first) and I think that ruby I > very clean and maybe cleaner than Python. > > And you're wrong with bloc

YAML (was: Python and Ruby)

2010-02-03 Thread John Bokma
Lou Pecora writes: > That's a pretty accurate description of how I transitioned to Python > from C and Fortran. Not C, but C++ (but there are also C implementations): YAML, see: http://code.google.com/p/yaml-cpp/wiki/HowToParseADocument I use YAML now and then with Perl for both reading/writin

Re: Python and Ruby

2010-02-03 Thread Steve Holden
Robert Kern wrote: > On 2010-02-03 15:32 PM, Jonathan Gardner wrote: > >> I can explain all of Python in an hour; I doubt anyone will understand >> all of Python in an hour. > > With all respect, talking about a subject without a reasonable chance of > your audience understanding the subject afte

Re: Python and Ruby

2010-02-03 Thread Paul Rubin
Lou Pecora writes: > after much noodling around and reading it hit me that I could just put > all that output of different types of variables into a list, hit it > with a repr() function to get a string version, and write the string > to a file -- no formatting necessary-- three lines of code. Lat

Re: Python and Ruby

2010-02-03 Thread John Bokma
Jonathan Gardner writes: > On Feb 2, 9:11 pm, John Bokma wrote: >> Jonathan Gardner writes: >> > I can explain, in an hour, every single feature of the Python language >> > to an experienced programmer, all the way up to metaclasses, >> >> Either you're a hell of a talker, or I am far, far away

Re: Python and Ruby

2010-02-03 Thread Lou Pecora
In article <1944d953-25ad-440b-9317-a7a4b4de6...@f17g2000prh.googlegroups.com>, Jonathan Gardner wrote: > > I can explain all of Python in an hour; I doubt anyone will understand > all of Python in an hour. > > Coming from perl to python, the big "aha!" moment was when I realized > there wasn

Re: Python and Ruby

2010-02-03 Thread Robert Kern
On 2010-02-03 15:32 PM, Jonathan Gardner wrote: I can explain all of Python in an hour; I doubt anyone will understand all of Python in an hour. With all respect, talking about a subject without a reasonable chance of your audience understanding the subject afterwards is not explaining. It's

Re: Python and Ruby

2010-02-03 Thread Jonathan Gardner
On Feb 2, 9:11 pm, John Bokma wrote: > Jonathan Gardner writes: > > I can explain, in an hour, every single feature of the Python language > > to an experienced programmer, all the way up to metaclasses, > > Either you're a hell of a talker, or I am far, far away from being an > experienced progr

Re: Python and Ruby

2010-02-03 Thread Timothy N. Tsvetkov
On Jan 28, 2:29 am, Jonathan Gardner wrote: > On Jan 27, 5:47 am, Simon Brunning wrote: > > > > > I think Python is a little cleaner, but I'm sure you'd find Ruby fans > > who'd argue the complete opposite. > > Are you sure about that? > > There's a lot of line noise in Ruby. How are you supposed

Re: Python and Ruby

2010-02-02 Thread John Bokma
John Bokma writes: > Steven D'Aprano writes: > >> On Tue, 02 Feb 2010 23:11:49 -0600, John Bokma wrote: >> >>> Jonathan Gardner writes: >>> I can explain, in an hour, every single feature of the Python language to an experienced programmer, all the way up to metaclasses, >>> >>> Eit

Re: Python and Ruby

2010-02-02 Thread John Bokma
Steven D'Aprano writes: > On Tue, 02 Feb 2010 23:11:49 -0600, John Bokma wrote: > >> Jonathan Gardner writes: >> >>> I can explain, in an hour, every single feature of the Python language >>> to an experienced programmer, all the way up to metaclasses, >> >> Either you're a hell of a talker, o

Re: Python and Ruby

2010-02-02 Thread Steven D'Aprano
On Tue, 02 Feb 2010 23:11:49 -0600, John Bokma wrote: > Jonathan Gardner writes: > >> I can explain, in an hour, every single feature of the Python language >> to an experienced programmer, all the way up to metaclasses, > > Either you're a hell of a talker, or I am far, far away from being an

Re: Python and Ruby

2010-02-02 Thread John Bokma
Jonathan Gardner writes: > On Feb 1, 6:36 pm, John Bokma wrote: [..] >> It should be $bar = \&foo >> Your example actually calls foo... > > I rest my case. I've been programming perl professionally since 2000, > and I still make stupid, newbie mistakes like that. Uhm, in another post you wrot

Re: Python and Ruby

2010-02-02 Thread John Bokma
Jonathan Gardner writes: > I can explain, in an hour, every single feature of the Python language > to an experienced programmer, all the way up to metaclasses, Either you're a hell of a talker, or I am far, far away from being an experienced programmer. It's advocacy like this, IMO, that keeps

Re: Python and Ruby

2010-02-02 Thread bartc
Jonathan Gardner wrote: On Feb 2, 7:23 am, "bartc" wrote: Jonathan Gardner wrote: One of the bad things with languages like perl and Ruby that call without parentheses is that getting a function ref is not obvious. You need even more syntax to do so. In perl: foo(); # Call 'foo' with no arg

Re: Python and Ruby

2010-02-02 Thread sjdevn...@yahoo.com
On Feb 2, 5:01 pm, Jonathan Gardner wrote: > On Feb 1, 6:36 pm, John Bokma wrote: > > > > > > > Jonathan Gardner writes: > > > One of the bad things with languages like perl > > > FYI: the language is called Perl, the program that executes a Perl > > program is called perl. > > > > without paren

Re: Python and Ruby

2010-02-02 Thread Steve Holden
Ben Finney wrote: > Jonathan Gardner writes: > >> Compare with Python's syntax. >> >> # The only way to assign >> a = b >> >> # The only way to call a function >> b(...) >> >> # The only way to access a hash or array or string or tuple >> b[...] > > For all of your examples, there are other ways

Re: Python and Ruby

2010-02-02 Thread Ben Finney
Jonathan Gardner writes: > Compare with Python's syntax. > > # The only way to assign > a = b > > # The only way to call a function > b(...) > > # The only way to access a hash or array or string or tuple > b[...] For all of your examples, there are other ways supported. I do wish this focus on

Re: Python and Ruby

2010-02-02 Thread Jonathan Gardner
On Feb 1, 6:50 pm, Nobody wrote: > On Mon, 01 Feb 2010 14:13:38 -0800, Jonathan Gardner wrote: > > I judge a language's simplicity by how long it takes to explain the > > complete language. That is, what minimal set of documentation do you > > need to describe all of the language? > > That's not a

Re: Python and Ruby

2010-02-02 Thread Jonathan Gardner
On Feb 2, 7:23 am, "bartc" wrote: > Jonathan Gardner wrote: > > One of the bad things with languages like perl and Ruby that call > > without parentheses is that getting a function ref is not obvious. You > > need even more syntax to do so. In perl: > > >  foo();       # Call 'foo' with no args. >

Re: Python and Ruby

2010-02-02 Thread Jonathan Gardner
On Feb 1, 6:36 pm, John Bokma wrote: > Jonathan Gardner writes: > > One of the bad things with languages like perl > > FYI: the language is called Perl, the program that executes a Perl > program is called perl. > > > without parentheses is that getting a function ref is not obvious. You > > need

Re: Python and Ruby

2010-02-02 Thread Jonathan Gardner
On Feb 1, 6:21 pm, Nobody wrote: > > You don't need to know the entire language before you can use any of it > (if you did, Python would be deader than a certain parrot; Python's dark > corners are *really* dark). > I'm curious. What dark corners are you referring to? I can't think of any. Especi

Re: Python and Ruby

2010-02-02 Thread Jonathan Gardner
On Feb 2, 2:21 am, waku wrote: > > for writing new code, it's not necessarily that helpful to be *forced* > to keep with strict indenting rules.  in early development phases, > code is often experimental, and parts of it may need to be blocked or > unblocked as the codebase grows, and for experime

Re: Python and Ruby

2010-02-02 Thread bartc
Jonathan Gardner wrote: One of the bad things with languages like perl and Ruby that call without parentheses is that getting a function ref is not obvious. You need even more syntax to do so. In perl: foo(); # Call 'foo' with no args. $bar = foo; # Call 'foo; with no args, assign to '

Re: Python and Ruby

2010-02-02 Thread waku
Steven D'Aprano wrote: > On Sat, 30 Jan 2010 16:58:34 +, tanix wrote: [...] > > The very idea of using a number of blanks to identify your block level > > is as insane as it gets. > > Not at all. People do it all the time. The very idea of expecting people > to count nested braces to identify

Re: Python and Ruby

2010-02-02 Thread Paul Rubin
Nobody writes: > A better metric is whether using N features has O(N) complexity, or O(N^2) > (where you have to understand how each feature relates to each other > feature) or even O(2^N) (where you have to understand every possible > combination of interactions). M. Felleisen wrote a paper tryi

Re: Python and Ruby

2010-02-01 Thread John Bokma
Nobody writes: > On Mon, 01 Feb 2010 14:35:57 -0800, Jonathan Gardner wrote: > >>> If it was common-place to use Curried functions and partial application in >>> Python, you'd probably prefer "f a b c" to "f(a)(b)(c)" as well. >> >> That's just the point. It isn't common to play with curried fun

Re: Python and Ruby

2010-02-01 Thread Nobody
On Mon, 01 Feb 2010 14:13:38 -0800, Jonathan Gardner wrote: > I judge a language's simplicity by how long it takes to explain the > complete language. That is, what minimal set of documentation do you > need to describe all of the language? That's not a particularly good metric, IMHO. A simple "

Re: Python and Ruby

2010-02-01 Thread John Bokma
Jonathan Gardner writes: > One of the bad things with languages like perl FYI: the language is called Perl, the program that executes a Perl program is called perl. > without parentheses is that getting a function ref is not obvious. You > need even more syntax to do so. In perl: > > foo();

Re: Python and Ruby

2010-02-01 Thread Nobody
On Mon, 01 Feb 2010 14:35:57 -0800, Jonathan Gardner wrote: >> If it was common-place to use Curried functions and partial application in >> Python, you'd probably prefer "f a b c" to "f(a)(b)(c)" as well. > > That's just the point. It isn't common to play with curried functions > or monads or an

Re: Python and Ruby

2010-02-01 Thread Chris Rebert
On Mon, Feb 1, 2010 at 6:14 PM, MRAB wrote: > Nobody wrote: >> On Sun, 31 Jan 2010 22:36:32 +, Steven D'Aprano wrote: for example, in if you have a function 'f' which takes two parameters to call the function and get the result you use:  f 2 3 If you want the func

Re: Python and Ruby

2010-02-01 Thread MRAB
Nobody wrote: On Sun, 31 Jan 2010 22:36:32 +, Steven D'Aprano wrote: for example, in if you have a function 'f' which takes two parameters to call the function and get the result you use: f 2 3 If you want the function itself you use: f How do you call a function of no arguments?

Re: Python and Ruby

2010-02-01 Thread Nobody
On Sun, 31 Jan 2010 22:36:32 +, Steven D'Aprano wrote: >> for example, in if you have a function 'f' which takes two parameters to >> call the function and get the result you use: >> >> f 2 3 >> >> If you want the function itself you use: >> >>f > > How do you call a function of no ar

Re: Python and Ruby

2010-02-01 Thread Paul Rubin
Jonathan Gardner writes: > I judge a language's simplicity by how long it takes to explain the > complete language. That is, what minimal set of documentation do you > need to describe all of the language? With a handful of statements, > and a very short list of operators, Python beats out every l

Re: Python and Ruby

2010-02-01 Thread Chris Rebert
On Mon, Feb 1, 2010 at 2:28 PM, Jonathan Gardner wrote: > On Jan 31, 3:01 am, rantingrick wrote: >> On Jan 30, 10:43 am, Nobody wrote: >> > That's also true for most functional languages, e.g. Haskell and ML, as >> > well as e.g. Tcl and most shells. Why require "f(x)" or "(f x)" if "f x" >> > w

Re: Python and Ruby

2010-02-01 Thread Jonathan Gardner
On Jan 31, 12:43 pm, Nobody wrote: > > If it was common-place to use Curried functions and partial application in > Python, you'd probably prefer "f a b c" to "f(a)(b)(c)" as well. > That's just the point. It isn't common to play with curried functions or monads or anything like that in computer

Re: Python and Ruby

2010-02-01 Thread Jonathan Gardner
On Jan 31, 3:01 am, rantingrick wrote: > On Jan 30, 10:43 am, Nobody wrote: > > > That's also true for most functional languages, e.g. Haskell and ML, as > > well as e.g. Tcl and most shells. Why require "f(x)" or "(f x)" if "f x" > > will suffice? > > yuck! wrapping the arg list with parenthesis

Re: Python and Ruby

2010-02-01 Thread Jonathan Gardner
On Jan 30, 8:43 am, Nobody wrote: > On Wed, 27 Jan 2010 15:29:05 -0800, Jonathan Gardner wrote: > > Python is much, much cleaner. I don't know how anyone can honestly say > > Ruby is cleaner than Python. > > I'm not familiar with Ruby, but most languages are cleaner than Python > once you get beyo

Re: Python and Ruby

2010-02-01 Thread Steve Holden
Terry Reedy wrote: > On 1/31/2010 7:25 PM, Steven D'Aprano wrote: >> On Sun, 31 Jan 2010 15:40:36 -0800, Chris Rebert wrote: >> >>> On Sun, Jan 31, 2010 at 2:36 PM, Steven D'Aprano >>> wrote: On Sun, 31 Jan 2010 04:28:41 -0800, Ed Keith wrote: > In most functional languages you just name

Re: Python and Ruby

2010-02-01 Thread Steve Holden
Steven D'Aprano wrote: > On Sun, 31 Jan 2010 22:43:56 -0800, alex23 wrote: > >> Steven D'Aprano wrote: >>> You're using that term wrong. It looks to me that you don't actually >>> know what a straw man argument is. A straw man argument is when >>> somebody responds to a deliberately weakened or i

Re: Python and Ruby

2010-01-31 Thread Paul Rubin
Chris Rebert writes: > get_popular_name would have the type: IO () -> IO String I don't know if it makes the explanation any clearer, but I think that isn't quite right. The Python version would have type String -> IO String. The parameterless Haskell version would just be an I/O action, with

Re: Python and Ruby

2010-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2010 22:43:56 -0800, alex23 wrote: > Steven D'Aprano wrote: >> You're using that term wrong. It looks to me that you don't actually >> know what a straw man argument is. A straw man argument is when >> somebody responds to a deliberately weakened or invalid argument as if >> it had

Re: Python and Ruby

2010-01-31 Thread Chris Rebert
On Sun, Jan 31, 2010 at 10:05 PM, Steven D'Aprano wrote: > On Sun, 31 Jan 2010 20:22:36 -0800, Paul Rubin wrote: >> Terry Reedy writes: >>> Three of you gave essentially identical answers, but I still do not see >>> how given something like >>> >>> def f(): return 1 >>> >>> I differentiate betwee

Re: Python and Ruby

2010-01-31 Thread alex23
Steven D'Aprano wrote: > You're using that term wrong. It looks to me that you don't actually know > what a straw man argument is. A straw man argument is when somebody > responds to a deliberately weakened or invalid argument as if it had been > made by their opponent. Jeez, Steve, you're beginn

Re: Python and Ruby

2010-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2010 21:30:15 -0600, John Bokma wrote: > While braces might be considered redundant they are not when for one > reason or another formatting is lost or done incorrectly. I've heard this argument before, and I don't buy it. Why should we expect the editor to co

Re: Python and Ruby

2010-01-31 Thread Paul Rubin
Steven D'Aprano writes: > How would Haskell coders write it? Something like this? > > def get_popular_name(url): > data = fetch url > names = parse data > name = choose name 1 > return name The syntax and types would be different, but ok, something like that. > name = get_popular

Re: Python and Ruby

2010-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2010 18:53:16 -0600, John Bokma wrote: > You don't have to buy my argument, I am not selling it. It's a figure of speech. You are making an argument others have made before, and I don't accept the validity of the argument. -- Steven -- http://mail.python.org/mailman/listinfo/p

Re: Python and Ruby

2010-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2010 20:22:36 -0800, Paul Rubin wrote: > Terry Reedy writes: >> Three of you gave essentially identical answers, but I still do not see >> how given something like >> >> def f(): return 1 >> >> I differentiate between 'function object at address xxx' and 'int 1' >> objects. > > In

Re: Python and Ruby

2010-01-31 Thread Paul Rubin
Terry Reedy writes: > Three of you gave essentially identical answers, but I still do not > see how given something like > > def f(): return 1 > > I differentiate between 'function object at address xxx' and 'int 1' > objects. In the languages they are talking about, there is no such thing as a f

Re: Python and Ruby

2010-01-31 Thread Terry Reedy
On 1/31/2010 7:25 PM, Steven D'Aprano wrote: On Sun, 31 Jan 2010 15:40:36 -0800, Chris Rebert wrote: On Sun, Jan 31, 2010 at 2:36 PM, Steven D'Aprano wrote: On Sun, 31 Jan 2010 04:28:41 -0800, Ed Keith wrote: In most functional languages you just name a function to access it and you do it A

Re: Python and Ruby

2010-01-31 Thread John Bokma
Steven D'Aprano writes: > On Sun, 31 Jan 2010 18:47:42 -0600, John Bokma wrote: > >> Steven D'Aprano writes: >> >>> On Sun, 31 Jan 2010 14:47:08 -0600, John Bokma wrote: >>> An editor can correct the indenting of the braces example but can't with this one. if x:

Re: Python and Ruby

2010-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2010 18:47:42 -0600, John Bokma wrote: > Steven D'Aprano writes: > >> On Sun, 31 Jan 2010 14:47:08 -0600, John Bokma wrote: >> >>> An editor can correct the indenting of the braces example but can't >>> with this one. >>> >>> if x: >>> if y: >>> foo() >>> else:

Re: Python and Ruby

2010-01-31 Thread Chris Rebert
On Sun, Jan 31, 2010 at 5:22 PM, Steven D'Aprano wrote: > On Sun, 31 Jan 2010 16:50:50 -0800, Chris Rebert wrote: > How do you call a function of no arguments? It's not really a function in that case, it's just a named constant. (Recall that functions don't/can't have side-effec

Re: Python and Ruby

2010-01-31 Thread Ed Keith
--- On Sun, 1/31/10, Steven D'Aprano wrote: > From: Steven D'Aprano > Subject: Re: Python and Ruby > To: python-list@python.org > Date: Sunday, January 31, 2010, 8:22 PM > On Sun, 31 Jan 2010 16:50:50 -0800, > Chris Rebert wrote: > > >>>>

Re: Python and Ruby

2010-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2010 16:50:50 -0800, Chris Rebert wrote: How do you call a function of no arguments? >>> >>> It's not really a function in that case, it's just a named constant. >>> (Recall that functions don't/can't have side-effects.) >> >> > time.time(), random.random() >> (1264983502.7

Re: Python and Ruby

2010-01-31 Thread John Bokma
Steven D'Aprano writes: > On Sun, 31 Jan 2010 14:47:08 -0600, John Bokma wrote: > >> An editor can correct the indenting of the braces example but can't with >> this one. >> >> if x: >> if y: >> foo() >> else: >> bar() >> >> While braces might be considered redundant th

Re: Python and Ruby

2010-01-31 Thread Chris Rebert
On Sun, Jan 31, 2010 at 4:25 PM, Steven D'Aprano wrote: > On Sun, 31 Jan 2010 15:40:36 -0800, Chris Rebert wrote: >> On Sun, Jan 31, 2010 at 2:36 PM, Steven D'Aprano >> wrote: >>> On Sun, 31 Jan 2010 04:28:41 -0800, Ed Keith wrote: In most functional languages you just name a function to acc

Re: Python and Ruby

2010-01-31 Thread John Bokma
Steven D'Aprano writes: > On Sun, 31 Jan 2010 14:47:08 -0600, John Bokma wrote: > >> An editor can correct the indenting of the braces example but can't with >> this one. >> >> if x: >> if y: >> foo() >> else: >> bar() >> >> While braces might be considered redundant th

Re: Python and Ruby

2010-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2010 15:40:36 -0800, Chris Rebert wrote: > On Sun, Jan 31, 2010 at 2:36 PM, Steven D'Aprano > wrote: >> On Sun, 31 Jan 2010 04:28:41 -0800, Ed Keith wrote: >>> In most functional languages you just name a function to access it and >>> you do it ALL the time. >>> >>> for example, in

Re: Python and Ruby

2010-01-31 Thread Ed Keith
--- On Sun, 1/31/10, Steven D'Aprano wrote: > From: Steven D'Aprano > Subject: Re: Python and Ruby > To: python-list@python.org > Date: Sunday, January 31, 2010, 5:36 PM > On Sun, 31 Jan 2010 04:28:41 -0800, > Ed Keith wrote: > > > In most functional la

Re: Python and Ruby

2010-01-31 Thread Arnaud Delobelle
Steven D'Aprano writes: > On Sun, 31 Jan 2010 04:28:41 -0800, Ed Keith wrote: > >> In most functional languages you just name a function to access it and >> you do it ALL the time. >> >> for example, in if you have a function 'f' which takes two parameters to >> call the function and get the res

Re: Python and Ruby

2010-01-31 Thread Chris Rebert
On Sun, Jan 31, 2010 at 2:36 PM, Steven D'Aprano wrote: > On Sun, 31 Jan 2010 04:28:41 -0800, Ed Keith wrote: >> In most functional languages you just name a function to access it and >> you do it ALL the time. >> >> for example, in if you have a function 'f' which takes two parameters to >> call

Re: Python and Ruby

2010-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2010 14:47:08 -0600, John Bokma wrote: > An editor can correct the indenting of the braces example but can't with > this one. > > if x: > if y: > foo() > else: > bar() > > While braces might be considered redundant they are not when for one > reason or ano

Re: Python and Ruby

2010-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2010 04:28:41 -0800, Ed Keith wrote: > In most functional languages you just name a function to access it and > you do it ALL the time. > > for example, in if you have a function 'f' which takes two parameters to > call the function and get the result you use: > > f 2 3 > > If y

Re: Python and Ruby

2010-01-31 Thread John Bokma
Nobody writes: > Configurable tab stops in a text editor is one of those "features" that > differentiates a "coder" from a software engineer. A coder implements it > because it's easy to implement, without giving a moment's thought to the > wider context (such as: how to communicate the non-stand

Re: Python and Ruby

2010-01-31 Thread Nobody
On Sun, 31 Jan 2010 03:01:51 -0800, rantingrick wrote: >> That's also true for most functional languages, e.g. Haskell and ML, as >> well as e.g. Tcl and most shells. Why require "f(x)" or "(f x)" if "f x" >> will suffice? > > yuck! wrapping the arg list with parenthesis (python way) makes the mo

Re: Python and Ruby

2010-01-31 Thread Nobody
On Sat, 30 Jan 2010 16:58:34 +, tanix wrote: >>I'm not familiar with Ruby, but most languages are cleaner than Python >>once you get beyond the "10-minute introduction" stage. > > I'd have to agree. The only ones that beat Python in that department are > Javascript and PHP. Plus CSS and HTML

Re: Python and Ruby

2010-01-31 Thread Ed Keith
--- On Sun, 1/31/10, Steven D'Aprano wrote: > From: Steven D'Aprano > Subject: Re: Python and Ruby > To: python-list@python.org > Date: Sunday, January 31, 2010, 6:35 AM > On Sun, 31 Jan 2010 03:01:51 -0800, > rantingrick wrote: > > > On Jan 30, 10:43 

Re: Python and Ruby

2010-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2010 03:01:51 -0800, rantingrick wrote: > On Jan 30, 10:43 am, Nobody wrote: > >> That's also true for most functional languages, e.g. Haskell and ML, as >> well as e.g. Tcl and most shells. Why require "f(x)" or "(f x)" if "f >> x" will suffice? > > yuck! wrapping the arg list w

Re: Python and Ruby

2010-01-31 Thread rantingrick
On Jan 30, 10:43 am, Nobody wrote: > That's also true for most functional languages, e.g. Haskell and ML, as > well as e.g. Tcl and most shells. Why require "f(x)" or "(f x)" if "f x" > will suffice? yuck! wrapping the arg list with parenthesis (python way) makes the most sense. Its to easy to m

Re: Python and Ruby

2010-01-30 Thread Stephen Hansen
On Sat, Jan 30, 2010 at 8:58 AM, tanix wrote: > The very idea of using a number of blanks to identify your block level > is as insane as it gets. First of all, combinations of blanks and tabs, > depending on how your ide is setup to expand tabs, may get you bugs, > you'd never imagine in your wil

Re: Python and Ruby

2010-01-30 Thread Steven D'Aprano
On Sat, 30 Jan 2010 16:58:34 +, tanix wrote: > In article , Nobody > wrote: >>On Wed, 27 Jan 2010 15:29:05 -0800, Jonathan Gardner wrote: >> >>> There's a lot of "magic" in Ruby as well. For instance, function calls >>> are made without parentheses. >> >>That's also true for most functional l

Re: Python and Ruby

2010-01-30 Thread Ed Keith
--- On Sat, 1/30/10, Nobody wrote: > From: Nobody > > Python is much, much cleaner. I don't know how anyone > can honestly say > > Ruby is cleaner than Python. > > I'm not familiar with Ruby, but most languages are cleaner > than Python > once you get beyond the "10-minute introduction" stage.

Re: Python and Ruby

2010-01-30 Thread tanix
In article , Nobody wrote: >On Wed, 27 Jan 2010 15:29:05 -0800, Jonathan Gardner wrote: > >> There's a lot of "magic" in Ruby as well. For instance, function calls are >> made without parentheses. > >That's also true for most functional languages, e.g. Haskell and ML, as >well as e.g. Tcl and mos

Re: Python and Ruby

2010-01-30 Thread Nobody
On Wed, 27 Jan 2010 15:29:05 -0800, Jonathan Gardner wrote: > There's a lot of "magic" in Ruby as well. For instance, function calls are > made without parentheses. That's also true for most functional languages, e.g. Haskell and ML, as well as e.g. Tcl and most shells. Why require "f(x)" or "(f

Re: Python and Ruby

2010-01-27 Thread hackingKK
On Thursday 28 January 2010 08:11 AM, rantingrick wrote: On Jan 27, 5:31 pm, Jonathan Gardner wrote: To add to that, Python is the type of language where experienced programmers can pick it up by reading code, and newbies won't get hopelessly lost. I've taught less-than-formal introductory

Re: Python and Ruby

2010-01-27 Thread rantingrick
On Jan 27, 5:31 pm, Jonathan Gardner wrote: > To add to that, Python is the type of language where experienced > programmers can pick it up by reading code, and newbies won't get > hopelessly lost. I've taught less-than-formal introductory programming > classes to people who are new to programmin

Re: Python and Ruby

2010-01-27 Thread Jonathan Gardner
On Jan 27, 6:56 am, Roald de Vries wrote: > On Jan 27, 2010, at 2:01 PM, Jean Guillaume Pyraksos wrote: > > > What are the arguments for choosing Python against Ruby > > for introductory programming? > > I think the main difference is in culture, especially for   > *introductory* programming. To

Re: Python and Ruby

2010-01-27 Thread Jonathan Gardner
On Jan 27, 5:47 am, Simon Brunning wrote: > > I think Python is a little cleaner, but I'm sure you'd find Ruby fans > who'd argue the complete opposite. > Are you sure about that? There's a lot of line noise in Ruby. How are you supposed to pronounce "@@"? What about "{|..| ... }"? There's a lo

Re: Python and Ruby

2010-01-27 Thread Roald de Vries
On Jan 27, 2010, at 2:01 PM, Jean Guillaume Pyraksos wrote: What are the arguments for choosing Python against Ruby for introductory programming ? Python has no provisions for tail recursion, Ruby is going to... So what ? Thanks, I think the main difference is in culture, especially for *in

Re: Python and Ruby

2010-01-27 Thread Simon Brunning
2010/1/27 Jean Guillaume Pyraksos : > What are the arguments for choosing Python against Ruby > for introductory programming ? Frankly, either would be a good choice. I think Python is a little cleaner, but I'm sure you'd find Ruby fans who'd argue the complete opposite. Both have good ecosystems

  1   2   >