develooper Front page | perl.perl6.announce.rfc | Postings from September 2000

RFC 342 (v1) Pascal-like "with"

From:
Perl6 RFC Librarian
Date:
September 28, 2000 20:35
Subject:
RFC 342 (v1) Pascal-like "with"
Message ID:
20000929033217.756.qmail@tmtowtdi.perl.org
This and other RFCs are available on the web at
  http://dev.perl.org/rfc/

=head1 TITLE

Pascal-like "with"

=head1 VERSION

  Maintainer: David Nicol <perl6rfc@davidnicol.com>
  Date: 28 Sep 2000
  Mailing List: perl6-language@perl.org
  Number: 342
  Version: 1
  Status: Developing

=head1 ABSTRACT

We adopt Pascal's very useful C<with> syntax

=head1 DESCRIPTION

        %record = loadrecord($studentID);
        with %record {
		open SPAM, $PreferredSpam;
                print <<SPAM;
        Dear $Name:
                Your tuition is now due.  Please send in a payment
        of at least $Minumum.           

        SPAM
	};

All existing keys of C<%record> hide similarly named variables,
if any, within the C<with> block.

These things can nest.

=head1 IMPLEMENTATION

within a C<with> block, unqualified variable names
must be checked against the C<with> name space before
being instantiated.

In concert with named packed structure types serious
optimizations could be achieved.

=head1 REFERENCES

"Learning Pascal" textbook, CS101, 1985




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