In GNU/Denemo we have been calling functions written in C from scheme by defining procedures via scm_c_define_gsubr. Recently I have tried returning one of the parameters passed (more exactly, the scm_list_ref of a scm_car() of one of the parameters) and I have run into trouble. If I pass 'a in as a parameter I get something back which prints on the console as (quote a) but which is not eq? to 'a
I can pass in a string and get an equal? string back. But what I really want to do is pass in a procedure and execute it if I get it back, thus (set! choice (d-PopupMenu (list '("Offset Position" . do-offset)))) (if choice (choice)) where do-offset is defined as (define (do-offset) (display "hello world")) and d-PopupMenu is my C-primitive which gets a choice from the user. If the user cancels choice is #f and all is well, if he accepts the one option on the menu, do-offset is returned but I get the error message (#f Wrong type to apply: ~S (do-offset) #f) (BTW I can't find a blow by blow explanation of this error message anywhere, I see some discussion of earlier versions of it on the net...) Anyone able to help? Richard Shann