Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun get-row(index list)
- (nth index list))
- (defun get-column(index list)
- (let ((row nil))
- (dolist (n list)
- (setf row (cons (nth index n) row)))
- (reverse row)))
- (defun get-number-rows (list)
- (length list))
- (defun get-number-columns (list)
- (length (car list)))
- (defun sender (id)
- (with-pmmp (id)
- (let* ((matrix2 `((1 2 3) (2 3 4) (2 3 4)))
- (columns (get-number-columns matrix2))
- (matrix1 `((4 5 6) (1 2 3) (2 3 4))))
- (loop for i from 0 to (- columns 1) do
- (send 1 `list (get-column i matrix2)))
- (send 1 `symbol `column)
- (dolist (n matrix1)
- (send 1 `list n)
- (send 1 `symbol `row)))
- (send 1 `end nil)))
- (defun listner (id)
- (with-pmmp (id)
- (loop
- (multiple-value-bind (data sender type) (receive nil nil)
- (declare (ignorable sender))
- (when (equalp type `list)
- (print data))
- (when (equalp data `column)
- (print "column"))
- (when (equalp data `row)
- (print "row"))
- (when (equalp type `end)
- (return))))))
- (defun test11 ()
- (init-pmmp 2)
- (set-process-function 0 #'sender)
- (set-process-function 1 #'listner)
- (run-pmmp))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement