develooper Front page | perl.perl5.porters | Postings from August 1999

[PATCH 5.005_61 CORE] sub : attrlist

Thread Next
From:
spider-perl
Date:
August 29, 1999 00:03
Subject:
[PATCH 5.005_61 CORE] sub : attrlist
Message ID:
199908290702.DAA32191@Orb.Nashua.NH.US
OK, I've done a bunch of testing with this stuff, and seems to be
ready for prime time.  The gzip'ed patch file is 80KB in size, so
I'm only including a pointer to it.  For those who have suitably
MIME-aware mail tools, you'll be offered a chance to ftp it.
Otherwise, it's at
http://www.ultranet.com/~spiderb/perl/sub-attrs-561.patch.gz
(which is
<URL:http://www.ultranet.com/~spiderb/perl/sub-attrs-561.patch.gz>
for those who need that format.)

Here's a precis of its contents:

It implements C<sub : attrlist> as previously discussed.  It also
sort-of implements C<my $spot : attrlist>, but that part's
clearly marked as experimental, subject to change or revocation
without notice, etc.  The current extensibility mechanism is
similarly marked as being experimental.  The only part which
isn't experimental here is the built-in sub attributes of
'locked' and 'method' (and 'lvalue', if Ilya's patch is accepted,
but the docs don't mention that one).

This also reserves (with a "not yet implemented" croak) the
C<my sub> syntax.

A couple of random bug fixes snuck in.

  * "perl -we '$a=0b9'" would warn about the 9 twice.

  * Sometimes, with varying line sizes in a file which "just happened" to
    tickle the condition, recognition of "print HANDLE\n'text'" would fail.

  * Subroutine declarations (or definitions) with both a name and a
    prototype required that they be on the same source line, but only when
    reading from a file (or source filter with a non-NULL PL_rsfp).

  * Symbols named "ISA" and "EXPORT<anything>" got GvMULTI_on(), but
    "VERSION" didn't.  (This may remove most modules' need for C<use vars>.)

Relevant pod updates were done, mostly to perlsub (a new section, and an
expanded SYNOPSIS, plus a couple of typo fixups), perldiag, and perldelta.

Existing "true source" files affected:

	lib/AutoSplit.pm
	MANIFEST
	Makefile.SH
	embed.pl
	gv.c
	lib/SelfLoader.pm
	op.c
	perl.c
	perl.h
	perly.fixer
	perly.y
	pod/perldelta.pod
	pod/perldiag.pod
	pod/perlfunc.pod
	pod/perlmodlib.pod
	pod/perlsub.pod
	toke.c

Semi-derived files affected:

	perly.c
	perly.h
	perly_c.diff
	vms/perly_c.vms
	vms/perly_h.vms

    This changes how much perly_c.diff is expected to do for you.
    This makes it (+perly.fixer) more likely to work after you've
    had to modify perly.y.  However, these perly.{c,h} files (and
    the VMS variants) have had the #line directives fixed up by hand,
    along with the usual tweaks to ifdef the tokens from perly.h so
    that they don't pollute the CPP namespace for extensions.

Files implicitly affected (but not in the patch file itself):

    [perl embed.pl]
	embed.h
	embedvar.h
	global.sym
	objXSUB.h
	perlapi.c
	perlapi.h
	proto.h
    [sh ./Configure -S ; make depend ]
	Makefile
	makefile

New files:

	lib/attributes.pm
	t/lib/attrs.t	[chmod +x]
	t/op/attrs.t	[chmod +x]
	xsutils.c

Given that (1) Larry asked for a way to get rid of [the need for]
"use attrs", and (2) doing exactly that is the only thing here
not explictly marked as experimental, I'd really like to see this
go in for 5.6.  (That doesn't mean that people can't argue with
parts of it, of course.  I'm only pleading for getting it
accepted as a feature which makes it into 5.6.)

I'm sure the docs could use some work.  I'm not a tech. writer,
and I usually don't even try to play one on the 'net.  I did make
an honest try at filling in required documentation--but I suspect
that I'm the only one who can read what I wrote and understand
it.  [I'd love to be wrong on that, but past history is against me.]

/spider


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About