ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-language
perl6-language
When can I take given as read?
by Piers Cawley other posts by this author
Jun 16 2005 8:42PM messages near this date
caller with no sub scope | Re: When can I take given as read?
Suppose I have a simple, single argument recursive function:

  sub factorial (Int $n) {
    return 1 if $n == 0;
    return $n * factorial $n;
  }

Can I write that as:

  sub factorial (Int $n:) {
    return 1 when 0;
    return $n * factorial $n;
  }

NB. Yes, I know it's a pathological example.
    
Thread:
Piers Cawley
Larry Wall
Damian Conway
Carl Franks
Juerd
Rod Adams

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved