5 Oct 2005 parkerc   » (Journeyer)

More Lisp

Still like Lisp, even after 6 days. Wrote my first useable program with it today. I am still discovering it, but I wrote a cool little function:

(defun explode-to-list (expr str &optional &key (s nil))
  (let ((size (search expr str)))
    (if size 
	(explode-to-list expr (subseq str (+ 1 size)) 
		 :s (append s (list (subseq str 0 size))))	
      (append s (list (subseq str 0))))))

It takes a string like (explode "," "foo,bar.bin") and returns the list ("foo" "bar" "bin")

This might not be right, and there is probably a better way to do this, but I am really having fun.

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!