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 Nial

(transformers,pointfree style,arrays)

Date:03/16/08
Author:rahul
URL:http://code.google.com/p/v-language/
Comments:1
Info:n/a
Score: (4.33 in 3 votes)
% A program in a languae with the pedigree of APL is not worth
% its bits if it does not make use of its arrays.
% surprisingly (or not) most of recursive functions can be transformed
% into a form using a stack of pre-computed arguments.
% this code transforms the initial array (created by count XXX)
% into verses. Along the way it makes use of transformers and
% demonstrates point free programming.

line is fork [
  0=, 'No more bottles of beer' first,
  1=, 'One bottle of beer' first, 
  link [string,' bottles of beer' first]
]

verse is link [
  line, ' on the wall, ' first,line,
  '. Take it down and pass it around, ' first,
  line (-1+),'on the wall. ' first
]

bottles is iterate (write verse) reverse count

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
1Akira Kida04/20/050

Comments

>>  rahul said on 03/18/08 10:34:15

rahul There was a slight mixup with the submission, the Nial site is <a href="http://www.nial.com/">http://www.nial.com/</a>

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: