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 dc

Date:05/30/05
Author:Jannis Harder
URL:n/a
Comments:2
Info:http://xaravve.trentu.ca/cgi-bin/superman?1+dc
Score: (2.90 in 10 votes)
Compact:
[100Q]sy[ of beer]so[la[[[No more]P]sg]sc[n]sgdd0=clgx
[ bottle]Pla1!=m]sb[[s]P]sm99sa[lbxloP[ on the wall, ]
PlbxloP[.]P10aP[Take one down and pass it around. ]Pla
1-salbxloP[ on the wall.]P10adPPla0=ylfx]dsfxq

Clean:
[100 Q]sy
[ of beer]so
[
  la
  [[[No more]P]sg]sc
  [n]sg
  dd 0
  =c
  lg x
  [ bottle]P
  la
  1 !=m
]sb
[[s]P]sm
99 sa
[
  lb x
  lo P
  [ on the wall, ]P
  lb x
  lo P
  [.] P
  10a P
  [Take one down and pass it around. ]P
  la 1 - sa
  lb x
  lo P
  [ on the wall.] P
  10a d PP
  la
  0=y
  lf x
] d sf x 
q

Download Source | Write Comment

Alternative Versions

Comments

>>  zamu said on 07/31/05 04:49:29

zamu any idea about desktop calculator being Turing Complete?g

>>  Gnomon said on 09/08/09 22:18:39

Gnomon zamu, dc the *language* is Turing complete; dc the *implementation* generally is not, since the only looping construct is macro recursion, and most dc implementations do not perform any kind of tail call elimination.

A trivial implementation of dc in a language which guarantees tail call elimination, like R5RS Scheme or Lua 5.x, ought to be properly Turing complete.

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: