develooper Front page | perl.perl6.language | Postings from March 2005

Re: A possible solution for s?pintf

Thread Previous | Thread Next
From:
Dave Whipp
Date:
March 12, 2005 17:12
Subject:
Re: A possible solution for s?pintf
Message ID:
20050313011230.4634.qmail@lists.develooper.com
Larry Wall wrote:
> I don't see that this buys us anything over just shortening "sprintf"
> to something shorter, like:
>
>    print as '%03d %15s', $foo, $bar;
>
> And your argument list falls out naturally from making "as" a listop.
> Plus it naturally lets you say other "as-ly" things:
>
>    print as MyBigInt, $foo, $bar;

This seems to have some overlap with the "form" listop in E7. Do we need 
both, or will we make c<Form> a possible 1st arg to C<<as>. Eg, 
(modified from the first E7 example):

     sub myster_rite {
         our ($name, $age, $ID, $comments);
         print as Form :interleave <<'.'
              ===================================
             | NAME     |    AGE     | ID NUMBER |
             |----------+------------+-----------|
             | {<<<<<<} | {||||||||} | {>>>>>>>} |
             |===================================|
             | COMMENTS                          |
             |-----------------------------------|
             | {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[} |
              ===================================
             .
               $name,     $age,        $ID,
               $comments;
     }

Thread Previous | Thread Next


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