Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[svn:perl6-synopsis] r8569 - doc/trunk/design/syn

5 views
Skip to first unread message

autr...@cvs.perl.org

unread,
Apr 5, 2006, 10:08:30 PM4/5/06
to perl6-l...@perl.org
Author: autrijus
Date: Wed Apr 5 19:08:28 2006
New Revision: 8569

Modified:
doc/trunk/design/syn/S02.pod
doc/trunk/design/syn/S05.pod

Log:
* S02/S05: Excise "reference" from them.

Modified: doc/trunk/design/syn/S02.pod
==============================================================================
--- doc/trunk/design/syn/S02.pod (original)
+++ doc/trunk/design/syn/S02.pod Wed Apr 5 19:08:28 2006
@@ -12,9 +12,9 @@

Maintainer: Larry Wall <la...@wall.org>
Date: 10 Aug 2004
- Last Modified: 1 Apr 2006
+ Last Modified: 6 Apr 2006
Number: 2
- Version: 19
+ Version: 20

This document summarizes Apocalypse 2, which covers small-scale
lexical items and typological issues. (These Synopses also contain
@@ -326,13 +326,13 @@

Sigils are now invariant. C<$> always means a scalar variable, C<@>
an array variable, and C<%> a hash variable, even when subscripting.
-Array and hash variable names in scalar context automatically produce
-references.
+Variables such as C<@array> and C<%hash> in scalar context simply
+returns themselves Array and Hash objects.

=item *

-In string contexts container references automatically dereference
-to appropriate (white-space separated) string values. In numeric
+In string contexts, container objects automatically stringify to
+appropriate (white-space separated) string values. In numeric
contexts, the number of elements in the container is returned.
In boolean contexts, a true value is returned if and only if there
are any elements in the container.
@@ -354,7 +354,7 @@

=item *

-Subscripts now consistently dereference the reference produced by
+Subscripts now consistently dereference the container produced by
whatever was to their left. Whitespace is not allowed between a
variable name and its subscript. However, there is a corresponding
B<dot> form of each subscript (C<@foo.[1]> and C<%bar.{'a'}>) which
@@ -380,9 +380,9 @@
There is a need to distinguish list assignment from list binding.
List assignment works exactly as it does in Perl 5, copying the
values. There's a new C<:=> binding operator that lets you bind
-names to array and hash references without copying, just as subroutine
-arguments are bound to formal parameters. See S06 for more about
-parameter binding.
+names to Array and Hash objects without copying, in the same way
+as subroutine arguments are bound to formal parameters. See S06
+for more about parameter binding.

=item *

@@ -442,12 +442,11 @@

=item *

-Unlike in Perl 5, the notation C<&foo> merely creates a reference
-to function "C<foo>" without calling it. Any function reference may
-be dereferenced and called using parens (which may, of course,
-contain arguments). Whitespace is not allowed before the parens,
-but there is a corresponding C<.()> operator, which allows you to
-insert optional whitespace before the dot.
+Unlike in Perl 5, the notation C<&foo> merely returns the C<foo>
+function as a Code object without calling it. You may call any Code
+object parens (which may, of course, contain arguments). Whitespace
+is not allowed before the parens, but there is a corresponding C<.()>
+operator, which allows you to insert optional whitespace before the dot.

=item *

@@ -457,7 +456,7 @@

&foo:(Int,Num)

-It still just returns a function reference. A call may also be partially
+It still just returns a C<Code> object. A call may also be partially
applied by using an argument list literal as a postfix operator:

&foo\(1,2,3,:mice<blind>)
@@ -496,12 +495,11 @@

=item *

-A hash reference in numeric context returns the number of pairs
-contained in the hash. A hash reference in a boolean context returns
-true if there are any pairs in the hash. In either case, any intrinsic
-iterator would be reset. (If hashes do carry an intrinsic iterator
-(as they do in Perl 5), there will be a C<.reset> method on the hash
-object to reset the iterator explicitly.)
+In numeric context, a Hash object returns the number of pairs contained
+in the hash. Hash in a boolean context returns true if there are any pairs
+in the hash. In either case, any intrinsic iterator would be reset. (If
+hashes do carry an intrinsic iterator (as they do in Perl 5), there will
+be a C<.reset> method on the hash object to reset the iterator explicitly.)

=item *

@@ -647,7 +645,7 @@

=item *

-The current lexical symbol table may now be referenced through the
+The current lexical symbol table is now accessible through the
pseudo-package C<MY>. The current package symbol table is visible as
pseudo-package C<OUR>. The C<OUTER> name refers to the C<MY> symbol table
immediately surrounding the current C<MY>, and C<OUTER::OUTER> is the one
@@ -1400,12 +1398,12 @@
numeric num Num +
string str Str ~

-There are also various reference contexts that require particular kinds of
-container references.
+There are also various container contexts that require particular kinds of
+containers.

=item *

-Unlike in Perl 5, references are no longer always considered true.
+Unlike in Perl 5, objects are no longer always considered true.
It depends on the state of their C<.bit> property. Classes get to decide
which of their values are true and which are false. Individual objects
can override the class definition:
@@ -1432,9 +1430,9 @@
There is a "C<list>" operator which imposes a list context on
its arguments even if C<list> itself occurs in a scalar context.
In list context, it flattens lazily. In a scalar context, it returns
-a reference to the resulting list. (So the C<list> operator really
-does exactly the same thing as putting a list in parentheses. But
-it's more readable in some situations.)
+the resulting list as a single C<List> object. (So the C<list> operator
+really does exactly the same thing as putting a list in parentheses.
+But it's more readable in some situations.)

=item *

@@ -1471,9 +1469,11 @@
Signatures on non-multi subs can be checked at compile time, whereas
multi sub and method call signatures can only be checked at run time
(in the absence of special instructions to the optimizer).
+
This is not a problem for arguments that are arrays or hashes,
since they don't have to care about their context, but just return
-a reference in any event, which may or may not be lazily flattened.
+themselves in any event, which may or may not be lazily flattened.
+
However, function calls in the argument list can't know their eventual
context because the method hasn't been dispatched yet, so we don't
know which signature to check against. As in Perl 5, list context
@@ -1520,7 +1520,7 @@
=item *

In contrast to assignment, binding to a hash requires a C<Hash> (or
-C<Pair>) reference. Binding to a "splat" hash requires a list of pairs
+C<Pair>) object. Binding to a "splat" hash requires a list of pairs
or hashes, and stops processing the argument list when it runs out
of pairs or hashes. See S06 for much more about parameter binding.

Modified: doc/trunk/design/syn/S05.pod
==============================================================================
--- doc/trunk/design/syn/S05.pod (original)
+++ doc/trunk/design/syn/S05.pod Wed Apr 5 19:08:28 2006
@@ -13,9 +13,9 @@

Maintainer: Patrick Michaud <pmic...@pobox.com>
Date: 24 Jun 2002
- Last Modified: 3 Apr 2006
+ Last Modified: 6 Apr 2006
Number: 5
- Version: 14
+ Version: 15

This document summarizes Apocalypse 5, which is about the new regex
syntax. We now try to call them "rules" because they haven't been
@@ -1672,7 +1672,7 @@
if m:w/ (keep) <file> | (toss) <file> / {
# Each <file> is in a separate alternation, therefore <file>
# is not repeated in any one scope, hence $<file> is
- # not an array ref...
+ # not an Array object...
$action = $0;
$target = $<file>;
}
@@ -1997,7 +1997,7 @@
/;

# Aliasing to @<names> means $/<names> is always
- # an array reference, so...
+ # an Array object, so...

say @{$/<names>};

@@ -2152,8 +2152,8 @@
=item *

A hash alias causes the correponding hash or array element in the
-current scope's C<Match> object to be assigned a (nested) hash reference
-(rather than an array reference or a single C<Match> object).
+current scope's C<Match> object to be assigned a (nested) Hash object
+(rather than an Array object or a single C<Match> object).

=item *

@@ -2455,7 +2455,7 @@

=item *

-The two sides of each pair may also be array references:
+The two sides of each pair may also be Array objects:

$str.=trans( ['A'..'C'] => ['a'..'c'], <X Y Z> => <x y z> );

Uri Guttman

unread,
Apr 6, 2006, 12:22:46 AM4/6/06
to autr...@cvs.perl.org, perl6-l...@perl.org
>>>>> "a" == autrijus <autr...@cvs.perl.org> writes:

a> Sigils are now invariant. C<$> always means a scalar variable, C<@>
a> an array variable, and C<%> a hash variable, even when subscripting.
a> -Array and hash variable names in scalar context automatically produce
a> -references.
a> +Variables such as C<@array> and C<%hash> in scalar context simply
a> +returns themselves Array and Hash objects.
^as
i think you wanted to say 'as' after themselves. and returns should be
return (yes, english is wacky with plural nouns and verbs).

When in scalar context, aggregate variables such as C<@array>
and C<%hash> simply return themselves as Array and Hash objects
respectively.

a> =item *

a> -Unlike in Perl 5, the notation C<&foo> merely creates a reference
a> -to function "C<foo>" without calling it. Any function reference may
a> -be dereferenced and called using parens (which may, of course,
a> -contain arguments). Whitespace is not allowed before the parens,
a> -but there is a corresponding C<.()> operator, which allows you to
a> -insert optional whitespace before the dot.
a> +Unlike in Perl 5, the notation C<&foo> merely returns the C<foo>
a> +function as a Code object without calling it. You may call any Code
a> +object parens (which may, of course, contain arguments). Whitespace
a> +is not allowed before the parens, but there is a corresponding C<.()>
a> +operator, which allows you to insert optional whitespace before the dot.

Unlike in Perl 5, the notation C<&foo> merely returns the C<foo>

function as a Code object without calling it. You may call any

Code object with parentheses (which may, of course, contain
arguments). Whitespace is not allowed before the open
parenthesis, but there is a corresponding C<.()> operator, which


allows you to insert optional whitespace before the dot.

a> -A hash reference in numeric context returns the number of pairs
a> -contained in the hash. A hash reference in a boolean context returns
a> -true if there are any pairs in the hash. In either case, any intrinsic
a> -iterator would be reset. (If hashes do carry an intrinsic iterator
a> -(as they do in Perl 5), there will be a C<.reset> method on the hash
a> -object to reset the iterator explicitly.)
a> +In numeric context, a Hash object returns the number of pairs contained
a> +in the hash. Hash in a boolean context returns true if there are any pairs
a> +in the hash. In either case, any intrinsic iterator would be reset. (If
a> +hashes do carry an intrinsic iterator (as they do in Perl 5), there will
a> +be a C<.reset> method on the hash object to reset the iterator explicitly.)


In numeric context, a Hash object returns the number of pairs

contained in the hash. A Hash in a boolean context returns true


if there are any pairs in the hash. In either case, any

intrinsic iterator would be reset. (If hashes do carry an
intrinsic iterator (as they do in Perl 5), there will be a


C<.reset> method on the hash object to reset the iterator
explicitly.)

is Hash the same as Hash object? i know %hash is both but is it ok to
change the name in mid paragraph like that??

just the usual minor cleanup of audrey's english. hell, she has to have
SOME flaws! :)

uri

--
Uri Guttman ------ u...@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org

Rutger Vos

unread,
Apr 5, 2006, 10:24:30 PM4/5/06
to perl6-l...@perl.org
Subversion logging messages like the one below seem to be flooding this
list right now. May I ask if that's what this list is for?

Best wishes,

Rutger

autr...@cvs.develooper.com wrote:

--
++++++++++++++++++++++++++++++++++++++++++++++++++++
Rutger Vos, PhD. candidate
Department of Biological Sciences
Simon Fraser University
8888 University Drive
Burnaby, BC, V5A1S6
Phone: 604-291-5625
Fax: 604-291-3496
Personal site: http://www.sfu.ca/~rvosa
FAB* lab: http://www.sfu.ca/~fabstar
Bio::Phylo: http://search.cpan.org/~rvosa/Bio-Phylo/
++++++++++++++++++++++++++++++++++++++++++++++++++++


Jonathan Scott Duff

unread,
Apr 6, 2006, 10:19:15 AM4/6/06
to Rutger Vos, perl6-l...@perl.org
On Wed, Apr 05, 2006 at 07:24:30PM -0700, Rutger Vos wrote:
> Subversion logging messages like the one below seem to be flooding this
> list right now. May I ask if that's what this list is for?

Well, it gets the people interested in the language design first cut at
the changes being made to the design docs. Which is, IMHO, part of what
this list is for. That way the group can fix typoes or if there's some
weird semantic, the group can send a "whoa there!" message. How else are
we to keep abreast of changes in the design docs? Repeated reading of
the website and hoping we notice when things change?

Sending the log + diff gives an easy way to brain-filter the messages
too. I can look at the log and decide if I really care about the minute
changes to twigils enough to read through all of the places where it
makes a difference.

-Scott
--
Jonathan Scott Duff
du...@pobox.com

0 new messages