Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Juerd
John Siracusa skribis 2004-12-03 14:05 (-0500):
 I'd like to be able to s/Python/Perl 6/ above, but after many discussions on
 this topic, I'm still not sure if I can.

Anything can be anything. I'm sure that despite the ability to run all
the code you want upon reading/writing an attribute, some people will
still write setters and getters.

Would it be Perl if it dictated any of these approaches?


Juerd


Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread John Siracusa
On Fri, 3 Dec 2004 20:37:40 +0100, Juerd [EMAIL PROTECTED] wrote:
 John Siracusa skribis 2004-12-03 14:05 (-0500):
 From http://dirtsimple.org/2004/12/python-is-not-java.html
 
 In Java, you have to use getters and setters because using public fields
 gives you no opportunity to go back and change your mind later to using
 getters and setters. So in Java, you might as well get the chore out of the
 way up front. In Python, this is silly, because you can start with a normal
 attribute and change your mind at any time, without affecting any clients of
 the class. So, don't write getters and setters.
 
 I'd like to be able to s/Python/Perl 6/ above, but after many discussions on
 this topic, I'm still not sure if I can.
 
 Anything can be anything. I'm sure that despite the ability to run all
 the code you want upon reading/writing an attribute, some people will
 still write setters and getters.

I guess I wasn't asking if it would be possible (I think that's been
established), but if it would be easy, reasonable, or clean (as it
appears to be in Python, although I'm just going by what the quoted web page
says).  I recall some discussions about the best way to this in Perl 6,
but don't recall if it converged on anything nice.

Anyway, I thought it was interesting to see the ease of forward
compatibility for simple attributes touted as a feature of Python.  I'd
like to tout it as a feature of Perl 6 too, because I also hate writing
getters and setters... :)

-John




Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Juerd
John Siracusa skribis 2004-12-03 14:46 (-0500):
 Anyway, I thought it was interesting to see the ease of forward
 compatibility for simple attributes touted as a feature of Python.  I'd
 like to tout it as a feature of Perl 6 too, because I also hate writing
 getters and setters... :)

Of course it's a feature. Having lvalue attributes means you don't have
to replicate all scalar lvalue methods to get all functionality without
copying. IMO, This is even better than in Python, with its constant
variables.

Let me demonstrate:

$foo.bar .= foo
$foo.bar ~~ s:e/foo/bar/;
$foo.bar.=reverse;
my $quux := $foo.bar;
$quux = 1;

versus:

$foo.set_bar($foo.get_bar ~ foo);
$foo.set_bar(do { (my $temp = $foo.get_bar) ~~ s:e/foo/bar/; $temp });
$foo.set_bar($foo.get_bar.reverse);
my $quux  # ... ehm, right. Let's see. I think it's something like:
will STORE { $foo.set_bar($_) }
will FETCH { $foo.get_bar };
$quux = 1;


Juerd


Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Juerd
Juerd skribis 2004-12-03 21:09 (+0100):
 $foo.bar .= foo

Meant ~= there.


Juerd


Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread John Siracusa
On Fri, 3 Dec 2004 22:06:43 +0100, Paul Johnson [EMAIL PROTECTED] wrote:
 http://www.nntp.perl.org/group/perl.perl6.language/9576

Wow, that's a blast from the past.  I wonder how much of it is still
valid... :)

-John




Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 04:13:01PM -0500, John Siracusa wrote:
: On Fri, 3 Dec 2004 22:06:43 +0100, Paul Johnson [EMAIL PROTECTED] wrote:
:  http://www.nntp.perl.org/group/perl.perl6.language/9576
: 
: Wow, that's a blast from the past.  I wonder how much of it is still
: valid... :)

Almost all of it, except for details like is public.  Just because
A12 didn't come out till this year doesn't mean we weren't talking
about those things ever since 2000.  I knew that attributes wanted
to look like $.foo since before Apocalypse 1, for instance.

Larry


Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Luke Palmer
John Siracusa writes:
 I guess I wasn't asking if it would be possible (I think that's been
 established), but if it would be easy, reasonable, or clean (as
 it appears to be in Python, although I'm just going by what the quoted
 web page says).  I recall some discussions about the best way to
 this in Perl 6, but don't recall if it converged on anything nice.

It converged on the core-like way returning an anonymous object with
STORE and FETCH methods is ugly, but it should be easy to provide nice
wrappers around it.  Those nice wrappers are probably going to end up
in the standard dialect.

Perl 6 is going to be better with opacity than any other language I know
of.  We're aware that lying about what's really going on is a useful
thing to do.  So we give you the chance to be as poker-faced about your
internals as you like.

... Not that the user can't read your ass if he tries hard enough :-)

Luke


Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Mark J. Reed
On 2004-12-03 at 14:46:16, John Siracusa wrote:
 Anyway, I thought it was interesting to see the ease of forward
 compatibility for simple attributes touted as a feature of Python.  I'd
 like to tout it as a feature of Perl 6 too, because I also hate writing
 getters and setters... :)

Amen.

Which reminds me, what ever happened to POOL?  You there, Simon?


-- 
Mark REED| CNN Internet Technology
1 CNN Center Rm SW0831G  | [EMAIL PROTECTED]
Atlanta, GA 30348  USA   | +1 404 827 4754


Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Paul Johnson
On Fri, Dec 03, 2004 at 02:05:16PM -0500, John Siracusa wrote:

 From http://dirtsimple.org/2004/12/python-is-not-java.html
 
 In Java, you have to use getters and setters because using public fields
 gives you no opportunity to go back and change your mind later to using
 getters and setters. So in Java, you might as well get the chore out of the
 way up front. In Python, this is silly, because you can start with a normal
 attribute and change your mind at any time, without affecting any clients of
 the class. So, don't write getters and setters.
 
 I'd like to be able to s/Python/Perl 6/ above, but after many discussions on
 this topic, I'm still not sure if I can.

