(FOREIGN-ALLOC... is is not of type SB-SYS:SYSTEM-AREA-P...

Discussion of Common Lisp

(FOREIGN-ALLOC... is is not of type SB-SYS:SYSTEM-AREA-P...

Postby joeish80829 » Thu May 08, 2014 2:25 pm

I was hoping someone could look at this and help me debug it.

I'm getting:

Code: Select all
  (FOREIGN-ALLOC :POINTER :INITIAL-ELEMENT (NULL-POINTER))
is not of type
  SB-SYS:SYSTEM-AREA-POINTER. when I run it.



Code: Select all
(foreign-array-alloc #2A((

           (foreign-alloc :pointer :initial-element (null-pointer))
           (foreign-alloc :pointer :initial-element (null-pointer)))
          ((foreign-alloc :pointer :initial-element (null-pointer))
           (foreign-alloc :pointer :initial-element (null-pointer)))
          ((foreign-alloc :pointer :initial-element (null-pointer))
           (foreign-alloc :pointer :initial-element (null-pointer)))
          ((foreign-alloc :pointer :initial-element (null-pointer))
           (foreign-alloc :pointer :initial-element (null-pointer)))) '(:array :pointer 4 2))

 
joeish80829
 
Posts: 153
Joined: Tue Sep 03, 2013 5:32 am

Re: (FOREIGN-ALLOC... is is not of type SB-SYS:SYSTEM-AREA-P

Postby porky11 » Fri May 09, 2014 6:51 am

there is no function foreign-array-alloc or foreign-alloc in common lisp (by default). please say, where you got this function

(I think the second code is the one you wrote to get this message)
porky11
 
Posts: 10
Joined: Fri May 02, 2014 6:46 am

Re: (FOREIGN-ALLOC... is is not of type SB-SYS:SYSTEM-AREA-P

Postby joeish80829 » Fri May 09, 2014 3:00 pm

Or never mind...I just found out how to create a 2d pointer array...that was CFFI btw


Code: Select all
(cffi::foreign-array-alloc
 (make-array '(4 2) :initial-contents
             (list (list (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2)))
                         (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2))))
                   (list (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2)))
                         (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2))))
                   (list (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2)))
                         (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2))))
                   (list (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2)))
                         (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2))))))
 '(:array :pointer 4 2))
joeish80829
 
Posts: 153
Joined: Tue Sep 03, 2013 5:32 am


Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 2 guests

cron