Re: a Python person's experience with Ruby

2007-12-11 Thread Lou Pecora
In article [EMAIL PROTECTED], Bruno Desthuilliers [EMAIL PROTECTED] wrote: Lou Pecora a écrit : In article [EMAIL PROTECTED], Bruno Desthuilliers [EMAIL PROTECTED] wrote: Thus: close; could replace close(); *Please* give proper attribution. I'd *never* suggest such a

Re: a Python person's experience with Ruby

2007-12-10 Thread Bruno Desthuilliers
MonkeeSage a écrit : On Dec 9, 6:23 pm, MonkeeSage [EMAIL PROTECTED] wrote: Hi Bruno, I think that we've been having a mainly semantic (pun intended) dispute. I think you're right, that we've been using the same words with different meanings. Fine. So we may have a chance to get out there

Re: a Python person's experience with Ruby

2007-12-10 Thread Chris Mellon
On Dec 9, 2007 5:11 AM, Arnaud Delobelle [EMAIL PROTECTED] wrote: On Dec 9, 12:15 am, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Richard Jones a écrit : Bruno Desthuilliers wrote: class A(object): @apply def a(): def fget(self): return self._a

Re: a Python person's experience with Ruby

2007-12-10 Thread Virgil Dupras
On Dec 9, 1:15 am, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Richard Jones a écrit : Bruno Desthuilliers wrote: class A(object): @apply def a(): def fget(self): return self._a def fset(self, val): self._a = val return property(**locals())

Re: a Python person's experience with Ruby

2007-12-09 Thread Arnaud Delobelle
On Dec 9, 12:15 am, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Richard Jones a écrit : Bruno Desthuilliers wrote: class A(object): @apply def a(): def fget(self): return self._a def fset(self, val): self._a = val return property(**locals())

Re: a Python person's experience with Ruby

2007-12-09 Thread Lou Pecora
In article [EMAIL PROTECTED], Bruno Desthuilliers [EMAIL PROTECTED] wrote: Thus: close; could replace close(); Wouldn't this give an ambiguity? afcn=close # make an alias to the close function val=close() # set val to the return value of the close function -- -- Lou Pecora

Re: a Python person's experience with Ruby

2007-12-09 Thread Steve Howell
After starting this discussion thread, I found the link below: http://www.b-list.org/weblog/2006/jun/18/lets-talk-about-python-and-ruby/ If you're like me--struggling to learn Ruby while having Python as your primary point of reference--you might find some of the points informative. I suspect

Re: a Python person's experience with Ruby

2007-12-09 Thread Bruno Desthuilliers
Lou Pecora a écrit : In article [EMAIL PROTECTED], Bruno Desthuilliers [EMAIL PROTECTED] wrote: Thus: close; could replace close(); *Please* give proper attribution. I'd *never* suggest such a thing. Wouldn't this give an ambiguity? afcn=close # make an alias to the

Re: a Python person's experience with Ruby

2007-12-09 Thread MonkeeSage
On Dec 8, 4:54 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: MonkeeSage a écrit : On Dec 8, 12:42 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: MonkeeSage a écrit : On Dec 7, 11:08 pm, Steve Howell [EMAIL PROTECTED] wrote: (snip) 4) Ruby forces you to explicitly make

Re: a Python person's experience with Ruby

2007-12-09 Thread MonkeeSage
On Dec 9, 1:58 pm, MonkeeSage [EMAIL PROTECTED] wrote: Sure. But as I understand, every attribute in python is a value, sorry...*references* a value -- http://mail.python.org/mailman/listinfo/python-list

Re: a Python person's experience with Ruby

2007-12-09 Thread Steve Howell
--- MonkeeSage [EMAIL PROTECTED] wrote: Not just callable, but interchangeable. My point was that in ruby, if you use a block or a lambda as a HOF, you have to use #call / #[] / yield keyword on it to call it. def foo(a) puts a end bar = lambda { | a | puts a } # these do the

Re: a Python person's experience with Ruby

2007-12-09 Thread I V
On Sun, 09 Dec 2007 11:58:05 -0800, MonkeeSage wrote: class A attr_accessor :a # == self.a, # accessible to instances of A def initialize @a = foo # A.__a # only accessible from class scope of A end end Once again, there is no such thing as an

Re: a Python person's experience with Ruby

2007-12-09 Thread MonkeeSage
On Dec 9, 3:10 pm, I V [EMAIL PROTECTED] wrote: On Sun, 09 Dec 2007 11:58:05 -0800, MonkeeSage wrote: class A attr_accessor :a # == self.a, # accessible to instances of A def initialize @a = foo # A.__a # only accessible from class scope of A

