Search found 117 matches

by Warren Wilkinson
Fri Aug 13, 2010 3:31 pm
Forum: The Lounge
Topic: Lisp as assembly language??
Replies: 12
Views: 33956

Re: Lisp as assembly language??

Sounds pretty meaningless to me. You can build a computer with an eye towards evaluating s-expressions (in fact, thats were the words CAR and CDR came from), but modern computers are ugly register machines. A register machine only understands in terms of register operations --- you could write lisp ...
by Warren Wilkinson
Thu Aug 12, 2010 12:44 am
Forum: Common Lisp
Topic: suggestions for Lisp syntax to python translator
Replies: 8
Views: 3430

Re: suggestions for Lisp syntax to python translator

I suggest you ensure that the Python libraries are worth the trouble of programming through a straw. Snipes aside, Paren script (http://www.cliki.net/Parenscript) is a lisp library that transforms s-expressions into javascript. You might find applicable techniques in that package.
by Warren Wilkinson
Wed Aug 11, 2010 1:17 pm
Forum: Scheme
Topic: Need help in displaying using lists
Replies: 6
Views: 11431

Re: Need help in displaying using lists

Looking at your latest post, that looks like cross product to me... I'm not super familiar with scheme, but this might do what you need: (defun ensure-list (a) (if (listp a) a (list a))) (defun cross (a b) (mapcan #'(lambda (outer) (mapcar #'(lambda (inner) (list* outer (ensure-list inner))) b)) a))...
by Warren Wilkinson
Wed Aug 11, 2010 10:25 am
Forum: Common Lisp
Topic: Uncatchable error
Replies: 5
Views: 2314

Re: Uncatchable error

Errors are CLOS objects, and they just record the format string for later use. There wasn't a formating error until you tried to print it.
by Warren Wilkinson
Wed Aug 11, 2010 10:22 am
Forum: Common Lisp
Topic: Only in Lisp
Replies: 43
Views: 17520

Re: Only in Lisp

This thread is getting old, but I figured I'd chip in. You seem like a knowledgable fellow, so I'll get right to the good stuff. Dynamic Variables: This is like a global variable, but bound with let. All subsequent functions see the most-recently-bound value. After the let the variable holds its old...
by Warren Wilkinson
Wed Aug 11, 2010 12:32 am
Forum: Common Lisp
Topic: dolist in a circular list
Replies: 8
Views: 7870

Re: dolist in a circular list

Thats a tricky problem. Lets see if I have this right: You have several lines --- and some are circular. A line is a series of station names. You are going to find routes through the city by finding the stations that intersect both lines. You could use circular lists, but you can't use dolist with t...
by Warren Wilkinson
Tue Aug 10, 2010 11:44 pm
Forum: Common Lisp
Topic: Nth element of a hash?
Replies: 5
Views: 2603

Re: Nth element of a hash?

A seperate vector would be gross. (defun nthhash (n h) (maphash #'(lambda (k v) (when (zerop n) (return-from nthhash (values v k))) (decf n)) h)) (setf *test* (make-hash-table)) (setf (gethash :a *test*) :aa) (setf (gethash :b *test*) :bb) (setf (gethash :c *test*) :cc) (nthhash 0 *test*) ;; gives :...