Re: Vocabulary

2003-12-12 Thread Casey West
It was Friday, December 12, 2003 when Luke Palmer took the soap box, saying:
: So I'm seeing a lot of inconsistent OO-vocabulary around here, and it
: makes things pretty hard to understand.

Awesome.  I've taken your original, plus comments so far and created
perlvocab.pod.  Lets give it a couple go-rounds and it can be stored
in CVS for safe keeping (and maintaining).  Send me diffs if you like.

Document below sig.

  Casey West

-- 
Usenet is like Tetris for people who still remember how to read. 
  -- Button from the Computer Museum, Boston, MA

=pod

=head1 NAME

perlvocab - Perl Vocabulary and Glossary

=head1 SYNOPSIS

This document authoritatively defines many potentially ambiguous terms in Perl.

=head1 DESCRIPTION

=head2 Object Oriented Terminology

=over 4

=item attribute

A concrete data member of a class.  Declared with Chas.

=item property

A run-time, out-of-band sticky note to be placed on a single object,
applied with with Cbut.

A property is a simple kind of role that supplies a single attribute.
The type of a property is identical to its role name.  Roles can have
subtypes that function as enums when the subtypes are constrained to a
single value.  You can use one of these subtypes without specifically
implying the role name.  So saying

$bar but Red

might give you a value with the property Color.  You can write the corresponding
boolean test using the smart match operator:

$bar ~~ Red

and it (smartly) picks out the Color property to compare with, provided
it's unambiguous.  You can use that syntax to compare against any
subtype or junction of subtypes:

$bar ~~ RedishWhiteish # pinkish

=item trait

A compile-time sticky note to be placed on a wide variety of things. 
Used with Cis.

=item role

A collection of methods and/or attributes to be incorporated into a class sans
inheritance (and maybe some other stuff, too).   A role can be applied to a class
at compile time via Cdoes, or to an object at run time via Cbut.

So for example:

class Dog
does Boolean# role
is extended # trait
is Mammal   # base class
{
has $.tail; # attribute
has @.legs; # attribute
}

my $fido = Dog.new
but false;  # property

In this example, CMammal is a base class, which is an overloaded use of Cis.  
Though,
upon A12 release, we'll probably find out that it's not overloaded but
instead, elegantly unified, somehow. 

=head1 AUTHOR

Luke Palmer, Original Document

Contributions by Larry Wall, and Jonathan Scott Duff

Compilation by Casey West

=cut


Perl Documentation Project (PDP) BOF

2002-07-16 Thread Casey West

[Note: I've copied a few lists, but all replies should go to the
 perl-documentation list.  Apologies if you receive this message more
 than too many times.]

  Open Source Convention (aka The Perl Conference (or reverse()))
  Date: 07/22/2002
  Time: 8:00pm - 10:00pm
  Location: Grande Ballroom A in the East Tower
  Moderated by: Casey West, Aaronsen Group Ltd.

The Perl Documentation Project (PDP) is my attempt to create a
centralized documentation system for Perl like Linux has in it's Linux
Documentation Project (LDP).  The LDP has been a boon for Linux and I
think Perl is lacking in the documentation arena.  Well, the most
important kind of documentation, problem domain documentation.

The goal of this BOF is not to fight over odd implementation details
or bicker aimlessly about licenses.  Instead this is my opportunity to
get the PDP out of my head and into all of yours.  In the process I
hope to excite you about the project and enlist your help in making it
a success.

I'll need a wide range of talents for the PDP: writers, web designers,
programmers, editors, monkeys, and many more.  Anyone can fill a hole
if they want to.  Please, come to the BOF and see where you fit into
this project and find out how it fits into Perl.

I'll need some help for this meeting, a good note taker and someone
who care record it in a usable format.  On or the other will do but
both would be best.  :-)

-- 
Casey West



Re: Perl6 -- what is in a name?

2002-01-28 Thread Casey West

