Search found 4 matches
- Fri Jan 28, 2011 8:20 am
- Forum: Common Lisp
- Topic: Concatenating symbols
- Replies: 4
- Views: 10263
Re: Concatenating symbols
Paul Graham offers a slightly more flexible function in On Lisp (page 57). It will work on anything that can be sent to princ rather than just symbols: (defun mkstr (&rest args) "concatenates args by printing into string" (with-output-to-string (s) (dolist (a args) (princ a s)))) (defu...
- Thu Jan 27, 2011 8:31 pm
- Forum: Common Lisp
- Topic: Newbie questions - and yes, its homework :-(
- Replies: 21
- Views: 26933
Re: Newbie questions - and yes, its homework :-(
(acc) is telling lisp to evaluate the function acc with 0 arguments. Try returning just acc not (acc). You are currently mixing two different approaches to solving this problem: one, to pass an accumulator argument to the successive function calls, and two, to cons an initial result to an additional...
- Sun Dec 12, 2010 10:35 pm
- Forum: Common Lisp
- Topic: help creating a simple word scramble program
- Replies: 8
- Views: 12209
Re: help creating a simple word scramble program
Interesting; that is a neat randomize-list. You can write one that performs Warren's benchmark significantly faster by coercing a copy of the list to a vector and shuffling that, but it's significantly slower on word length lists. Here is what I have now. It's almost there but still getting errors. ...
- Wed Dec 08, 2010 12:56 pm
- Forum: Common Lisp
- Topic: what is cd in (cd *db*)?
- Replies: 4
- Views: 5111
Re: what is cd in (cd *db*)?
dolist (var list-form [result-form]) declaration* {tag | statement}* Cd is the var and *db* is the list-form, and the optional result-form is not used. There can be any number of declaration; there are none. There can be any number of tag or statement; there are no tags and the only statement is (f...