Re: Recommended Perl 6 best practices?

2008-12-21 Thread Larry Wall
On Sat, Dec 20, 2008 at 11:45:38PM -0500, Brandon S. Allbery KF8NH wrote:
 On 2008 Dec 20, at 13:39, Carl Mäsak wrote:
 Maybe this counts as a best practice, or maybe it's more of a
 pattern. In a recent piece of code, I found a way to exploit code
 blocks to act like return statements with side effects. The
 resulting code became very clean, so I decided to blog about the way
 it works.


 Hm, couldn't you also do that with a sub that explicitly throws a  
 return exception to the caller Routine?

Which is most easily expressed as:

somesub.leave()

or

caller.leave()

if you want it anonymous.

But 'return' is shorter than that, and lambdas are shorter than
routine definitions, so the only reason for not using return
is if you want to define your helper block outside of the scope
in which return would work.

Larry


Re: 6PAN Spec question

2008-12-21 Thread Timothy S. Nelson

On Sat, 20 Dec 2008, Mark Overmeer wrote:


* Timothy S. Nelson (wayl...@wayland.id.au) [081220 03:45]:

Btw, looks like I was wrong about the terminology of
CPAN6/6PAN/whatever.  See link below for details (the new Terminology
section).

http://svn.pugscode.org/pugs/docs/Perl6/Spec/S22-package-format.pod


	Just as an explanatory note, I used ???A and ???B as placeholders 
until someone comes up with a name for them.  I don't want to name them; I 
want to leave the naming of them up to the people who are actually going to 
implement them.



I do not understand the relevance of ???A: just abstract away the
actual distribution mechanism.  FTP or CD is also not mentioned
as possible transporters, so why is that for CPAN6 important?


	I'm not sure I understand your point here; either I misunderstand what 
you're getting at, or you've misunderstood what I'm getting at.  I'll expand 
on what I mean by ???A in hopes that this will help clarify things.


The current (Perl5) CPAN is, as far as I know, includes:
-   The custom software that runs cpan.org
-   The hardware/OS that runs it
-   The code that is stored there (ie. modules and stuff)

	I'm assuming that your CPAN6 software is going to replace the software 
that runs CPAN, but I'm assuming that the replacement for the other two items 
listed above is going to be a separate entry, that I've designated with the 
placeholder ???A until such time as someone sets up a website and installs 
your CPAN6 software, and offers to let people upload stuff to it.



For ???B.  In the current set-up, you use CPAN.pm to download, and then
install.  The 'cpan' script is a wrapper around CPAN.pm.  CPAN.pm starts
the install tool.  A more convient structure would be to have an user
application (maybe the same 'cpan' script), which calls some download
backend to retreive the distribution and then calls the right install
tool per distribution.  I would say: ???B is cpan-NG


	That would be one way of labelling it.  I prefer to leave that 
labelling up to the people who will actually be writing the software.  For all 
I know, they might prefer to begin with a direct port of CPANPLUS, and work 
from there.


HTH,


-
| Name: Tim Nelson | Because the Creator is,|
| E-mail: wayl...@wayland.id.au| I am   |
-

BEGIN GEEK CODE BLOCK
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- 
PE(+) Y+++ PGP-+++ R(+) !tv b++ DI D G+ e++ h! y-

-END GEEK CODE BLOCK-