User:Underscore/Scratchpad: Difference between revisions
Content added Content deleted
Underscore (talk | contribs) No edit summary |
Underscore (talk | contribs) No edit summary |
||
Line 2: | Line 2: | ||
===Features to add once Rakudo implements them=== |
===Features to add once Rakudo implements them=== |
||
<ul> |
<ul> |
||
<li> [[Comments]]: Nested bracketing characters. </li> |
<li> [[Comments#Perl 6|Comments]]: Nested bracketing characters. </li> |
||
<li> [[Creating a Function]]:<ul> |
<li> [[Creating a Function#Perl 6|Creating a Function]]:<ul> |
||
<li>Not quite the same thing (see [http://perlcabal.org/syn/S02.html#Return_types Synopsis 2]): |
<li>Not quite the same thing (see [http://perlcabal.org/syn/S02.html#Return_types Synopsis 2]): |
||
<lang perl6>sub multiply (Int $a, Int $b) as Int { $a * $b }</lang></li> |
<lang perl6>sub multiply (Int $a, Int $b) as Int { $a * $b }</lang></li> |
||
<li> <code>&multiply := [*];</code></li> |
<li> <code>&multiply := [*];</code></li> |
||
<li> <code>&multiply := &infix<*>;</code></li></ul></li> |
<li> <code>&multiply := &infix<*>;</code></li></ul></li> |
||
<li> [[Monty Hall simulation]]:<ul> |
<li> [[Monty Hall simulation#Perl 6|Monty Hall simulation]]:<ul> |
||
<li> <code>:delete</code> adverb.</li> |
<li> <code>:delete</code> adverb.</li> |
||
<li> More trials.</li></ul></li> |
<li> More trials.</li></ul></li> |
||
<li> [[Playing Cards#Perl 6|Playing Cards]]: There really ought to be something like <code>EnumerationType.pick(*)</code> that gives you the values of the enumeration ''in order''. You'd think <code>Two .. Ace</code> would do it, but as of Rakudo release #22, that produces numbers, not Pips. |
|||
<li> [[True/False Values]]: <code>0 but True</code>. </li> |
<li> [[True/False Values#Perl 6|True/False Values]]: <code>0 but True</code>. </li> |
||
</ul> |
</ul> |
Revision as of 14:06, 4 November 2009
Perl 6
Features to add once Rakudo implements them
- Comments: Nested bracketing characters.
- Creating a Function:
- Not quite the same thing (see Synopsis 2): <lang perl6>sub multiply (Int $a, Int $b) as Int { $a * $b }</lang>
-
&multiply := [*];
-
&multiply := &infix<*>;
- Monty Hall simulation:
-
:delete
adverb. - More trials.
-
- Playing Cards: There really ought to be something like
EnumerationType.pick(*)
that gives you the values of the enumeration in order. You'd thinkTwo .. Ace
would do it, but as of Rakudo release #22, that produces numbers, not Pips. - True/False Values:
0 but True
.