November 29, 2008 -- "I will call it 'the graphophone'!"

masak on 2008-11-29T22:25:10

131 years ago today, Thomas Edison demonstrated for the first time a device he called a "phonograph", which plays back recorded sound. Wikipedia:

Edison's early phonographs recorded onto a tinfoil sheet phonograph cylinder using an up-down ("hill-and-dale") motion of the stylus. The tinfoil sheet was wrapped around a grooved cylinder, and the sound was recorded as indentations into the foil. Edison's early patents show that he also considered the idea that sound could be recorded as a spiral onto a disc, but Edison concentrated his efforts on cylinders, since the groove on the outside of a rotating cylinder provides a constant velocity to the stylus in the groove, which Edison considered more "scientifically correct". Edison's patent specified that the audio recording be embossed, and it was not until 1886 that vertically modulated engraved recordings using wax coated cylinders were patented by Chichester Bell and Charles Sumner Tainter. They named their version the Graphophone. Emile Berliner patented his Gramophone in 1887.

Dang, I kinda liked the sound of "graphophone". 哈哈

Today, in order to reduce some of the repetitiveness of the MediaWiki markup parser test suite (set input, set expected output, calculate actual output, test, rinse, repeat), I created the module Test::InputOutput, which resembles CPAN's Test::Base a bit, minus the syntactic relief. Some of the MediaWiki tests now look like this instead. Typical example of separating the algorithm from the specifics.

Since that wasn't what I set out to do today, I'm going to stop here, and do that instead. I want to continue passing tests concerning italic and bold.

Also, ihrd++ merged his dispatch branch today into master, so I'll review that merge.

In short, if you haven't downloaded November yet, you should. If nothing else, there's a lot of working Perl 6 code to look at. It's not even hard: look, a link! The kind folks over at github even provide a zipball and a tarball for those who don't have git yet. That's what I call service.

Enjoy!


good plan

ihrd on 2008-11-30T03:34:03

You test looks good!
And I really like that line:

plan +@tests;

Simple, obvious! :)

Re:good plan

masak on 2008-11-30T14:22:23

You test looks good! And I really like that line:

plan +@tests;

Simple, obvious! :)

Thank you. :) I wish I could take more credit for it, though. It's mostly stolen from Test::Base, which does this:

plan tests => 1 * blocks;

Perhaps having seen it before made me want to re-invent it in Perl 6.

(Actually, it could be even easier, if I had put the plan call inside the test method in the Test::InputOutput module. That way, the module user wouldn't have had to call plan at all. But doing that felt like a breach of freedom on the part of the module user: what if she wanted to plan more tests than those sent to the test method? I was going to write about that in the post, but I decided to write code instead.)