http://www.nntp.perl.org/group/perl.perl6.language/9576

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net


Re: Python...

2001-06-05 Thread Russ Allbery

David Grove [EMAIL PROTECTED] writes:

 Perl is far more practical than experimental.

 Not at the moment. That's the problem.

Pretty much everything proposed, even in the wildest RFCs during the
brainstorming phase, was still stuff that's been done elsewhere by other
languages.  That's the practical vs. experimental distinction that I'm
drawing.  I realize that you don't like the direction that Perl 6 design
is heading, but it's still not heading towards being an experimental
language.  I've seen some *real* experimental languages; they're a lot
more unconventional.

You can still trace nearly everything that was proposed back to C, Lisp,
or Generic Object-Oriented Language, if not in inspiration than at least
in fundamental similarities.

-- 
Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/



RE: Python...

2001-06-04 Thread David Grove

 Perl is far more practical than experimental.

Not at the moment. That's the problem.

(Note the subtle subject change back to its original intent.)

p





Re: Python...

2001-06-03 Thread Simon Cozens

On Sun, Jun 03, 2001 at 02:02:03AM +, Vijay Singh wrote:
 I thought your head would be turned by Ruby ;-)
 
 BTW - There's a Ruby Inline::Perl module in alpha
 testing now...this will be a nice complement to the
 Inline::Python module already available...

And today I put the finishing touches on the Ruby-to-Perl-bytecode 
compiler. Then there'll be no excuse for people using that slow old
Ruby interpreter again. :)

-- 
The steady state of disks is full.
-- Ken Thompson



Re: Python...

2001-06-03 Thread Piers Cawley

Simon Cozens [EMAIL PROTECTED] writes:

 On Sun, Jun 03, 2001 at 02:02:03AM +, Vijay Singh wrote:
  I thought your head would be turned by Ruby ;-)
  
  BTW - There's a Ruby Inline::Perl module in alpha testing
  now...this will be a nice complement to the Inline::Python
  module already available...
 
 And today I put the finishing touches on the Ruby-to-Perl-bytecode
 compiler. Then there'll be no excuse for people using that slow old
 Ruby interpreter again. :)

Apart from the minor issue of Leon not having ported all the runtime
libraries (in annoying C) yet.

-- 
Piers Cawley
www.iterative-software.com




Re: Python...

2001-06-03 Thread Simon Cozens

On Sun, Jun 03, 2001 at 09:42:37PM +0100, Piers Cawley wrote:
 Apart from the minor issue of Leon not having ported all the runtime
 libraries (in annoying C) yet.

Because I'm hacking at the bytecode level, I can replace the relevant
subroutine calls to Perl builtins.

Oh, hrm. I wonder if I could use the functions from the Ruby runtime
as custom ops.

-- 
Can you sum up plan 9 in layman's terms?
It does everything Unix does only less reliably - kt



Re: Python...

2001-06-03 Thread Piers Cawley

Simon Cozens [EMAIL PROTECTED] writes:

 On Sun, Jun 03, 2001 at 09:42:37PM +0100, Piers Cawley wrote:
  Apart from the minor issue of Leon not having ported all the runtime
  libraries (in annoying C) yet.
 
 Because I'm hacking at the bytecode level, I can replace the relevant
 subroutine calls to Perl builtins.
 
 Oh, hrm. I wonder if I could use the functions from the Ruby runtime
 as custom ops.

You are a very bad man. Go to it.

-- 
Piers Cawley
www.iterative-software.com




Re: Python...

2001-06-03 Thread Simon Cozens

On Sun, Jun 03, 2001 at 10:48:11PM +0100, Piers Cawley wrote:
  Oh, hrm. I wonder if I could use the functions from the Ruby runtime
  as custom ops.
 
 You are a very bad man. Go to it.

I would do, but I'm getting segfaults when I reimplement op.c in Perl.
Unfortunately, I'm not joking.

-- 
The Write Many, Read Never drive. For those people that don't know their
 system has a /dev/null already. - Rik Steenwinkel on Exabyte drives, ASR



RE: Python...

2001-06-03 Thread David Grove

 -Original Message-
 From: Vijay Singh [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, June 02, 2001 10:02 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: Python...



 Python? Didn't know you were so into tuples...

 I thought your head would be turned by Ruby ;-)

It is. But I'm afraid that Ruby is not as mature as Python. It's a business
decision. I need a mature, /relatively/ stable language to plan my next few
development projects. Perl is looking a bit shaky at the moment.

p





Re: Python...

2001-06-03 Thread Russ Allbery

Vijay Singh [EMAIL PROTECTED] writes:

 I always expected Perl to be leading the way, *the* language that broke
 new ground...where only camels dared to tread...

Er... that strikes me as a strange expectation.  I can't think of much in
Perl that hasn't appeared elsewhere earlier.  Perl makes a lot of already
developed ideas practical, but breaking new ground isn't really its forte.

If you want to look at languages that are breaking new ground, I recommend
Objective Caml, or Haskell, or Mercury, or even Eiffel.  Languages like
Perl and Python are really almost entirely just attempting to make
practical ideas already explored in other practical and experimental
languages.

Perl is far more practical than experimental.

-- 
Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/



Re: Python...

2001-06-02 Thread Vijay Singh


Python? Didn't know you were so into tuples...

I thought your head would be turned by Ruby ;-)

BTW - There's a Ruby Inline::Perl module in alpha
testing now...this will be a nice complement to the
Inline::Python module already available...


Must dash - Vijay




-- 

___
Get your free email from http://www.guju.net



Powered by Outblaze