Permalink
Browse files

Manually added conflicted changes from jmazon.

  • Loading branch information...
1 parent 6d203ee commit 829111b56786e0d1d6714ab3fcd1e4800d946bb8 @chromatic committed Jul 23, 2010
Showing with 41 additions and 9 deletions.
  1. +3 −0 CREDITS
  2. +37 −8 sections/prototypes.pod
  3. +1 −1 sections/tie.pod
View
@@ -110,3 +110,6 @@ E: xsawyerx@cpan.org
N: Paulo Custodio
E: pscust@cpan.org
+
+N: Jean-Baptiste Mazon
+E: ?
View
@@ -44,20 +44,49 @@ array as a single unit so that C<push> can operate on the array in place.
X<prototype>
X<keywords; prototype>
-C<prototype> takes the name of a function and returns a string representing its
-prototype. If you cannot emulate that function (if it's a core keyword),
-C<prototype> will return C<undef>. To see the prototype of a built-in keyword,
-use the C<CORE::> form:
+The builtin C<prototype> takes the name of a function and returns a string
+representing its prototype.  To see the prototype of a built-in keyword,
+use the C<CORE::> form:
+=begin programlisting
-=begin programlisting
+    $ B<perl -E "say prototype 'CORE::push';">
+    \@@
+    $ B<perl -E "say prototype 'CORE::keys';">
+    \%
+    $ B<perl -E "say prototype 'CORE::open';">
+    *;$@
+
+=end programlisting
+
+If you cannot emulate the prototype of a builtin (and some you can't!),
+C<prototype> will return C<undef>:
+
+=begin programlisting
+
+    $ B<perl -E "say prototype 'CORE::system' // 'undef' ">
+    undef
+    # You can't emulate builtin function C<system>'s calling convention.
+
+    $ B<perl -E "say prototype 'CORE::prototype' // 'undef' ">
+    undef
+    # Builtin function C<prototype> has no prototype.
+=end programlisting
+
+Look at C<push> again:
+=begin programlisting
- $ B<perl -E "say prototype 'CORE::push';">
- \@@
+    $ B<perl -E "say prototype 'CORE::push';">
+    \@@
=end programlisting
The C<@> character represents a list. The backslash forces the use of a
-I<reference> to the corresponding argument. Thus C<mypush> might be:
+I<reference> to the corresponding argument. Thus this function takes a
+reference to an array (because you can't take a reference to a list) and a list
+of values. C<mypush> might be:
=begin programlisting
View
@@ -9,7 +9,7 @@ X<tying>
Overloading (L<overloading>) lets you give classes custom behavior for specific
types of coercions and accesses. A similar mechanism exists for making
variables act like built-in types (scalars, arrays, and hashes), but with more
-specific behaviors. This mechanism uses the C<tie> keyword; it is C<tying>.
+specific behaviors. This mechanism uses the C<tie> keyword; it is I<tying>.
The original use of C<tie> was to produce a hash stored on disk, rather than in
memory. This allowed the use of dbm files from Perl, as well as the ability to

0 comments on commit 829111b

Please sign in to comment.