Re: Subroutine attributes, from a long time ago

2001-05-08 Thread David L. Nicol

John Porter wrote:
 
  [EMAIL PROTECTED] writes:
  :
  : why should a reader expect that a declarative description
  : of foo would be followed by the body of foo?
 
 Isn't the functional definition of a sub
 just another one of its attributes, anyway?

I'm a little bit disappointed that p6 doesn't appear to be letting
user-defined classes take up slots in the main symbol table along
with scalar and array slots.

If I can define a $duh (duh.scalar) and a @duh (duh.array) why cant
I define a class called actor and then define duh.actor?

I guess this is back to the allowing undecorated keywords to mean
variables thing.  In keeping with Nathan's suggestion that angles
become the shortcut for the .more method, which is special only
in that it has a shortcut, the other early-perl declarations $,%,@
could be considered as shortcuts for the scalar, hash and array 
attributes of the keyword, aka duh.scalar, duh.hash and duh.array

then we _keep_ typeglobs instead of throwing them away, and
michael schwern and dan sugalski's heads both implode.




Subroutine attributes, from a long time ago

2001-05-07 Thread Simon Cozens

Old stuff becomes relevant again...

-
From: [EMAIL PROTECTED] (Larry Wall) 
To: [EMAIL PROTECTED] 
Cc: [EMAIL PROTECTED] (Larry Wall), [EMAIL PROTECTED] (Perl 5 Porters) 
Date: Wed, 3 Sep 1997 16:32:29 -0700 
Message-Id: [EMAIL PROTECTED] 

[EMAIL PROTECTED] writes:
: According to Larry Wall:
:  Also, you can put your beloved article in:
:  sub foo is a locked method returning list { }
: 
: I hope you're not serious, Larry.

I'm serious about thinking through all the possibilities before we
settle on anything.  All things have the advantages of their
disadvantages, and vice versa.

Part of language design is purturbing the proposed feature in various
directions to see how it might generalize in the future.  Sometimes we
choose the generalization.  Sometimes we don't.

I'm just pointing out here that treating subroutine attributes as a
list of little pragmas that can be ignored if not understood has some
interesting benefits for people who like to be verbose.  It also has
some marginal benefits in terms of backward compatibility.  I wouldn't
ever write the full sentence myself, but then, I never use goto either.

: Perl may permit poetry, which is
: fine by me, but this is going out of your way to accept the syntax of
: full English sentences, and that's beyond the pale.  Besides, why
: should a reader expect that a declarative description of foo would be
: followed by the body of foo?

It's appositival, if it's there.  And it doesn't have to be there.
And it's really obvious that it's there when it's there.

:  I'm inclined to stick with the more adjectival
:  
:  my obedient persistent frozen mongrel Dog $fido = new DOG;
:  
: 
: I don't mind adjectives.  But full declarative sentences *shudder*

Oh, get ahold of yourself.  Nobody's proposing that we parse English.
As with all the other proposals, it's basically just a list of words.
You can deal with that... :-)

We can certainly outlaw any words that don't correspond to something
like a package name, or whatever.

And I still think is is prettier than :, if we want a mandatory
delimiter.  But I'm sure I can think up lots of arguments for : too.

I hope I'm not getting so famous that I can't think out load anymore.

Larry

- End forwarded message -
-- 
Contrariwise, continued Tweedledee, if it was so, it might be, and
if it were so, it would be; but as it isn't, it ain't.  That's logic!
-- Lewis Carroll, Through the Looking Glass



Re: Subroutine attributes, from a long time ago

2001-05-07 Thread John Porter

 [EMAIL PROTECTED] writes:
 :
 : why should a reader expect that a declarative description
 : of foo would be followed by the body of foo?

Isn't the functional definition of a sub
just another one of its attributes, anyway?

-- 
John Porter




Re: Subroutine attributes, from a long time ago

2001-05-07 Thread Simon Cozens

On Mon, May 07, 2001 at 10:07:50AM -0400, John Porter wrote:
 Isn't the functional definition of a sub
 just another one of its attributes, anyway?

Oh my. Form 1, Content 0.

-- 
An ASCII character walks into a bar and orders a double.  Having a bad
day? asks the barman.  Yeah, I have a parity error, replies the ASCII
character.  The barman says, Yeah, I thought you looked a bit off. 
-- from Skud