Search found 406 matches
- Wed Apr 22, 2009 2:07 pm
- Forum: Common Lisp
- Topic: Access a specific row from an array
- Replies: 4
- Views: 6349
Re: Access a specific row from an array
See documentation on make-array , in particular :displaced-to and :displaced-index-offset, for example: CL-USER> (defparameter *a* (make-array (list 2 2) :initial-contents '((1 2)(3 4)))) *A* CL-USER> (make-array 2 :displaced-to *a*) #(1 2) CL-USER> (make-array 2 :displaced-to *a* :displaced-index-...
- Wed Apr 22, 2009 12:35 pm
- Forum: Common Lisp
- Topic: Access a specific row from an array
- Replies: 4
- Views: 6349
Re: Access a specific row from an array
Unfortunately, I believe the only way to do this explicitly is to create a fresh vector and copy over the elements of that row. You can also do this implictly using closures: (defun nth-row (array index) (lambda (col) (aref array index col))) And (let* ((array #2A((1 2) (3 4))) (row-0 (nth-row array...
- Fri Apr 17, 2009 11:27 pm
- Forum: Common Lisp
- Topic: Using barewords not keywords in macros
- Replies: 7
- Views: 10030
Re: Using barewords not keywords in macros
Alright, figured out what went wrong. I forgot to downcase the keywords during a comparison so instead of getting filtered out they did indeed get evaluated at a later moment. I was totally focussing on the wrong part of the macro when trying to find the problem. All right, it looks like you are ge...
- Thu Apr 16, 2009 1:11 pm
- Forum: Common Lisp
- Topic: SBCL Problem using Eclipse/Cusp
- Replies: 2
- Views: 5470
Re: SBCL Problem using Eclipse/Cusp
I think you will have a better response if you try contacting Cusp 's mailing list. I don't use Cusp, so I can't help you, this seems to be a problem with Cusp. You may also want to test if slime also gives the same problem, if you already didn't.
- Tue Apr 14, 2009 3:56 pm
- Forum: Common Lisp
- Topic: Rant: lisp is not C. Get over it.
- Replies: 47
- Views: 232927
Re: Rant: lisp is not C. Get over it.
Newbies are able to install the free implementation of Python or Ruby in Windows in a couple of clicks. The same newbies try to install a free CL implementation in Windows and spend the next day trying to get Emacs working with Slime and SBCL/CLISP. I have to modify my .emacs file to run SLIME? An ...
- Sun Apr 12, 2009 5:10 pm
- Forum: Common Lisp
- Topic: A good criticism of the comon lisp language(?)
- Replies: 16
- Views: 28648
Re: A good criticism of the comon lisp language(?)
Is the reason that Common Lisp receives so much criticism because there really are so many problems in the language that it stops you from using it or is it because people observe a resistance to change the language in the community? I believe it is a bit of both, or sort of. CL has some defects. I...
- Tue Apr 07, 2009 11:03 am
- Forum: Common Lisp
- Topic: between defun and defmacro
- Replies: 3
- Views: 7827
Re: between defun and defmacro
If you want a shorthand so that instead of writing ",cat" you can write "cat", well, as an option your macro can be macroexpanded into something like this: (defmacro leopard (dog cat*) (let ((catg (gensym))) `(let ((,catg ,cat*)) ,(subst catg 'cat `(if ,dog "war is over"...
- Tue Apr 07, 2009 10:35 am
- Forum: Common Lisp
- Topic: newbie HELP!!
- Replies: 5
- Views: 7944
Re: newbie HELP!!
This is a very simple task. I'm not going to make everything for you, but, if you can make an algorithm (e.g. in pseudo-language) then it is very simple to transform it into Common Lisp. If you have the algorithm and cannot translate it into CL, you should try learning a bit of CL first.
- Thu Apr 02, 2009 1:05 pm
- Forum: Common Lisp
- Topic: Compilation and defstruct
- Replies: 2
- Views: 4635
Re: Compilation and defstruct
I don't think there should be a difference in interpreting or compiling the code, it can be a bug. It would be a good thing if you posted the problematic code, or tested it in other implementations.
- Wed Apr 01, 2009 5:17 am
- Forum: Common Lisp
- Topic: more newbie help...
- Replies: 10
- Views: 18374
Re: more newbie help...
! You are right. I think I was sleepy when I wrote this.qbg wrote:I think you mean LAST there.gugamilare wrote: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.