develooper Front page | perl.perl6.language | Postings from August 2000

RE: RFC 176 (v1) subroutine / generic entity documentation

Thread Previous
From:
Jerrad Pierce
Date:
August 30, 2000 07:03
Subject:
RE: RFC 176 (v1) subroutine / generic entity documentation
Message ID:
200008301403.KAA25694@cab-calloway.mit.edu
Wohoo! REBOL-isous
> sub foo : doc( <<EOS )
>   Function:  Foo
>   In:    scalar - int - foo identifier
>   Out:    array - decomposed foo
>   Effects: Queries Foo DB
>   Exceptions: DBI, "bad foo id"
> EOS
> {
And the liste alternatives really seem rather ugly though

How about

sub foo ($$,DOC) {
}

Since; currently; , is not used in proto-typing...
Where DOC is any valid string sysntax, heredoc, a scalar, q(), even a function
call. Though at first glance you might read that $, as $OFS

Or, given named parameters you might even want something like:

sub foo (
	"Output"	= * :'!! Opens in clobber mode.',
	"Input"		= * :'Must be sorted',
	"The answer"	= $ :'How many roads must a man walk?';
	"Seed"		=\@ :q(I should have known what fruit would spring from such a seed. --Lord Byron);;
	"General function info") {
}

--
#!/usr/bin/perl -nl
BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;});
$_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";&{$F[0]};sub t{*t=sub{};
return if rand()<.5;$_="Vg'f abg lbhe ghea lrg, abj tb.";&{$F[0]};$_=0;}
sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}&v;}{$_++;$_--;$_||=4;
if($_>>2||($_<<2>12)){$_="Vainyvq ragel";&{$F[0]};last;}&t;$0-=$_;$_="Lbh jva";
die(&{$F[0]}) if !($0-1);$0-=$0%2?$0>2?2:1:$0<=5?$0>2?3:1:rand>.5?1:3;
$_="V jva";die(&{$F[0]}) if !($0-1>1);}&v __END__ http://pthbb.org/
MOTD on Boomtime, the 23rd of Bureaucracy, in the YOLD 3166:

Those students who have become one with the universe will be allowed to go on and become two with the universe.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About