[perldocjp-cvs 1505] CVS update: docs/articles/qntm.org/files/perl

Back to archive index

ktats****@users***** ktats****@users*****
2012年 8月 5日 (日) 18:49:23 JST


Index: docs/articles/qntm.org/files/perl/perl.html
diff -u docs/articles/qntm.org/files/perl/perl.html:1.2 docs/articles/qntm.org/files/perl/perl.html:1.3
--- docs/articles/qntm.org/files/perl/perl.html:1.2	Sun Aug  5 13:09:34 2012
+++ docs/articles/qntm.org/files/perl/perl.html	Sun Aug  5 18:49:22 2012
@@ -198,9 +198,9 @@
 	<li>string <tt>"0"</tt>.</li>
 </ul>
 
-<p>The Perl documentation <em>repeatedly</em> claims that functions return "true" or "false" values in certain situations. In practice, when a function is claimed to return "true" it usually returns <tt>1</tt>, and when it is claimed to return false it usually returns the empty string, <tt>""</tt>.</p>
+<p class=original>The Perl documentation <em>repeatedly</em> claims that functions return "true" or "false" values in certain situations. In practice, when a function is claimed to return "true" it usually returns <tt>1</tt>, and when it is claimed to return false it usually returns the empty string, <tt>""</tt>.</p>
 
-<p class=original>Perlのドキュメントでは、<em>繰り返し</em>、特定の状況で"真"か"偽"の値を関数が返すように主張しています。実際には、
+<p>Perlのドキュメントでは、<em>繰り返し</em>、特定の状況で"真"か"偽"の値を関数が返すように主張しています。実際には、
 関数が真を返すように主張しているときは、普通<tt>1</tt>を返します。また、関数が偽を返すように主張しているなら、普通は空文字<tt>""</tt>を返します。</p>
 
 <h3 class=original>Array variables</h3>
@@ -1175,8 +1175,10 @@
 
 <h2 class=original>Built-in functions</h2>
 <h2>組込関数</h2>
-<p>By now you have seen at least a dozen built-in functions: <tt>print</tt>, <tt>sort</tt>, <tt>map</tt>, <tt>grep</tt>, <tt>each</tt>, <tt>keys</tt>, <tt>scalar</tt> and so on. Built-in functions are one of Perl's greatest strengths. They</p>
-<ul>
+<p class="original">By now you have seen at least a dozen built-in functions: <tt>print</tt>, <tt>sort</tt>, <tt>map</tt>, <tt>grep</tt>, <tt>each</tt>, <tt>keys</tt>, <tt>scalar</tt> and so on. Built-in functions are one of Perl's greatest strengths. They</p>
+<p>今までで、少なくともよくある組込関数が出てきました: <tt>print</tt>, <tt>sort</tt>, <tt>map</tt>, <tt>grep</tt>, <tt>each</tt>, <tt>keys</tt>, <tt>scalar</tt> など。 組込関数はPerlの最も偉大な強みのひとつです。それらは、</p>
+
+<ul class="original">
 	<li>are numerous</li>
 	<li>are very useful</li>
 	<li>are extensively documented (in "perlfunc")</li>
@@ -1188,13 +1190,33 @@
 	<li>sometimes will fill in their own arguments if too few are supplied</li>
 	<li>generally don't require brackets around their arguments except in ambiguous circumstances</li>
 </ul>
-<p>The best advice regarding built-in functions is to know that they exist, so that you can <strong>use them</strong>. If you are carrying out a task which feels like it's low-level and common enough that it's been done many times before, the chances are that it has.</p>
+<ul>
+	<li>たくさんある</li>
+	<li>とても便利</li>
+	<li>広くドキュント化されている("perlfunc"に)</li>
+	<li>シンタックスで大きく異なるので、ドキュメントを見ること</li>
+	<li>引数として正規表現を受け付けるものもある</li>
+	<li>引数として完全なコードブロックを受け付けるものもある</li>
+	<li>引数の間にコンマが不要なものもある</li>
+	<li>コンマで区切られた任意の数を取るものもあれば、そうでないものもある</li>
+	<li>引数が少なすぎる場合に、自分自身で引数を埋めるものもある</li>
+	<li>曖昧な状況でなければ、一般的に引数のまわりに括弧は不要</li>
+</ul>
+<p class=original>The best advice regarding built-in functions is to know that they exist, so that you can <strong>use them</strong>. If you are carrying out a task which feels like it's low-level and common enough that it's been done many times before, the chances are that it has.</p>
+<p>組込関数が存在していることを知ることに館する最も良いアドバイスは、<strong>使ってみる</strong>ことです。低レベルで以前に何度も行っている十分に共通だと感じるタスクを実行しているなら、そのチャンスです。</p>
+
+<h2 class=original>User-defined subroutines</h2>
+<h2>ユーザー定義のサブルーチン</h2>
+
+<p class=original>Subroutines are declared using the <tt>sub</tt> keyword. In contrast with built-in functions, user-defined subroutines always accept the same input: a list of scalars. That list may of course have a single element, or be empty. A single scalar is taken as a list with a single element. A hash with <var>N</var> elements is taken as a list with 2<var>N</var> elements.</p>
+
+<p>サブルーチンは<tt>sub</tt> キーワードを使って宣言されます。組込関数と対照的に、ユーザー定義のサブルーチンは常に同じ入力を受け付けます: スカラのリストです。そのリストは、もちろん、ひとつの要素か、空の場合もあります。ひとつのスカラは一つの要素のリストです。<var>N</var>要素のハッシュは2<var>N</var>要素のリストです。</p>
 
-<h2>User-defined subroutines</h2>
+<p class=original>Although the brackets are optional, subroutines should always be invoked using brackets, even when called with no arguments. This makes it clear that a subroutine call is happening.</p>
+<p>括弧はオプションですが、サブルーチンは、引数がひとつも無くても、常に括弧付きで使うべきです。こうしておけば、サブルーチンが呼ばれたことが、明確になります。</p>
 
-<p>Subroutines are declared using the <tt>sub</tt> keyword. In contrast with built-in functions, user-defined subroutines always accept the same input: a list of scalars. That list may of course have a single element, or be empty. A single scalar is taken as a list with a single element. A hash with <var>N</var> elements is taken as a list with 2<var>N</var> elements.</p>
-<p>Although the brackets are optional, subroutines should always be invoked using brackets, even when called with no arguments. This makes it clear that a subroutine call is happening.</p>
-<p>Once you're inside a subroutine, the arguments are available using the built-in array variable <tt>@_</tt>. Examples follow.</p>
+<p class=original>Once you're inside a subroutine, the arguments are available using the built-in array variable <tt>@_</tt>. Examples follow.</p>
+<p>サブルーチンの中では、組込の配列変数<tt>@_</tt>が使えます。例は以下に続きます。</p>
 
 <h3>Unpacking arguments</h3>
 <p>There's More Than One Way To unpack these arguments, but some are superior to others.</p>



perldocjp-cvs メーリングリストの案内
Back to archive index