Re: How to bind a function pointer in a struct?

Joseph Donaldson <[email protected]>
Newsgroups gmane.lisp.scheme.bigloo
Message-ID <[email protected]>
Hello, Amirouche,
You need to add an include example.h to your extern clause. See below.
Best Regards, Joseph Donaldson
 
 
  On Mon, Feb 12, 2018 at 2:31 PM, Amirouche Boubekki<[email protected]> wrote:   I created a small example to learn how to do it.(module foo
    (extern
      (include "example.h")      ;; beginning of example.h
      (create_abc::ABC* () "create_abc")
      (sum::int (int int) "sum")
      (type s-ABC_ (struct (value::int "value") 
(sum::*int,int,string->int "sum")) "struct ABC_")
      (type int,int,string->int "int ($(int,int,char *))")
      (type *int,int,string->int (function int (int int string)) "int 
((*$)(int,int,char *))")
      (type ABC s-ABC_ "ABC")
      (type ->ABC* "ABC *($())")
      (type int,int->int "int ($(int,int))")
      ;; end of example.h
      )
  (main main))

(define (main x)
  (let ((out (create_abc)))
    (print "total:")
    (print out)))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.