call scheme procedure from C added by bilal on Fri Sep 16 19:32:24 2022

#include <stdio.h>
#include <chicken/chicken.h>

extern int callin (C_word x);

int main() {
   // printf() displays the string inside quotation
   printf("Hello, World!\n");
   C_word *ptr = C_alloc(C_SIZEOF_LIST(3));
   C_word lst;
   printf("This is 'callout': %d, %d, %d\n", 1,2,3);
   lst = C_list(&ptr, 3, C_fix(1), C_fix(1), C_fix(2));
   callin(C_fix(1));
   return 0;
}



////////////////////////


(declare (unit own))
(import (chicken foreign))

(define-external (callin (scheme-object xyz)) int
  (print "This is 'callin': " xyz)
  123)