On Mon, Jan 28, 2002 at 01:52:13PM -0600, Garrett Goebel wrote:
:
:From: Brent Dax [mailto:[EMAIL PROTECTED]]
: Aaron Sherman:
: #
: # I think the first guy that gets hired to maintain Perl6 code,
: # and think hey, I know Perl, no sweat will disagree with
: # you.
: 
: I disagree.  He'll see stuff he doesn't understand and try to
: consult perldoc on it, at which point he'll realize that he's
: working with Perl 6.  Then he'll run out, get Camel IV, read
: it, and go back to work. Programmer is working with a better
: version of language, program is fixed, and ORA made fifty
: bucks.  Everybody's happy.  :^)
:
:Perhaps. Or perhaps he'll be like our company's lead C++ developers. They
:liked Perl4 well enough for a certain problem domain, saw some Perl5 code...
:and have tried to stay away from it ever since.
:
:Perl6 isn't going to make everyone happy.

Until you start running their code on parrot, or compile it to Perl
bytecode.  :-)

Darn, nasty thoughts out loud again.

  Casey West

-- 
Louis Pasteur's theory of germs is ridiculous fiction.
 -- Pierre Pachet, Professor of Physiology at Toulouse, 1872



Re: Apocalypse 4 : The Strange Case of the STRANGE CASE

2002-01-23 Thread Casey West

On Wed, Jan 23, 2002 at 01:45:44PM -0600, Jonathan Scott Duff wrote:
:
:On Wed, Jan 23, 2002 at 11:50:54AM +, Tim Bunce wrote:
: Early on in the life of Perl 5 Larry adopted the convention that
: subroutines that Perl calls automatically for you should have
: all-caps names[*].
:
:Not early enough to catch import() though.  Oh well ... Perl 6 will
:fix that.  (For various definitions of fix  ;-)

import() is not called automatically by Perl.  It's called
automatically by the module Exporter.pm.  Subtle but important
difference there.

  Casey West

-- 
Shooting yourself in the foot with Mach
The bullets work pretty well, but they don't make guns for it any
more.



Re: Apocalypse 4 : The Strange Case of the STRANGE CASE

2002-01-23 Thread Casey West

On Wed, Jan 23, 2002 at 03:21:37PM -0500, Casey West wrote:
:
:On Wed, Jan 23, 2002 at 01:45:44PM -0600, Jonathan Scott Duff wrote:
::
::On Wed, Jan 23, 2002 at 11:50:54AM +, Tim Bunce wrote:
:: Early on in the life of Perl 5 Larry adopted the convention that
:: subroutines that Perl calls automatically for you should have
:: all-caps names[*].
::
::Not early enough to catch import() though.  Oh well ... Perl 6 will
::fix that.  (For various definitions of fix  ;-)
:
:import() is not called automatically by Perl.  It's called
:automatically by the module Exporter.pm.  Subtle but important
:difference there.

My bad, that's wrong.  I think what my brain wanted to say is that it
is lowercase because Exporter.pm came before use() or something like
that.  Where was my morning coffee hiding today?

  Casey West

-- 
Shooting yourself in the foot with Cray
You shoot yourself in the foot with an Uzi.



Re: need help making auction

2002-01-23 Thread Casey West

On Wed, Jan 23, 2002 at 01:39:09PM -0800, frank crowley wrote:
:
:see attached file.

Hi frank,

This mailing list is not designed to help folks get their Perl 5
programs working.  EverySoft, the company that built the program you
attatched has their own online forum for helping you.

  Home Page:http://www.everysoft.com/frames.html
  Online Forum: http://209.15.166.219/cgi-bin/forum.pl

Please go to their forum and ask them to help you, I'm sure they would
be more than happy to.  No further response is necessary.

  Casey West

-- 
Technology makes it possible for people to gain control over
everything, except over technology. 
-- John Tudor



Re: Apoc4: The loop keyword

2002-01-21 Thread Casey West

On Mon, Jan 21, 2002 at 03:26:30PM -0500, Ted Ashton wrote:
:
:Thus it was written in the epistle of Michael G Schwern,
: On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote:
:  : while( my $line = FILE ) {
:  : ...
:  : }
:  
:  That still works fine--it's just that $line lives on after the while.
: 
: This creeping lexical leakage bothers me.  While it might make the
: language simpler, the proliferation of left-over lexicals seems
: sloppy.
:
:.. . . if not to say downright ugly.  The boolean of an if or a while is more a
:part of the inner stuff than the outer.  What's the chance that it could
:be considered so?  

