Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^5: Overcoming addiction to Lisp

by Anonymous Monk
on Jun 16, 2005 at 22:01 UTC ( #467468=note: print w/replies, xml ) Need Help??


in reply to Re^4: Overcoming addiction to Lisp
in thread Overcoming addiction to Lisp

All three (in different ways) aim to provide a syntax for concisely expressing something that otherwise could only be expressed via some (rather convoluted) coding patterns. That is, they provide syntactic abstractions (which is what macros are really all about.) But you'll get a far better explanation from the chapters I pointed to than I'll be able to type her in this browser window. -Peter

Replies are listed 'Best First'.
Re^6: Overcoming addiction to Lisp
by Anonymous Monk on Jun 16, 2005 at 22:15 UTC
    I typed in MP3, ID3 over at CPAN, and it came up with a module who's core seems to be about 150 lines. And the real meat seems to be...
    (undef, @{$self->{tag}}{qw/title artist album year comment genre_num +/}) = unpack('a3a30a30a30a4a30C1', $buffer);
      Uh, that's parsing ID3v1 which is an intentionally brain-dead-simple formt. I'm pretty certain parsing ID3v2 is not going to boil down to a single unpack call. (Among other things, in ID3v2, you need to read and decode various lengths and tags in order to know how to interpret the bytes you read next.) Also, note that the Parsing Binary Data chapter provides a way to write parsers for pretty much any binary format *and* allows you to express them in a way that is often just a transliteration of the format's spec. For instance, I originally wrote the library while writing a parser for Java .class files. For the book I wrote the ID3v2 parser in about as much time as it took me to understand the ID3v2 spec. -Peter

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2019-03-23 14:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How do you Carpe diem?





    Results (114 votes). Check out past polls.

    Notices?