Search found 153 matches

by joeish80829
Thu Jul 03, 2014 6:31 pm
Forum: Common Lisp
Topic: How can I change this defmacro so I can setf the return
Replies: 4
Views: 8810

Re: How can I change this defmacro so I can setf the return

Thank you very much, it didn't even occur to me to write an external function. Its blazing fast too! Thanks:)
by joeish80829
Thu Jul 03, 2014 12:38 pm
Forum: Common Lisp
Topic: How can I change this defmacro so I can setf the return
Replies: 4
Views: 8810

Re: How can I change this defmacro so I can setf the return

Can you show me how I would use desetf in this case, not sure I understood the documentation
by joeish80829
Wed Jul 02, 2014 5:53 pm
Forum: Common Lisp
Topic: How can I change this defmacro so I can setf the return
Replies: 4
Views: 8810

How can I change this defmacro so I can setf the return

Here is the macro, a macro for cffi::mem-aref. I was trying to make it so I can setf it like you can with mem-aref, but can't figure out how to do it. Any help is appreciated. (defmacro ? (ptr type &optional (index 0)) `(cond ((pointerp ,ptr) (return-from ? (mem-aref ,ptr ,type ,index))) ((not (...
by joeish80829
Wed May 28, 2014 6:51 am
Forum: Common Lisp
Topic: How do I find the length of a number?
Replies: 3
Views: 7426

Re: How do I find the length of a number?

Thanks a lot! That is just what I was looking for. I really do appreciate all these great answers you have given me.
by joeish80829
Wed May 28, 2014 2:08 am
Forum: Common Lisp
Topic: How do I find the length of a number?
Replies: 3
Views: 7426

How do I find the length of a number?

is there anyway to find the length of a number e.g.

Code: Select all

 (length 1234567890) 
would equal 10, or:

Code: Select all

(length 5487)
would equal 4
by joeish80829
Mon May 26, 2014 9:12 am
Forum: Common Lisp
Topic: GETTING "DELETING UNREACHABLE CODE ERROR" USING A DEFMACRO
Replies: 5
Views: 10408

Re: GETTING "DELETING UNREACHABLE CODE ERROR" USING A DEFMAC

Thanks for your help on this..I just decided to convert it to a defun and that solved it
by joeish80829
Mon May 26, 2014 4:58 am
Forum: Common Lisp
Topic: GETTING "DELETING UNREACHABLE CODE ERROR" USING A DEFMACRO
Replies: 5
Views: 10408

Re: GETTING "DELETING UNREACHABLE CODE ERROR" USING A DEFMAC

I really like mine that way..is there a way you can help me fix mine?
by joeish80829
Mon May 26, 2014 4:02 am
Forum: Common Lisp
Topic: GETTING "DELETING UNREACHABLE CODE ERROR" USING A DEFMACRO
Replies: 5
Views: 10408

GETTING "DELETING UNREACHABLE CODE ERROR" USING A DEFMACRO

Here is the macro: (defmacro print-mat (mat &key to-file) `(cond (,to-file (let ((*print-case* :downcase)) (with-open-file (str ,to-file :direction :output :if-exists :supersede :if-does-not-exist :create) (dotimes (i 4) (dotimes (j 2) (format str "~a" (aref ,mat i j)) (format str &quo...
by joeish80829
Sat May 24, 2014 11:01 pm
Forum: Emacs
Topic: Slime Compile/Load File not working
Replies: 0
Views: 21670

Slime Compile/Load File not working

I'm using Emacs24 on Ubuntu 14.04 w/ SLIME and SBCL. I notice sometimes when I compile a file with M-x slime-compile-and-load-file it compiles ok but other times it doesn't. It says compilation finished (no warnings) in the mini-buffer everytime but sometimes I make changes to a file and compile it ...
by joeish80829
Fri May 16, 2014 7:45 am
Forum: Common Lisp
Topic: How to convert C++ const_iterator and more to Lisp
Replies: 4
Views: 9123

Re: How to convert C++ const_iterator and more to Lisp

Actually I grabbed the wrong one it was this I need to convert from line 199 at the above link: for( vector<Rect>::iterator r = faces.begin(); r != faces.end(); r++, i++ ) {} Also on the line 223 code: smallImgROI = smallImg(*r); I'll have to call r as a pointer because calling as: smallImgROI = sma...