So you're suggesting that we fake lexical scoping?  That sounds more
icky than sticking to true lexical scoping.  A block dictates scope,
not before and not after.  I don't see ickyness about making that so.

  Casey West

-- 
Shooting yourself in the foot with Modula-2 
After realizing that you can't actually accomplish anything in this
language, you shoot yourself in the head. 



The Real Perfect Name(tm)

2001-07-23 Thread Casey West

I just met this camel at the San Diego Zoo.  His name is Santana.  He
is IIRC 3 months old.

My proposal: Perl 6 should be code named Santana

  http://geeknest.com/~cwest/tpc/pictures/four/dscn0039.jpg

Since we're all sitting here at this meeting, I figure it's on topic.  :-)

  Casey West

-- 
Shooting yourself in the foot with AMIGA-DOS
The gun works pretty well, except that few people use one and it's
impossible to find bullets.



Re: So, we need a code name...

2001-05-03 Thread Casey West

On Thu, May 03, 2001 at 12:32:40PM -0700, Larry Wall wrote:
: Edward Peschko writes:
: :  : (is a nice city in Italy with a great symbol, the tower of Pisa).
: :  : 
: :  : a'P'  at the beginning, which means  'Perl',
: :  : an   'I'  which may mean 'Interpreter',
: :  : a'S'  which may means'Six'
: :  : an   'A'  which may means'Alpha'
: :  
: :  I suggest [1]Peterbilt.  /thread
: : 
: : Why not parrot, again?
: 
: Too many dead parrot jokes?  Too many lousy acronyms?

Indeed.

: Platform-Agnostic Rabidly Rapid Object Thrasher
: 
: Urque.
: 
: Since it's something underlying Perl, I'd suggest a decrement of
: Perl, which would of course be Perk.  The Java engine would have
: to be Perj, I guess, which seems fitting somehow.  The C# engine might
: be Peri because it's around whether you like it or not.
: 
: Then Perl language variants could go the other way and be:
:
: [snipped variations]
: 
: 'Course, at that rate, we eventually get back to Pisa...
: 
: Appearances notwithstanding, I am seriously suggesting Perk.  The name
: is, er, perky.  Hopefully the implementation would be too.

I agree.  There are perks to building Perl 6, etc.

Think happy thoughts Peter

  Casey West

-- 
In case of fire, do your utmost to alarm the hotel porter.
 --In a Vienna hotel



Re: a modest proposal Re: s/./~/g

2001-04-25 Thread Casey West

On Wed, Apr 25, 2001 at 06:19:40PM +, Fred Heutte wrote:
: It seems to me that ~ relates to forces (operators, functions and methods)
: more than to atoms (scalars), so to speak.  It's the curve of binding Perl
: at work here.
: 
: So why not leave  .  alone and have  ~  substitute for  -  
: 
: $mydsn-Sql($mysqlstmt  . $moresql) ;
: $mydsn~Sql($mysqlstmt  . $moresql) ;

In that case I'd rather use this syntax:

$obj'attribute;

$obj'constructor'method;

Or... maybe not...

-- 
Casey West



Re: Dot can DWIM without whitespace

2001-04-25 Thread Casey West

On Wed, Apr 25, 2001 at 07:23:47PM -0700, Edward Peschko wrote:
: On Thu, Apr 26, 2001 at 03:16:46AM +0100, Simon Cozens wrote:
:  On Wed, Apr 25, 2001 at 03:33:52PM -0700, Edward Peschko wrote:
:Please, no. Some of us have to *teach* this language.
:   Then I guess that either space sensitive '.' is the answer
:  
:  Sorry. I'll try it again.
:  
:  SPACE SENSITIVE and SOME OF US HAVE TO TEACH IT. Do you understand yet?
:  
:  Are you *really* willing to deal with hundreds of newbies who don't
:  understand why $a . $b isn't the same as $a .$b and isn't the same as
:  $a. $b and isn't the same as $a.$b? And do you realise what the only
:  good answer we can possibly give them is? Because Ed said so.
: 
: Argh. 
: 
: The problem already comes up... '4. 5' is not the same as '4.5'. '.' is 
: *already* doing double duty as decimal mark. The fact that you don't see this 
: very often shows exactly how rare the mistake arises.

