|
Gustek <gustek@riseup.net>PGP Key My code |
Welcome.
I'm Gustek, a 1st year computer engineering student living in France. I enjoy learning about languages, I speak French, Polish, English and Spanish and I'm able to gibber in Russian.
I wrote this page using a single 84KiB Lisp expression because it's fun:
((lambda (html &rest pages)
(dolist (page pages)
(let ((fname (car page)) (node (cdr page)))
(with-open-file (out fname :direction :output :if-exists :supersede :if-does-not-exist :create)
(format out "~a~%~a" (if html "" "")
(labels ((translate-node (node)
(if (atom node) node
(let ((tag (car node)) (body (cdr node)))
(if (and (not (null body)) (atom body)) body
(if (null body) (format nil "<~a />" tag)
(multiple-value-bind (attr body) ((lambda (body)
(let ((attr '()) (cont '()) (i 0))
(loop while (< i (length body))
do (let ((current (nth i body)))
(if (eq current '@)
(setq attr (cons `(,(nth (incf i) body) . ,(nth (incf i) body)) attr))
(setq cont (cons current cont)))
(incf i)))
(values attr (nreverse cont))))
body)
(format nil "<~a~{ ~a~}>~%~{~a~}~%~a>~%" tag
(mapcar #'(lambda (p) (format nil "~a=\"~a\"" (car p) (cdr p))) attr)
(mapcar #'(lambda (n) (translate-node n)) body)
tag))))))))
(translate-node node)))))))
t ; we want some html here
page1 page2 ... pagen)
|
Nothing too interesting but it's honest work. This is a portfolio as much as it's a todo-list
dcg
syntax-tree-based revision control system —
source
yesod
lisp machine architecture for the 21st century —
source
namaz.pl
script to calculate prayer times at a given location —
source
gaufre
command line gopher client —
source