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
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
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
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())
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())
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
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
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
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
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
--- 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
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
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
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
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
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
--- 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
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
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
--- 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
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
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
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
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
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,
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
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,
--- 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
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
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
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
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
--- 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
--- 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).
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
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;
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
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
38 matches
Mail list logo