Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved back MAKE-PID and MAKE-REFERENCE from cl-erlang-term.

  • Loading branch information...
commit bbdd9b3427b773dce05acf6aca3444dd3c4c8185 1 parent fb6521c
@flambard authored
Showing with 35 additions and 0 deletions.
  1. +35 −0 src/local-node.lisp
View
35 src/local-node.lisp
@@ -40,3 +40,38 @@
(if pos
(subseq node-string (1+ pos))
"localhost"))) ;; OK with localhost??
+
+
+;;;
+;;; PID functions
+;;;
+
+(defvar *pid-id-counter* 0)
+
+(defun generate-new-pid-id ()
+ (uint32-to-bytes (incf *pid-id-counter*)))
+
+(defun make-pid ()
+ "Create a new Erlang PID."
+ (make-instance 'erlang-pid
+ :node (make-symbol (this-node))
+ :id (generate-new-pid-id)
+ :serial #(0 0 0 0) ;; What to set here?
+ :creation 1)) ;; What to set here?
+
+
+;;;
+;;; Ref functions
+;;;
+
+(defvar *reference-id-counter* 0)
+
+(defun generate-new-reference-id ()
+ (uint32-to-bytes (incf *reference-id-counter*)))
+
+(defun make-reference ()
+ "Create a new Erlang reference."
+ (make-instance 'erlang-reference
+ :node (make-symbol (this-node))
+ :id (generate-new-reference-id)
+ :creation 1)) ;; What to set here?
Please sign in to comment.
Something went wrong with that request. Please try again.