From 739092ade680255c7548c167eb123715af527275 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Sat, 25 Sep 2021 09:31:57 -0500 Subject: [PATCH] Add section describing cfn function --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index cf360cf..9d8b9fa 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,14 @@ native function reference, followed by an optional docstring and attribute map, then the C function identifier, including the name of the native symbol, a vector of argument types, and the return type. +If you wish to use a native function as an anonymous function, it can be done +with the `cfn` function. + +```clojure +((ffi/cfn "strlen" [::ffi/c-string] ::ffi/long) "hello") +;; => 5 +``` + ### Primitive Types Coffi defines a basic set of primitive types: - byte