Welcome to the CHICKEN Scheme pasting service

type alias not recognized for location added by wasamasa on Sat Nov 14 16:11:08 2020

(import scheme)
(import (chicken base))
(import (chicken foreign))

#>
void test(int *output) {
    *output = 42;
}
<#

(define-foreign-type pointer nonnull-c-pointer)
;; Error: illegal foreign argument type `(pointer int)'
;; (define test (foreign-lambda void "test" (pointer int)))
(define test (foreign-lambda void "test" (nonnull-c-pointer int)))

(let-location ((output int))
  (test (location output))
  (print output))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Type in the text below:
     _                 __               
 ___| | ___ __   __ _ / _|___ _ __ ___  
|_  / |/ / '_ \ / _` | |_/ __| '_ ` _ \ 
 / /|   <| |_) | (_| |  _\__ \ | | | | |
/___|_|\_\ .__/ \__, |_| |___/_| |_| |_|
         |_|       |_|                  
Visually impaired? Let me spell it for you (wav file) download WAV