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

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

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!