2579f5d00526

Move and clean up the functor wrapper functions
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 25 Mar 2016 11:48:00 +0000
parents e2bb4ea1bfe7
children 4b07fbd81ee2
branches/tags (none)
files src/wam.lisp

Changes

--- a/src/wam.lisp	Fri Mar 25 11:47:29 2016 +0000
+++ b/src/wam.lisp	Fri Mar 25 11:48:00 2016 +0000
@@ -76,6 +76,17 @@
     (+tag-functor+ "FUN")))
 
 
+(defun* cell-functor-name ((cell heap-cell))
+  (:returns string)
+  ;; todo
+  "functor")
+
+(defun* cell-functor-arity ((cell heap-cell))
+  (:returns (integer 0))
+  (logand (cell-value cell)
+          functor-arity-bitmask))
+
+
 (defun* make-cell ((tag heap-cell-tag) (value heap-cell-value))
   (:returns heap-cell)
   (logior (ash value +cell-tag-width+)
@@ -98,12 +109,6 @@
   (make-cell +tag-functor+ arity))
 
 
-; (defun cell-functor-name)
-(defun cell-functor-arity (cell)
-  (logand (cell-value cell)
-          functor-arity-bitmask))
-
-
 ;;;; Heap
 (deftype heap-index ()
   `(integer 0 ,array-total-size-limit))