I'd rather not have to call the with-foreign-slots function with all that code every time id like to access slot values id rather do exactly like in c and call img->depth for example to access the IplImage struct member depth....Is there a way i can have this exact functionality in lisp with the above struct or any other....if i did have to call (img depth) i guess that would be ok but id rather create some sort of dereferencing operator equivelant to do this as easy as in c....either way can someone show me how to dereference pointers in the tiniest way possible like in c

You could wrap this in a helper function or macro to make it shorter for the common cases.

It would take a great deal more work to get a short operator.A reader macro could give you the syntax extension. (Though beware: such extensions don't compose.)However, there is still the issue of getting CL to track the C structure type.CFFI punts on this last point by having the program pass the type to functions like foreign-slot-value.

im familiar with-foreign-slot-value and i did check into reader macros but i was hoping for a soloution that didnt involve the /# characters ...is there a cffi function that can read the type of struct given just a variable that is created by a function that passes a pointer to that struct like in c with img->width for example...here is what i came up with so far

but i would like to know if there at least is any function where i can erase the ipl-image part and have that just understood as in c i thought i could make a function that would take IMG and test it against a group of foreign-slot-value functions that when one errors out it would CONTINUE then when it hits one with out an error it would print the desired output but then im left with

(-> img width)

Is there a way u know where i can transform the above into img->with or give me a link to get me started...thx for gettin back 2 me btw =).

no the (-> img width) i added did work . im just trying to get (-> img width) closer to c style img->width ....if you told me how i didnt really understand....if so can u make you make your explanation a little more basic... id like to create a -> operator if possible

Why do you want to use the anti-lispish infix notation in lisp? I think using prefix notation is just perfect. It can be extended for concatenated dereferencing after that you can do (-> my-linked-list next next) instead of something in a sense my_linked_list->next->next ...

I understand your point...I got into lisp because I plan to get heavy into A.I. so I chose a language that i thought wouldnt let me down in the future...so with that in mind ..is there a way that you can show me a way i can dereference in lisp better than c using the examples i posted on this ? ...even though im wrapping c I intend to make a computer vision library for lisp even better than opencv so if you could teach me a powerful way to dereference my pointers in a basic way (i didnt really understand your last post) or post a link where i could learn ways i would be appreciative....and maybe tell me why your idea is better than c i/e why(-> my-linked-list next next) is better than my_linked_list->next->next

I just wanted to ask what's wrong with a prefix syntax in your eyes? If I used such a library, I would be as a lisper glad having -> as a normal operatot/function in lisp. One of the advantages is that you don't have to repeat the operator -- more clearly; look at the plus: 1+2+3+4 vs. (+ 1 2 3 4).

I just thought the -> was cool but i do like prefix alot...i just wondered if it would hamper my A.I. if i could ffigure out how to code a c type dereference operator and used it and also if you could give me an example of a better way so i could make my computer vision library even better than opencv