Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language Joy

Date:07/05/09
Author:inforichland
URL:n/a
Comments:0
Info:http://www.latrobe.edu.au/philosophy/phimvt/joy.html
Score: (3.25 in 4 votes)
LIBRA

	_beerlib == true ;

HIDE
	beer == "of beer " putchars ;
	wall == "on the wall" putchars ;
	take1 == "Take one down and pass it around, " putchars ;
	dup3 == dup dup dup ;
	comma == ", " putchars ;
	period == '. putch ;
	bottles == [dup small] 
		[ [null] [pop "no more bottles " putchars] [put "bottle " putchars] ifte] 
		[put "bottles " putchars] ifte ;
	sing-verse == dup3 bottles beer wall comma 
		bottles beer "\b.\n" putchars
		take1 1 - bottles beer wall period newline newline ;
	sing-verse-0 == "No more bottles of beer on the wall, no more bottles of beer\n" putchars
			"Go to the store and buy some more, " putchars 
			99 bottles pop beer wall period newline ;

IN
	(* n -- *)
	sing-verses == [null]
			[sing-verse-0]
			[sing-verse 1 -] tailrec .

Download Source | Write Comment

Alternative Versions

Comments

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: