On the other hand, by his description, he wants to create a function that like butlast, but with reversed order of arguments.Harleqin wrote:It seems that you are exactly "reinventing" the NTHCDR function.
Search found 406 matches
- Tue Mar 31, 2009 6:52 pm
- Forum: Common Lisp
- Topic: more newbie help...
- Replies: 10
- Views: 17475
Re: more newbie help...
- Tue Mar 31, 2009 12:26 pm
- Forum: Common Lisp
- Topic: more newbie help...
- Replies: 10
- Views: 17475
Re: more newbie help...
You shouldn't do like this: (defun suffix (x &rest args) (setf f 0) ...) First, you want to pass only 2 arguments to the function suffix. In you example, (suffix 3 '(a b c d e f)), the first argument is 3 and the second is '(a b c d e f). In this case, you don't need the &rest directive. Sec...
- Mon Mar 30, 2009 10:49 am
- Forum: Common Lisp
- Topic: newbie help
- Replies: 2
- Views: 4976
Re: newbie help
Function calls in Lisp are done this way: (f a b) - calls f with a and b as arguments. In C you would write f(a,b), but in Lisp you put the function being called inside the parentesis as well.
- Fri Mar 27, 2009 7:27 am
- Forum: Common Lisp
- Topic: Is there any good efficient vector library?
- Replies: 4
- Views: 6156
Re: Is there any good efficient vector library?
A quick search into http://www.cl-user.net/ gave me the following results: http://common-lisp.net/project/cl-mathstats/ http://nlisp.info/ http://matlisp.sourceforge.net/ http://common-lisp.net/project/gsll/ http://aleph0.info/spartns/ (for sparse vectors / matrices) Anyway, it doesn't hurt to progr...
- Thu Mar 26, 2009 1:12 pm
- Forum: Common Lisp
- Topic: Better then loop/iterate?
- Replies: 41
- Views: 59481
Re: Better then loop/iterate?
Have you seen Lispbuilder-SDL? It is an interesting alternative, at least 4 games were created using it and it is pretty much stable.
Just to mention, you can check lispbuilder at sourceforge, but it is outdated. The first link is better.
Just to mention, you can check lispbuilder at sourceforge, but it is outdated. The first link is better.
- Thu Mar 26, 2009 12:30 pm
- Forum: Common Lisp
- Topic: Better then loop/iterate?
- Replies: 41
- Views: 59481
Re: Better then loop/iterate?
Indeed, defining compiler macros for standard functions is classified by the ANSI as "unportable code". But reduce does accept a key argument, so:
Code: Select all
(reduce #'+ '(1 2 3 4) :key (lambda (x) (* 2 x)))
- Thu Mar 26, 2009 10:17 am
- Forum: Common Lisp
- Topic: OT: CL use and sources
- Replies: 3
- Views: 7088
Re: OT: CL use and sources
Not all "interpreters" are written in C/C++. And we don't usually say "interpreters" because most implementations (maybe all of them?) compiles the code, sometimes to C code, sometimes to bytecode, or even directly to assembly. If you want to see the C / C++ source code of an imp...
- Thu Mar 26, 2009 10:03 am
- Forum: Common Lisp
- Topic: Better then loop/iterate?
- Replies: 41
- Views: 59481
Re: Better then loop/iterate?
Reducing in place? Ok:
what about this, then:
?
Code: Select all
(reduce (lambda (x y) (+ x (* 2 y))) '(1 2 3 4) :initial-element 0)
Code: Select all
(let ((list '(1 2 3 4)))
(reduce '+ (map-into list (lambda (x) (* x 2)) list)))
- Tue Mar 24, 2009 3:25 pm
- Forum: Common Lisp
- Topic: Auto documentation for lisp?(output html, prefered)
- Replies: 15
- Views: 20903
Re: Auto documentation for lisp?(output html, prefered)
Mudballs, as much as I understand, is a replacement for ASDF, not only ASDF-install. I have nothing against it, but I don't have any reasons to abandon ASDF itself, and almost all projects already use ASDF, which means everyone have it already installed and configured. The combination clbuild+asdf s...
- Sun Mar 22, 2009 11:51 am
- Forum: Common Lisp
- Topic: Auto documentation for lisp?(output html, prefered)
- Replies: 15
- Views: 20903
Re: Auto documentation for lisp?(output html, prefered)
I use clbuild, it can update everything in an easy way - you ask for updating a lib, it updates all of it's dependencies, just like a package manager. I don't think shipping dependencies together is the best answer anyway, but the problem is asdf-install.