Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Rosetta code: Split an array into chunks

by eyepopslikeamosquito (Archbishop)
on Sep 26, 2010 at 00:26 UTC ( [id://862029]=note: print w/replies, xml ) Need Help??


in reply to Re: Rosetta code: Split an array into chunks
in thread Rosetta code: Split an array into chunks

Yes, I do admire this simple and clear code.

Choosing good names is an art and in terms of linguistic craft and agonizing over choosing good names, I claim that TimToady has no equal. :) As a former pacman player, I appreciate the (evocative) munch more than List::MoreUtils hard-to-pronounce natatime.

With functional-style languages, you need a lot of names, so choosing good and consistent names is crucial. Certainly, Haskell has a vast number of functions in its core library; related Haskell names here appear to be take, drop and splitAt from Data.List; more specific to the problem at hand, though not in core, is hackage Data.List.Split's splitEvery aka chunk. Does Perl 6 have equivalents to Haskell's take, drop, splitAt, splitEvery?

While salivating over munch, I hungrily searched for its documentation. Googling for "Perl 6 munch" left me unsatisfied, turning up only the Edvard Munch Museum tourist attraction in Oslo, among various IRC logs and blog entries, but no hits from the official Perl 6 docs. And I couldn't find it in S32-setting-library-Containers ... though I did find vaguely related Perl 6 names there, namely: shift, pop, splice, zip. Does anyone know where munch is officially documented?

Update: I just checked an online dictionary and it appears that munch and chomp mean almost the same thing:

chomp - To chew or bite on noisily
munch - To chew or eat (food) audibly or with pleasure
A mouthwatering challenge is to explain to a Perl 6 newbie how to remember which one does what. :)

Replies are listed 'Best First'.
Re^3: Rosetta code: Split an array into chunks (.munch docs)
by tye (Sage) on Sep 26, 2010 at 04:20 UTC

    Hmm... If you let me google that for you, "perl 6" munch, I find Perl 6 documentation on the first page of hits and again on the second page. Unfortunately, it looks like both of those mention/use .munch rather than documenting it.

    But it also found http://irclog.perlgeek.de/perl6/2010-06-04 where TimToady discusses .munch. #i_2403514 appears to be where .munch was invented... less than 4 months ago.

    - tye        

      Thanks. Heh, your response to my node now comes up as number one for my "perl 6" munch google search. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://862029]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-29 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found