Perl 5:
print 4. 5 # error
print 4.5  # 4.5
print 4 .5 # 45

If you were to ask me, I'd say there is a bug in the last one, it
should be an error, .5 is a valid number.  ( PS, don't talk about my
opinion here, unless it is really relevant. )

: I think the 'tutorial' will come from experience. When the error that you get 
: from $a.$b comes up (and it should be a syntax error) you'll see exactly what 
: is wrong. If $a. $b, again, syntax error. Only $a . $b should be allowed.

It can't be a syntax error:

$a = Foo.new;
$b = method;

print $a.$b( @params );

: The only point of contention would be if someone said $a . b, when they meant
: $a.b. And how often will that occur?

More often that you might think.  I see Perl folks who love white
space writing:

print
$cgi - header,
$cgi - start_html,
$cgi - h2( 'my page' ),
$cgi - hr,
$cgi - a(
{ -href = 'http://geeknest.com' },
$cgi - font(
{ -color = 'red' },
'My homepage!',
),
),
$cgi - end_html;

In anycase, it happens frequently already.

-- 
Casey West



Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-24 Thread Casey West

On Tue, Apr 24, 2001 at 12:32:29PM -0400, John L. Allen wrote:
: 
: On Tue, 24 Apr 2001, Graham Barr wrote:
: 
:  On Mon, Apr 23, 2001 at 05:19:22PM -0700, Larry Wall wrote:
:  
:   At the moment I'm leaning toward ^ for concat, and ~ for xor.  That
:  
:  I think that would lead to confusion too. In many languages ^ is
:  xor and ~ is a bitwise invert. It is that way in perl now too, so
:  perl is already quite standard in that area. Changing these just
:  to get . for - so that we are more standard seems very strange
:  as you are loosing two standards to gain one.
:  
:  To be honest though I don't think it is possible to get a single
:  char concat operator with loosing something else, which is a shame.
:  It would be good if we could somehow overload + to be both string
:  and numeric, but I not sure that is possible.
: 
: I think someone may have mentioned this already, but why not just say
: that if you want '.' to mean concatenation, you have to surround it on 
: either side with white space?  If there's no white space around it, then 
: it is forced to mean method invokation, or whatever else.  Sure, some 
: japhs will break, but that's just too bad :-)  Perl already 
: has other cases where white space matters, why not one more.  That way, 
: perhaps we can all get what we want, namely that '.' means both 
: concatenation _and_ method invokation.

No thanks.  We already have the ability to put white space around '-'
which is helpfull a la Soap::Lite.

Besides, I can't think of instances where white space matters without
being except:

print __EOT__

__EOT__

which is easily avoidable via 'print  __EOT__'.

-- 
Casey West



Re: Sane + string concat proposal

2001-04-24 Thread Casey West

On Tue, Apr 24, 2001 at 11:53:49AM -0700, Mark Koopman wrote:
: Perl 5Perl 6
: - 
: print Next is  . $i + 1;print Next is  + $i + 1;
: 
: 
: this is the root of the problemPerl 5 version is easy to 
: understand,  Perl 6 version is still ambiguous

It is important to explain that if either side of the '+' operator is
in string context, it is interpreted as concat.

These would all have string context:

Perl5   Perl6
--- ---
print Next is  . $i + 1;  print Next is  + $i + 1;
print 1 . $two; print 1 . $two;
print 1 + 2 . $three;   print 1 + 2 + $three;

I think that another area of confusion might be the precidence model,
which was not detailed.  For example:

[cwest@stupid cwest]$ perl -le'$i=2;print Next is  . $i + 2'
2
[cwest@stupid cwest]$ perl -le'$i=2;print Next is  . ( $i + 2 )'
Next is 4


I would prescribe it to be the following, just like Perl5 is now:

Perl5   Perl6
--- ---
print Next is  . ($i + 1);print Next is  + ($i + 1);
print 1 . $two; print 1 . $two;
print (1 + 2) . $three; print (1 + 2) + $three;

