anchor.diff:  (defun socket-writejson (data &optional (socket *socket*))
   	(socket-writeline (st-json:write-json-to-string data)))
   
  -(defun socket-close (&optional (socket *socket*)) (if socket (usocket:socket-close socket)))
   ;;
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ;; STAP for ACT-R
  
positive.code: ;; to run your model:
  ;;  after you define your model, use (run-tcp-task :host HOST :port PORT :real-time REALTIME_OR_NOT :pause-between-actions PAUSE_OR_NOT) to connect to task served on HOST/PORT, and run in REALTIME_OR_NOT
  ;;		the suggestion is to always set :pause-between-actions flag to T; however, it you need the model-time to keep going even when there are no buttons to press and no scheduled display changes, set this flag to NIL
  ;;
  
  
  
negative.code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; async socket client
  ;;
  (defun socket-close (&optional (socket *socket*)) (if socket (usocket:socket-close socket)))
  (defun socket-readlines (with-line-f &optional (socket *socket*))
  	(setq *socket-read-thread*
  		(bt:make-thread
  			(lambda ()
  				(handler-case
  					(let ((line))
  						(loop while (setq line (handler-case
  								(read-line (usocket:socket-stream socket) nil nil)
  								(stream-error (e) nil))) do
  							(model-output "<= ~a" line)
  							(funcall with-line-f line)))
  					(error (e) (model-output "Error encountered: ~a" e)))
  				(model-output "Closing socket.")
  				(display-update)
  				(socket-close socket)))))
  (defun socket-writeline (s &optional (socket *socket*))
  	(model-output "=> ~a" s)
  	(write-line s (usocket:socket-stream socket))
  