Search found 153 matches

by joeish80829
Sat Jul 26, 2014 5:21 am
Forum: Common Lisp
Topic: How do I write wrapper for foreign-alloc, that frees it....
Replies: 4
Views: 9590

Re: How do I write wrapper for foreign-alloc, that frees it.

well i noticed even creating a million of them(foreign-alloc) doesnt make my ram go up, and when I am done using the matrix eg it is deleted(my matrices are created with a new operator) the data is still in the pointer created by foreign-alloc, I was hoping to free that data automatically when the m...
by joeish80829
Thu Jul 24, 2014 8:03 pm
Forum: Common Lisp
Topic: How do I use a type-specifier in a case statement?
Replies: 3
Views: 8527

Re: How do I use a type-specifier in a case statement?

Thanks for the answer, that typecase did the trick:)
by joeish80829
Wed Jul 23, 2014 3:46 am
Forum: Common Lisp
Topic: How do I write wrapper for foreign-alloc, that frees it....
Replies: 4
Views: 9590

How do I write wrapper for foreign-alloc, that frees it....

automatically when it goes out of scope(or the functions that can still access the data created by foreign-alloc go out of scope). I'm trying to write a loose wrapper for cffi:foreign-alloc that finalizes(calls cffi:foreign-free on it) it automatically. For instance if I have a defcfun named "t...
by joeish80829
Wed Jul 23, 2014 2:27 am
Forum: Common Lisp
Topic: How do I use a type-specifier in a case statement?
Replies: 3
Views: 8527

How do I use a type-specifier in a case statement?

;; If I make an array like this (let ((arr (make-array (list 3 3) :element-type '(unsigned-byte 8))) (type 0) (cffi-type 0)) ;; and set its type to a variable like this: (setf type (array-element-type arr)) ;; How do I write a case or a typecase statement to dispatch based on the ;; (unsigned-byte ...
by joeish80829
Fri Jul 18, 2014 4:45 pm
Forum: Common Lisp
Topic: would like to enter multiple arguments w/o progn to defmacro
Replies: 4
Views: 10375

Re: would like to enter multiple arguments w/o progn to defm

Thanks man, I really appreciate that, that will help my mind travel diiferent directions,now , knowing that:)

Take Care
by joeish80829
Wed Jul 16, 2014 9:11 pm
Forum: Common Lisp
Topic: would like to enter multiple arguments w/o progn to defmacro
Replies: 4
Views: 10375

Re: would like to enter multiple arguments w/o progn to defm

Thank you very much for your reply:)...for my purposes I have to be able to run: ($ (function) (function)) to time multiple functions at 1000,000 iterations I have to be able to run: ($ (function)) to time one function at 1000,000 iterations I have to be able to run: ($ (function) 1000) to time one ...
by joeish80829
Thu Jul 10, 2014 9:28 pm
Forum: Common Lisp
Topic: How can I call CL:GET in a condition statement
Replies: 5
Views: 12069

Re: How can I call CL:GET in a condition statement

If I can get this to work this will be where it is defined:

Code: Select all

(defun get1 (&rest args)
  (cond ((symbolp (first args))
    (apply #'cl:get args))
   ((typep (first args) 'cv-video-capture)
    (princ 1))))
by joeish80829
Thu Jul 10, 2014 1:34 pm
Forum: Common Lisp
Topic: How can I call CL:GET in a condition statement
Replies: 5
Views: 12069

Re: How can I call CL:GET in a condition statement

Thanks for the help so far pjstirling and Goheeca, my LISP-CV package is here: https://github.com/W-Net-AI/lisp-cv But to install it you must have OpenCV installed and that has an error that might make it not possible to use my package for now. If it is possible though can you show me how to do this...
by joeish80829
Thu Jul 10, 2014 1:32 am
Forum: Common Lisp
Topic: How can I call CL:GET in a condition statement
Replies: 5
Views: 12069

How can I call CL:GET in a condition statement

Here is my cond statement, to make it simpler I took ot the code that was where the (princ 1) and just added my CFFI type for cv-video-capture at th ebottom because I think it might be relevant. It might make things more confusing to say why I would like to do this, so I just will say it is neccessa...
by joeish80829
Sun Jul 06, 2014 8:45 pm
Forum: Common Lisp
Topic: would like to enter multiple arguments w/o progn to defmacro
Replies: 4
Views: 10375

would like to enter multiple arguments w/o progn to defmacro

here is the macro, it is used to time 1 or more functions: (defmacro $ (form &optional (count-form 1000000)) `(time (dotimes (_ ,count-form) ((lambda () ,form))))) for 1 function I run like this: ($ (function)) for multiple functions I run like this: ($ (progn (function) (function))) how can I m...