23 Jan 2001 sune   » (Apprentice)

Scheme: What better way to spend the time of your lunch-break at work than solving mbp's Scheme-challenge? I can't think of any, so here's my stab:

-- (define (f s)
  (lambda (g)
    (if (equal? s "")
	(let ((t (g (lambda (h) ""))))
	  (if (equal? t "")
	      ""
	      (g (f ""))))
	(string-append
	 (string-head s 1)
	 (g (f (string-tail s 1)))))))
f
-- ((f "Js nte ceeWnae")(f "utAohrShm anbe"))
"Just Another Scheme Wannabee"

Wonder if not there's a nicer way of doing that then-branch?

And, now back to my regularly scheduled work.

Latest blog entries     Older blog entries

New Advogato Features

FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!