Re: a Python person's experience with Ruby

2007-12-09 Thread Bruno Desthuilliers
MonkeeSage a écrit : On Dec 8, 4:54 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: MonkeeSage a écrit : On Dec 8, 12:42 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: MonkeeSage a écrit : On Dec 7, 11:08 pm, Steve Howell [EMAIL PROTECTED] wrote: (snip) 4) Ruby forces you to

Re: a Python person's experience with Ruby

2007-12-09 Thread Bruno Desthuilliers
MonkeeSage a écrit : On Dec 9, 1:58 pm, MonkeeSage [EMAIL PROTECTED] wrote: Sure. But as I understand, every attribute in python is a value, sorry...*references* a value So make it: 'reference an object' -- http://mail.python.org/mailman/listinfo/python-list

Re: a Python person's experience with Ruby

2007-12-09 Thread Bruno Desthuilliers
Steve Howell a écrit : (snip) Jordan and others, thanks for all your posts; I am learning a lot about both languages. This is what I've gathered so far. Python philosophy: passing around references to methods should be natural (i.e. my_binary_op = math.add) calling methods

Re: a Python person's experience with Ruby

2007-12-09 Thread Steve Howell
--- Bruno Desthuilliers [EMAIL PROTECTED] wrote: Steve Howell a écrit : (snip) Jordan and others, thanks for all your posts; I am learning a lot about both languages. This is what I've gathered so far. Python philosophy: passing around references to methods should be

Re: a Python person's experience with Ruby

2007-12-09 Thread MonkeeSage
Hi Bruno, I think that we've been having a mainly semantic (pun intended) dispute. I think you're right, that we've been using the same words with different meanings. I would like to say firstly that I've been using python for a few years now (about three I think), and I think I have a basic

Re: a Python person's experience with Ruby

2007-12-09 Thread MonkeeSage
On Dec 9, 6:23 pm, MonkeeSage [EMAIL PROTECTED] wrote: Hi Bruno, I think that we've been having a mainly semantic (pun intended) dispute. I think you're right, that we've been using the same words with different meanings. I would like to say firstly that I've been using python for a few

Re: a Python person's experience with Ruby

2007-12-09 Thread Steve Howell
--- MonkeeSage [EMAIL PROTECTED] wrote: On Dec 9, 6:23 pm, MonkeeSage [EMAIL PROTECTED] wrote: Hi Bruno, I think that we've been having a mainly semantic (pun intended) dispute. I think you're right, that we've been using the same words with different meanings. I think Ruby and

Re: a Python person's experience with Ruby

2007-12-08 Thread Arkanes
Colin J. Williams wrote: Steve Howell wrote: Thanks for the interesting comparison. [snip] 3) I actually like being able to omit parentheses in method definitions and method calls. In Ruby you can express add(3,5,7) as both add(3,5,7) and add 3, 5, 7. The latter syntax is obviously

Re: a Python person's experience with Ruby

2007-12-08 Thread Colin J. Williams
MonkeeSage wrote: On Dec 7, 11:08 pm, Steve Howell [EMAIL PROTECTED] wrote: Python is my favorite programming language. I've used it as my primary language for about six years now, including four years of using it full-time in my day job. Three months ago I decided to take a position with

Re: a Python person's experience with Ruby

2007-12-08 Thread Colin J. Williams
Steve Howell wrote: Thanks for the interesting comparison. [snip] 3) I actually like being able to omit parentheses in method definitions and method calls. In Ruby you can express add(3,5,7) as both add(3,5,7) and add 3, 5, 7. The latter syntax is obviously more error prone, but I don't

Re: a Python person's experience with Ruby

2007-12-08 Thread James Matthews
I have been waiting for something like this! Thanks! On Dec 8, 2007 6:08 AM, Steve Howell [EMAIL PROTECTED] wrote: Python is my favorite programming language. I've used it as my primary language for about six years now, including four years of using it full-time in my day job. Three months

Re: a Python person's experience with Ruby

2007-12-08 Thread Bruno Desthuilliers
MonkeeSage a écrit : On Dec 7, 11:08 pm, Steve Howell [EMAIL PROTECTED] wrote: (snip) 4) Ruby forces you to explicitly make attributes for instance variables. At first I found this clumsy, but I've gotten used to it, and I actually kind of like it in certain circumstances. 4.) Yeah,

Re: a Python person's experience with Ruby

2007-12-08 Thread Bruno Desthuilliers
Colin J. Williams a écrit : Steve Howell wrote: Thanks for the interesting comparison. [snip] 3) I actually like being able to omit parentheses in method definitions and method calls. In Ruby you can express add(3,5,7) as both add(3,5,7) and add 3, 5, 7. The latter syntax is

Re: a Python person's experience with Ruby

2007-12-08 Thread MonkeeSage
On Dec 8, 12:42 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: MonkeeSage a écrit : On Dec 7, 11:08 pm, Steve Howell [EMAIL PROTECTED] wrote: (snip) 4) Ruby forces you to explicitly make attributes for instance variables. At first I found this clumsy, but I've gotten used to it,

Re: a Python person's experience with Ruby

2007-12-08 Thread Steve Howell
--- Bruno Desthuilliers [EMAIL PROTECTED] wrote: Colin J. Williams a écrit : I'm not sure that I like add 3, 5, 7 but it would be nice to be able to drop the parentheses when no argument is required. Thus: close; could replace close(); This just could not work given

Re: a Python person's experience with Ruby

2007-12-08 Thread I V
On Sat, 08 Dec 2007 11:23:57 -0800, MonkeeSage wrote: The equivalent python idiom is something like: class A: __a = foo def __init__(self): self.a = A.__a [...] Which roughly translates to this in ruby: class A attr_accessor :a def initialize @a = foo end

Re: a Python person's experience with Ruby

2007-12-08 Thread Bruno Desthuilliers
MonkeeSage a écrit : On Dec 8, 12:42 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: MonkeeSage a écrit : On Dec 7, 11:08 pm, Steve Howell [EMAIL PROTECTED] wrote: (snip) 4) Ruby forces you to explicitly make attributes for instance variables. At first I found this clumsy, but I've

Re: a Python person's experience with Ruby

2007-12-08 Thread Bruno Desthuilliers
Steve Howell a écrit : --- Bruno Desthuilliers [EMAIL PROTECTED] wrote: Colin J. Williams a écrit : I'm not sure that I like add 3, 5, 7 but it would be nice to be able to drop the parentheses when no argument is required. Thus: close; could replace close(); This just could not

Re: a Python person's experience with Ruby

2007-12-08 Thread Richard Jones
Bruno Desthuilliers wrote: class A(object): @apply def a(): def fget(self): return self._a def fset(self, val): self._a = val return property(**locals()) def __init__(self): self.a = foo That property setup seems overly complicated. As far as I

Re: a Python person's experience with Ruby

2007-12-08 Thread Steve Howell
--- Bruno Desthuilliers Another aspect of Ruby is that the final expression evaluated in a method actually gets returned as the result of a method, Unless there's an explict return before... which has further implications on whether close is simply evaluated or called. I'm

Re: a Python person's experience with Ruby

2007-12-08 Thread Steve Howell
--- Richard Jones [EMAIL PROTECTED] wrote: class A(object): def set_a(self, value): self._a = value a = property(lambda self: self._a, set_a) Note that this differs from a regular attribute because a is not deletable from instances (the property defines no deleter).

Re: a Python person's experience with Ruby

2007-12-08 Thread Bruno Desthuilliers
Richard Jones a écrit : Bruno Desthuilliers wrote: class A(object): @apply def a(): def fget(self): return self._a def fset(self, val): self._a = val return property(**locals()) def __init__(self): self.a = foo That property setup seems overly

Re: a Python person's experience with Ruby

2007-12-08 Thread Kay Schluehr
On Dec 8, 8:56 pm, Steve Howell [EMAIL PROTECTED] wrote: --- Bruno Desthuilliers [EMAIL PROTECTED] wrote: Colin J. Williams a écrit : I'm not sure that I like add 3, 5, 7 but it would be nice to be able to drop the parentheses when no argument is required. Thus: close;

a Python person's experience with Ruby

2007-12-07 Thread Steve Howell
Python is my favorite programming language. I've used it as my primary language for about six years now, including four years of using it full-time in my day job. Three months ago I decided to take a position with a team that does a lot of things very well, but they don't use Python. We use

Re: a Python person's experience with Ruby

2007-12-07 Thread MonkeeSage
On Dec 7, 11:08 pm, Steve Howell [EMAIL PROTECTED] wrote: Python is my favorite programming language. I've used it as my primary language for about six years now, including four years of using it full-time in my day job. Three months ago I decided to take a position with a team that does a