emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sweeprolog 5fa0e16ee3 037/166: DOC: Document sweep_funcall


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 5fa0e16ee3 037/166: DOC: Document sweep_funcall/2, 3 in the manual
Date: Fri, 30 Sep 2022 04:59:24 -0400 (EDT)

branch: elpa/sweeprolog
commit 5fa0e16ee39697e341685aecd23e574958fa5757
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    DOC: Document sweep_funcall/2,3 in the manual
---
 README.org | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/README.org b/README.org
index c5dfa3f0bb..705883aad0 100644
--- a/README.org
+++ b/README.org
@@ -206,6 +206,25 @@ permutations of the list =(1 2 3 4 5)=:
     num)
 #+end_src
 
+** Calling Elisp function inside Prolog queries
+:PROPERTIES:
+:CUSTOM_ID: funcall-from-prolog
+:END:
+
+The =sweep-module= defines the foreign Prolog predicates =sweep_funcall/2=
+and =sweep_funcall/3=, which allow for calling Elisp functions from
+Prolog code.  These predicates may only be called in the context of a
+Prolog query initiated by =sweep-open-query=, i.e. only in the Prolog
+thread controlled by Emacs.  The first argument to these predicates is
+a Prolog string holding the name of the Elisp function to call.  The
+last argument to these predicates is unified with the return value of
+the Elisp function, represented as a Prolog term (see [[Conversion of
+Elisp objects to Prolog terms]]).  The second argument of
+=sweep_funcall/3= is converted to an Elisp object (see [[Conversion of
+Prolog terms to Elisp objects]]) and passed as a sole argument to the
+invoked Elisp function.  The =sweep_funcall/2= variant invokes the Elisp
+function without any arguments.
+
 
 * The Prolog top-level
 :PROPERTIES:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]