Search found 148 matches

by Paul Donnelly
Sat Nov 27, 2010 6:29 pm
Forum: Common Lisp
Topic: pprint doesn't work with LispWorks
Replies: 2
Views: 5841

Re: pprint doesn't work with LispWorks

I think (1 2 (4 5) 3) is prettier than the other. If you want another behaviour, you could write your own printing routine.
by Paul Donnelly
Sat Nov 27, 2010 6:23 pm
Forum: Other Tools
Topic: ECL: Compile Lisp to C
Replies: 8
Views: 41741

Re: ECL: Compile Lisp to C

If you just want to see the code generated for a particular function, I think DECOMPILE can show you that in ECL. Something like that; it's in the manual.
by Paul Donnelly
Sat Nov 20, 2010 2:54 pm
Forum: Common Lisp
Topic: Land of Lisp recursion understanding problem
Replies: 7
Views: 10794

Re: Land of Lisp recursion understanding problem

Does it make more sense to you written like this?

Code: Select all

(defun a (n)
  (+ n 5))

(defun b (n)
  (+ (a n) 6))

(b 10)
You've probably learned about LET*. LABELS is much like LET* for functions.
by Paul Donnelly
Sat Nov 06, 2010 4:30 pm
Forum: Common Lisp
Topic: Sequence of variables.
Replies: 4
Views: 7511

Re: Sequence of variables.

Thanks Warren and sorry for not recognizing your other post. After rethinking "how" I was going to use the data in the variables at a later point I decided to simply go with a list containing the data of the n variables. Later when I add to the list (the list will grow), since the operati...
by Paul Donnelly
Wed Nov 03, 2010 5:06 pm
Forum: Common Lisp
Topic: Classes as slots in other classes and package definition
Replies: 3
Views: 6775

Re: Classes as slots in other classes and package definition

(1) If I initialize the unit class with make-instance, do I also have to initialize the slot values of the unit-type and the unit-attributes classes with make-instance? That depends. Is there a reasonable default? You could supply it as an :initform. What you probably want to do is define a constru...
by Paul Donnelly
Mon Oct 11, 2010 3:16 pm
Forum: Common Lisp
Topic: LISP Problem with Binary Search Tree (Please help!!)
Replies: 1
Views: 5321

Re: LISP Problem with Binary Search Tree (Please help!!)

You should change the program to use better style; that will probably make the problem more obvious. Indentation never hurts. SETQ isn't for defining variables. If you want a global variable, use DEFVAR outside your function. As for global variables themselves, you don't want those. Pass more argume...
by Paul Donnelly
Fri Oct 08, 2010 4:25 pm
Forum: Common Lisp
Topic: How to handle large prgrams in LISP
Replies: 6
Views: 8969

Re: How to handle large prgrams in LISP

I have a current project which is rather large and to make the code more manageable I put the definitions for class1 and it's methods in file1, definitions for class2 and it's methods in file2,...,definitions for class1 and it's methods in file_n. It seems a little nutty to break it down that far. ...
by Paul Donnelly
Wed Sep 15, 2010 8:12 am
Forum: Scheme
Topic: getting constant input
Replies: 2
Views: 11971

Re: getting constant input

Ncurses wrapper? If your Scheme doesn't already have one, it would be a good chance to learn to work the FFI. Doing console drawing yourself doesn't sound pleasant.
by Paul Donnelly
Thu Aug 26, 2010 10:23 pm
Forum: The Lounge
Topic: Another question about associate list
Replies: 5
Views: 13133

Re: Another question about associate list

I think your problem is that you're forgetting the format of your alist. I don't know what varlist is, so I can't be sure. :b ≠ (:b b) Keep in mind that any comparison you make will need to examine the first member of each alist entry, not the entry itself. You may find it easier to debug if you u...
by Paul Donnelly
Tue Aug 24, 2010 11:07 pm
Forum: Common Lisp
Topic: can u help me to solve this ...plzzz
Replies: 4
Views: 8640

Re: can u help me to solve this ...plzzz

Warren Wilkinson wrote:I actually did this yesterday. I wanted to run a genetic algorithm to see what set of 'coins denominations' made for the least amount of change.
Come up with anything interesting?