From a5366007bcada783c764addfb8c4d24912086cc6 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Wed, 15 Apr 2020 22:59:17 -0400 Subject: [PATCH] Added TODO --- libs/cyclone/foreign.sld | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/libs/cyclone/foreign.sld b/libs/cyclone/foreign.sld index b21338d5..d74b1bb3 100644 --- a/libs/cyclone/foreign.sld +++ b/libs/cyclone/foreign.sld @@ -20,5 +20,34 @@ ;; internal name could be different (Cyc-foreign-code) to facilitate ;; library renaming, etc here ;(foreign-code STRING ...) + + +;; TODO: how to handle this? + +;could maybe have a macro (define-c-foreign) that takes below and rewrites it as a define-c +;would be nice if we could have foreign-lambda though, which seems much more flexible. +;maybe we can work up to that + + ;(define strlen + ; (foreign-lambda int "strlen" char-vector) ) + +; (define-syntax define-curl-const +; (er-macro-transformer +; (lambda (expr rename compare) +; (let* ((sym (cadr expr)) +; (str (symbol->string sym)) +; (lib_fnc_str (string-append "_" str)) +; (lib_fnc (string->symbol lib_fnc_str)) ;; Internal library function +; (args "(void *data, int argc, closure _, object k)") +; (body +; (string-append +; "return_closcall1(data, k, obj_int2obj(" str "));")) +; ) +; `(begin +; (define-c ,lib_fnc ,args ,body) +; (define ,sym (,lib_fnc)) +; ))))) + + ) )