[PPL-devel] [GIT] ppl/ppl(master): Added Prolog_put_nil() and Prolog_get_nil().

Roberto Bagnara bagnara at cs.unipr.it
Wed Dec 11 07:49:38 CET 2013


Module: ppl/ppl
Branch: master
Commit: 17d622b60b0269fe99332f632ea3695d2ea5bae2
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=17d622b60b0269fe99332f632ea3695d2ea5bae2

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Wed Dec 11 07:37:11 2013 +0100

Added Prolog_put_nil() and Prolog_get_nil().

---

 interfaces/Prolog/SWI/swi_cfli.hh |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/interfaces/Prolog/SWI/swi_cfli.hh b/interfaces/Prolog/SWI/swi_cfli.hh
index 4fe3071..2203a41 100644
--- a/interfaces/Prolog/SWI/swi_cfli.hh
+++ b/interfaces/Prolog/SWI/swi_cfli.hh
@@ -145,6 +145,16 @@ Prolog_put_atom(Prolog_term_ref t, Prolog_atom a) {
 }
 
 /*!
+  Assign to \p t the list terminator <CODE>[]</CODE> (which needs not
+  be an atom).
+*/
+inline int
+Prolog_put_nil(Prolog_term_ref t) {
+  PL_put_nil(to_term_t(t));
+  return 1;
+}
+
+/*!
   Assign to \p t a term representing the address contained in \p p.
 */
 inline int
@@ -354,6 +364,15 @@ Prolog_get_arg(int i, Prolog_term_ref t, Prolog_term_ref a) {
 }
 
 /*!
+  Succeeds if and only if \p t represents the list terminator <CODE>[]</CODE>
+  (which needs not be an atom).
+*/
+inline int
+Prolog_get_nil(Prolog_term_ref t) {
+  return PL_get_nil(to_term_t(t));
+}
+
+/*!
   If \p c is a Prolog cons (list constructor), assign its head and
   tail to \p h and \p t, respectively.
   The behavior is undefined if \p c is not a Prolog cons.




More information about the PPL-devel mailing list