From de161c045bbda1d1796d09ee03dc0bbbb6dcedc8 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Sun, 10 Apr 2016 14:07:33 +0300 Subject: Use assq instead of assoc in request and connection wrappers --- elisp/geiser-connection.el | 32 ++++++++++++++++---------------- elisp/geiser-eval.el | 22 ++++++++++++++++------ 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el index 675fb25..510afe9 100644 --- a/elisp/geiser-connection.el +++ b/elisp/geiser-connection.el @@ -43,25 +43,25 @@ (cons :connection con))) (defsubst geiser-con--request-id (req) - (cdr (assoc :id req))) + (cdr (assq :id req))) (defsubst geiser-con--request-string (req) - (cdr (assoc :string req))) + (cdr (assq :string req))) (defsubst geiser-con--request-continuation (req) - (cdr (assoc :continuation req))) + (cdr (assq :continuation req))) (defsubst geiser-con--request-buffer (req) - (cdr (assoc :buffer req))) + (cdr (assq :buffer req))) (defsubst geiser-con--request-connection (req) - (cdr (assoc :connection req))) + (cdr (assq :connection req))) (defsubst geiser-con--request-deactivate (req) - (setcdr (assoc :continuation req) nil)) + (setcdr (assq :continuation req) nil)) (defsubst geiser-con--request-deactivated-p (req) - (null (cdr (assoc :continuation req)))) + (null (cdr (assq :continuation req)))) ;;; Connection datatype: @@ -109,31 +109,31 @@ (cons :completed (make-hash-table :weakness 'value)))) (defsubst geiser-con--connection-process (c) - (tq-process (cdr (assoc :tq c)))) + (tq-process (cdr (assq :tq c)))) (defsubst geiser-con--connection-filter (c) - (cdr (assoc :filter c))) + (cdr (assq :filter c))) (defsubst geiser-con--connection-tq-filter (c) - (cdr (assoc :tq-filter c))) + (cdr (assq :tq-filter c))) (defsubst geiser-con--connection-tq (c) - (cdr (assoc :tq c))) + (cdr (assq :tq c))) (defsubst geiser-con--connection-eot (c) - (cdr (assoc :eot c))) + (cdr (assq :eot c))) (defsubst geiser-con--connection-prompt (c) - (cdr (assoc :prompt c))) + (cdr (assq :prompt c))) (defsubst geiser-con--connection-debug-prompt (c) - (cdr (assoc :debug-prompt c))) + (cdr (assq :debug-prompt c))) (defsubst geiser-con--connection-is-debugging (c) - (cdr (assoc :is-debugging c))) + (cdr (assq :is-debugging c))) (defsubst geiser-con--connection-set-debugging (c d) - (setcdr (assoc :is-debugging c) d)) + (setcdr (assq :is-debugging c) d)) (defun geiser-con--connection-update-debugging (c txt) (let* ((dp (geiser-con--connection-debug-prompt c)) diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el index 29797e6..f7ac299 100644 --- a/elisp/geiser-eval.el +++ b/elisp/geiser-eval.el @@ -175,13 +175,23 @@ module-exports, autodoc, callers, callees and generic-methods.") (concat prefix (mapconcat 'identity values nlprefix)) (or prefix "(No value)")))) -(defsubst geiser-eval--retort-output (ret) (cdr (assoc 'output ret))) -(defsubst geiser-eval--retort-error (ret) (cdr (assoc 'error ret))) +(defsubst geiser-eval--retort-output (ret) + (cdr (assq 'output ret))) -(defsubst geiser-eval--error-key (err) (cdr (assoc 'key err))) -(defsubst geiser-eval--error-subr (err) (cdr (assoc 'subr err))) -(defsubst geiser-eval--error-msg (err) (cdr (assoc 'msg err))) -(defsubst geiser-eval--error-rest (err) (cdr (assoc 'rest err))) +(defsubst geiser-eval--retort-error (ret) + (cdr (assq 'error ret))) + +(defsubst geiser-eval--error-key (err) + (cdr (assq 'key err))) + +(defsubst geiser-eval--error-subr (err) + (cdr (assq 'subr err))) + +(defsubst geiser-eval--error-msg (err) + (cdr (assq 'msg err))) + +(defsubst geiser-eval--error-rest (err) + (cdr (assq 'rest err))) (defun geiser-eval--error-str (err) (let* ((key (geiser-eval--error-key err)) -- cgit v1.2.3