Search found 94 matches

by smithzv
Fri Dec 02, 2011 9:13 am
Forum: Common Lisp
Topic: a comparison sort function..
Replies: 7
Views: 8828

Re: a comparison sort function..

Yes, I believe this is the truth both in the wording and the spirit of CL. To go a bit further, but perhaps not pertinent. As I alluded to, CL is flexible enough that you don't need to do this (as say, a purely functional language wouldn't be) so there might be cases where you decide you want to wri...
by smithzv
Fri Dec 02, 2011 4:32 am
Forum: Common Lisp
Topic: a comparison sort function..
Replies: 7
Views: 8828

Re: a comparison sort function..

Pondering what you mean. (my-sort vec ...) shouldn't sort in place? And my-sort looks like this: That depends on what you mean. If, by sort in place, you mean it moved elements around inside the vector, then, it is fine if it sorts in place (it is often times a nice thing memory usage wise to guara...
by smithzv
Fri Dec 02, 2011 1:19 am
Forum: Common Lisp
Topic: a comparison sort function..
Replies: 7
Views: 8828

Re: a comparison sort function..

As a beginner, I would like to ask is passing a comparison function as an argument the way to do it? Are there more LISPy ways? Thanks. Yes, it is. Also there are more Lispy ways to do it. The SORT function in CL also includes a "key" function, which simplifies the comparison predicate. T...
by smithzv
Tue Nov 29, 2011 4:57 pm
Forum: Common Lisp
Topic: Graph problem
Replies: 1
Views: 3395

Re: Graph problem

This seems a bit old, but it is unanswered so I guess I'll try to point you in some direction. I have not bothered to look at your code, but if you have something that can perform a depth first search or a breadth first search there is not much more to save the path lengths. All you need to do is sa...
by smithzv
Tue Nov 29, 2011 8:25 am
Forum: User Groups and Conferences
Topic: User Group in Chicago
Replies: 4
Views: 38268

Re: User Group in Chicago

Hi

Have you found any interest out there? I am moving to Carol Stream in about a month and would love to be part of a Lisp user group, although we might benefit with a group larger than 2. Let me know if you have any info on area lugs or want to organize something ourselves.

Zach KS
by smithzv
Sun Oct 09, 2011 2:21 am
Forum: Common Lisp
Topic: Some element-deleting list functions
Replies: 13
Views: 22184

Re: Some element-deleting list functions

Yeah, I just installed GCL and ran your code and no errors. You will almost certainly need to reinstall GCL. Did you build from source, or download a binary? (I always say go binary if you can). If you are reinstalling your Lisp system, you might as well go with some other Lisp unless your class sai...
by smithzv
Sun Oct 09, 2011 2:14 am
Forum: Common Lisp
Topic: Some element-deleting list functions
Replies: 13
Views: 22184

Re: Some element-deleting list functions

Regarding REMOVE, I tried to change it before it caused confusion. Just me being stupid, sorry. I actually don't have any hints. My first suspicion is that your GCL install is screwed up. I just tried it in SBCL and it worked like a charm. I'm downloading GCL to see what's up there right now. Sorry ...
by smithzv
Sat Oct 08, 2011 11:31 am
Forum: Common Lisp
Topic: Some element-deleting list functions
Replies: 13
Views: 22184

Re: Some element-deleting list functions

Is this homework? I ask because there is the REMOVE function... (edit: yes, clearly I don't know what REMOVE does... :oops: ) Your code is almost correct, I think. However, I don't know why you are checking for (null x), and that last case should be (cons (car l) (take-out-first x (cdr l))) not APPE...
by smithzv
Fri Oct 07, 2011 8:39 am
Forum: Common Lisp
Topic: "defvar:command not found"
Replies: 2
Views: 4333

Re: "defvar:command not found"

I don't, but it sure seems like CLISP isn't receiving your input, as bash (the shell) is giving the error. You might just post exactly was shows on screen because either CLISP is quiting and you don't notice or Bash+Cygwin is doing something funny where it is grabbing your commands before they get t...
by smithzv
Thu Oct 06, 2011 11:12 am
Forum: Common Lisp
Topic: Help with a lisp program
Replies: 12
Views: 16858

Re: Help with a lisp program

It's funny that you mentioned REDUCE before, but chose to not use it here, since it is technically the correct thing to do whereas APPLY might fail on a hypothetical, severely limited Lisp (perhaps for embedded systems?) when the list longer than 50. Also, I think the task was to do the same thing w...