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
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):
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 g
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
> >> re
--- 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.
>
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
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 gr
--- 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 met
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 meth
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
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:
>
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 c
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
--- 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 }
>
> # t
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
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 force
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
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
vi
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
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
> >> r
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.
>
>
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 prope
--- 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 d
--- 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
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.
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 r
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 fou
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 in
--- 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 cou
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 got
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 latte
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
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 m
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
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 posit
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, b
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 d
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 Ruby
38 matches
Mail list logo