Talk:Old lady swallowed a fly

From Rosetta Code
Revision as of 04:19, 31 August 2011 by rosettacode>Paddy3118 (→‎“Where's my cow?”: External progs.)

“Where's my cow?”

“I knew an old lady who swallowed a cow. I don't know how she swallowed the cow.” –Donal Fellows 23:34, 15 August 2011 (UTC)

Here--Dgamey 00:03, 16 August 2011 (UTC)
Go ahead and implement a correct version, and mark my PHP example incorrect. --Michael Mol 00:52, 16 August 2011 (UTC)
Multiple versions wp:There_Was_an_Old_Lady_Who_Swallowed_a_Fly and goats and donkeys too it seems. There are also alternate choruses. --Dgamey 12:12, 17 August 2011 (UTC)
Someone really should make a decision on which version to use before there are more solutions, or Paddy will have a heartattack later when he sees that every program produces a different output. Maybe take a vote or something? --Ledrug 18:50, 17 August 2011 (UTC)
I vote for the primary version described on the wikipedia page. --Rdm 19:09, 17 August 2011 (UTC)
Something like this? Seems to be too many animals. (feel free to correct or delete in case of copyright lawyers)
I was thinking of something slightly different: --Rdm 13:18, 18 August 2011 (UTC)
I know an old lady who swallowed a fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

I know an old lady who swallowed a spider.
That wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

I know an old lady who swallowed a Bird.
Quite absurd. To swallow a Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

I know an old lady who swallowed a Cat.
Fancy that. To swallow a Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

I know an old lady who swallowed a Dog.
What a hog. To swallow a Dog.
She swallowed the Dog to catch the Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

I know an old lady who swallowed a Pig.
Her mouth was so big. To swallow a Pig.
She swallowed the Pig to catch the Dog.
She swallowed the Dog to catch the Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

I know an old lady who swallowed a Goat.
She just opened her throat. To swallow a Goat.
She swallowed the Goat to catch the Pig.
She swallowed the Pig to catch the Dog.
She swallowed the Dog to catch the Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

I know an old lady who swallowed a Cow.
I don't know how. To swallow a Cow.
She swallowed the Cow to catch the Goat.
She swallowed the Goat to catch the Pig.
She swallowed the Pig to catch the Dog.
She swallowed the Dog to catch the Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

I know an old lady who swallowed a Donkey.
It was rather wonky. To swallow a Donkey.
She swallowed the Donkey to catch the Cow.
She swallowed the Cow to catch the Goat.
She swallowed the Goat to catch the Pig.
She swallowed the Pig to catch the Dog.
She swallowed the Dog to catch the Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

I know an old lady who swallowed a Horse.
She's dead, of course!

(comment remaining from an older version:)

Works for me. --Michael Mol 12:54, 18 August 2011 (UTC)
I wonder if the Tcl version is too much of a cheat. I just took the above text and compressed and encoded it, then wrapped a trivial decoder around it. Still, a fun little solution that obeys the challenge in a different way. –Donal Fellows 19:12, 20 August 2011 (UTC)
Compression is the most obvious way to utilize repeatitions of strings, so it's fine in my book (C code does compression, only with a crude home made compression scheme because it was more fun to me). --Ledrug 23:41, 20 August 2011 (UTC)
Really, only the (Un)Icon, J, Forth and PHP examples really approach it from the direction I had in mind (specifically using the verse and repetitive semantic structure). That said, the C, D and Tcl examples are wonderful examples of compression, and I think they make for interesting directions, too. My intent was for this example to be in the spirit of 99 Bottles of Beer, with a variety of possible approaches taken. --Michael Mol 01:43, 21 August 2011 (UTC)
But surely decompression by another external program leaves too little for the task to be solved by a particular language (as was the case in Perl - now changed)? --Paddy3118 04:19, 31 August 2011 (UTC)

Copyright!

According to this and this and this the song is not that old and has an author. I note that none of those quote the lyrics so I think we may be on shaky copyright grounds. --Paddy3118 06:10, 16 August 2011 (UTC)

If it was registered in 1951, it may have fallen out of copyright. All works published in the US prior to a date (somewhere in the 1930s?) will have fallen out of copyright, but some afterward will have as well, depending on whether they bothered to renew their registrations. I'm not an expert on the subject, though. Trying to identify how to look up registration history on a work. Otherwise, yeah, that stands to be a major problem. --Michael Mol 13:25, 16 August 2011 (UTC)
We should also note that the recording industry is known to a bunch of litigious <insert your own appropriate word here>. Which is another reason to err on the side of caution. --Paddy3118 15:47, 16 August 2011 (UTC)
Believe me, I'm unlikely to forget. I've lived with a paranoia about the RIAA for over a decade. I've removed the program results, and the code itself is incorrect, though it probably qualifies as a derivative work. I wonder if the current LOC exemptions set for the DMCA includes this form of 'educational use.' That said, I don't think they're going to care terribly much. I still want to look into when/if copyright was registered (the song was produced before things were automagically copyrighted without registration). If I can show that the copyright fell out of registration, or that a current LOC exemption would include RC, then I'd be comfortable moving forward with the task. If I get a DMCA notice, I'll take it down and replace it with an explanation of all the facts and a link to [chillingeffects.org chillingeffects.org]. I won't fight something in a way I can't afford to fight it.--Michael Mol 16:10, 16 August 2011 (UTC)
Actually, most implementations in code probably constitute fair use. The code is no more a derivative work of the song than a publication that describes the characters in the harry potter novels would be a derivative work of the novels. Any argument that code being asked for here is derivative of the song, for copyright purposes, would probably be an argument that the song is not a creative work. --Rdm 17:34, 17 August 2011 (UTC)