Numeric context wins.

I am not opposed to this idea, I see it to be quite easy to
understand, even without explicit parens, though they help.

-- 
Casey West



Re: Sane + string concat proposal

2001-04-24 Thread Casey West

On Tue, Apr 24, 2001 at 03:09:18PM -0400, Stephen P. Potter wrote:
: Lightning flashed, thunder crashed and Nathan Wiger [EMAIL PROTECTED] whisper
: ed:
: | Under this proposal, string concatenation would be acheived by the
: | *combination* of  and +. So, in Perl 5 you would have something like
: | this:
: | 
: |$string3 = $string1 . $string2;
: | 
: | In Perl 6, you would do this like so:
: | 
: |$string3 = $string1 + $string2;
: 
: Once you go this route, you've pretty much destroyed the usefulness of
: having a concat operator.  It is far less typing to do
: 
:$string3 = $string1$string2;

I would consider thinking about the bigger problem of:

$string = foo() [something here] bar();

Of course, if we choose to remove the concat operator all together
we're left:

$string = join '', foo(), bar();

I could live with that if I had to, but only if I had to.

: I've seen someone say something about concating a large list of scalars.
: Can you imagine:
: 
: $longstring = $short + $another + $andathird + $andafourth +
:   $onemore + $okanother +$wowlots 
: 
: Personally, my fingers got really tired of having to use the shift key for
: all the quotes, the $, and the +.  Of course, I'd normally just write that
: as
: 
: $longstring = join('', $short, $another, ... , $wowlots);

I would do that for this example anyhow.

-- 
Casey West



Re: how about just juxtaposing? (Re: Sane + string concat proposal)

2001-04-24 Thread Casey West

On Tue, Apr 24, 2001 at 08:42:10PM +0100, Michael G Schwern wrote:
: On Tue, Apr 24, 2001 at 02:32:39PM -0500, Jarkko Hietaniemi wrote:
:  Has the road of just putting things next to each other been extensively
:  tried?  It works for Awk...  juxtapose, the Famous Invisible Perl
:  Operator.
:  
:  Perl 5  Perl 6
:  
:  $a = $b . $c;   $a = $b $c; # or $b$c
:  $a = foo.$c;  $a = foo $c;  # or foo$c
:  $a = foo . $c;  $a = foo$c; # foo $c wouldn't work...
:  $a = $c . foo;  $a = ${c}foo# (if foo is a function)
:  $a = foo() . $c;$a = foo() $c;
:  $a = $c . foo();$a = $c foo();
:  $a = $b-c . $d;$a = $b-c $d;  # or $b-c$d;
: 
: This is going to make finding syntax errors a bit difficult, as many
: will simply become concatination operators.  Consider
: 
: print Foo
: foo(bar);
: 
: Did the author forget a semi-colon, or did they intend to concatinate
: there?  Also, consider this...

Or, did they intend to concatinate 'print' and Foo in void context?

-- 
Casey West



Re: YA string concat proposal

2001-04-24 Thread Casey West

On Tue, Apr 24, 2001 at 01:05:24PM -0700, Nathan Wiger wrote:
: Michael G Schwern wrote:
:  
:  cc and ce
:  
:  Perl 5  Perl 6
:  print foo . bar;print foo cc bar;
:  print 2 . 4;print 2 cc 4;
:  print foo  . ($i + 1);print foo  cc ($i + 1);
:  $foo .= bar ; $foo ce bar;
: 
:  It also has the nice side-effect of preserving '.=' functionality,
:  which I'd rather not lose (especially after having made fun of
:  $foo = $foo . 'bar'; type code).
: 
: While we're brainstorming a wish-list, here's something I've always
: wanted, a replacement for:
: 
:$a = $b . $a;
: 
: Under the above plan, maybe this is:
: 
:$a ca $b;
: 
: For concat after?

Now this sparks my interest.  :)

The only think I don't like is:

  $a ce $b;
  $a ca $b;

because I'm so used to seing

  $a [char]= $b;

I would think of:

  $a c= $b;

but then the ca() idea might not be feasible unless we thought:

  $a ce= $b;
  $a ca= $b;

was a good idea.

-- 
Casey West