Welcome to the CHICKEN Scheme pasting service

chicken-bind and C_malloc pasted by klm` on Sat Mar 3 00:16:50 2012

[klm@ksuo tmp]$ echo "struct foo { float a, b;};" | chicken-bind - -o -

;;; GENERATED BY CHICKEN-BIND FROM -

(begin
  (define foo-a
    (foreign-lambda* float (((c-pointer (struct "foo")) s)) "return(s->a);"))
  (define foo-b
    (foreign-lambda* float (((c-pointer (struct "foo")) s)) "return(s->b);"))
  (define make-foo
    (foreign-lambda*
      (c-pointer (struct "foo"))
      ((float a) (float b))
      "struct foo *tmp_ = (struct foo *)C_malloc(sizeof(struct foo));\ntmp_->a = a;\ntmp_->b = b;\nC_return(tmp_);")))

chicken-wrap / easyffi and malloc added by klm` on Sat Mar 3 00:30:01 2012

;; just for reference, easyffi does the same thing:

[klm@ksuo tmp]$ echo "struct foo {float a, b;}" | chicken-wrap - -to-stdout

;;; generated by chicken-wrap from -

(begin
  (define foo-a
    (foreign-lambda* float (((c-pointer (struct "foo")) s)) "return(s->a);"))
  (define foo-b
    (foreign-lambda* float (((c-pointer (struct "foo")) s)) "return(s->b);"))
  (define make-foo
    (foreign-lambda*
      (c-pointer (struct "foo"))
      ((float a) (float b))
      "struct foo *tmp_ = (struct foo *)C_malloc(sizeof(struct foo));\ntmp_->a = a;\ntmp_->b = b;\nreturn(tmp_);")))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which egg provides `take-right'?
Visually impaired? Let me spell it for you (wav file) download WAV