From 2fcde9c6c22368b206bd6b9eea25865a109234fe Mon Sep 17 00:00:00 2001 From: Mike Appleby <86076+appleby@users.noreply.github.com> Date: Tue, 4 Jun 2019 15:21:10 -0500 Subject: [PATCH] Convert remaining alexandria: references to spiffy new nickname a: --- src/parser.lisp | 10 +++++----- tests/printer-tests.lisp | 2 +- tests/utilities.lisp | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/parser.lisp b/src/parser.lisp index 24fc9cf48..82fe5f03c 100644 --- a/src/parser.lisp +++ b/src/parser.lisp @@ -1515,7 +1515,7 @@ INPUT-STRING that triggered the condition." (token-payload tok)))))) (eval-when (:compile-toplevel :load-toplevel :execute) - (alexandria:define-constant +quil<->lisp-functions+ + (a:define-constant +quil<->lisp-functions+ '(("SIN" . cl:sin) ("COS" . cl:cos) ("SQRT" . cl:sqrt) @@ -1527,13 +1527,13 @@ INPUT-STRING that triggered the condition." ;;; If you add a new arithmetic operator to +QUIL<->LISP-PREFIX-ARITHMETIC-OPERATORS+ or ;;; +QUIL<->LISP-INFIX-ARITHMETIC-OPERATORS+, you must also add it to *ARITHMETIC-GRAMMAR*, below. - (alexandria:define-constant +quil<->lisp-prefix-arithmetic-operators+ + (a:define-constant +quil<->lisp-prefix-arithmetic-operators+ '(("-" . cl:-)) :test #'equal :documentation "Prefix arithmetic operators usable from within Quil, and their associated Lisp function symbols.") - (alexandria:define-constant +quil<->lisp-infix-arithmetic-operators+ + (a:define-constant +quil<->lisp-infix-arithmetic-operators+ '(("+" . cl:+) ("-" . cl:-) ("/" . cl:/) @@ -1545,12 +1545,12 @@ INPUT-STRING that triggered the condition." (defun %lisp->quil (lisp-symbol alist) (check-type lisp-symbol symbol) - (alexandria:when-let ((found (rassoc lisp-symbol alist :test #'eq))) + (a:when-let ((found (rassoc lisp-symbol alist :test #'eq))) (car found))) (defun %quil->lisp (quil-string alist) (check-type quil-string string) - (alexandria:when-let ((found (assoc quil-string alist :test #'string-equal))) + (a:when-let ((found (assoc quil-string alist :test #'string-equal))) (cdr found))) ;;; The following functions handle conversion between Quil's arithmetic operators/functions and diff --git a/tests/printer-tests.lisp b/tests/printer-tests.lisp index 901ee5adc..90b3dfbf0 100644 --- a/tests/printer-tests.lisp +++ b/tests/printer-tests.lisp @@ -67,7 +67,7 @@ admonition against carelessness." ;; Ensure expected-output is a fixed point of parse -> print. In rare cases, this check ;; might fail, so skip it if we find a magic cookie at the start of the input section ;; indicating that we should do so. - (unless (alexandria:starts-with-subseq "# Disable fixed-point check" input) + (unless (a:starts-with-subseq "# Disable fixed-point check" input) (is (string= expected-output (parse-and-print-quil-to-string expected-output)) message)))) diff --git a/tests/utilities.lisp b/tests/utilities.lisp index 7e514c699..9f6d1f5f3 100644 --- a/tests/utilities.lisp +++ b/tests/utilities.lisp @@ -182,7 +182,7 @@ If SUFFIX-P is non-nil, suffix the returned string with DELIMITER." ;;; "# Output" is required; otherwise, UPDATE-GOLDEN-FILE-OUTPUT-SECTIONS will fail when attempting ;;; to parse the file. -(define-condition golden-file-parse-error (alexandria:simple-parse-error) +(define-condition golden-file-parse-error (a:simple-parse-error) ((line-number :initarg :line-number :initform 0 @@ -197,9 +197,9 @@ If SUFFIX-P is non-nil, suffix the returned string with DELIMITER." (format stream "Error while parsing golden file at line ~D." (golden-file-parse-error-line-number condition)) - (alexandria:when-let ((bad-text (golden-file-parse-error-bad-text condition))) + (a:when-let ((bad-text (golden-file-parse-error-bad-text condition))) (format stream "~&Invalid text: ~S" bad-text)) - (alexandria:when-let ((format-control (simple-condition-format-control condition))) + (a:when-let ((format-control (simple-condition-format-control condition))) (apply #'format stream (concatenate 'string "~&" format-control) (simple-condition-format-arguments condition))))) @@ -239,7 +239,7 @@ and OUTPUT slots, respectively." :format-control format-control :format-arguments format-arguments)) (stream-file-name (stream) - (alexandria:if-let ((path (uiop:truename* stream))) + (a:if-let ((path (uiop:truename* stream))) (enough-namestring path) ;; If STREAM is not a FILE-STREAM, it won't have an a TRUENAME. Just format the STREAM. (format nil "~A" stream)))) @@ -340,7 +340,7 @@ OUTPUT-CALLBACK is function from STRING -> STRING. It will be called successivel golden-file input section, and should return the corresponding output string for the given input. IF-EXISTS has the standard Common Lisp meaning. See http://l1sp.org/cl/open." - (let ((file-paths-list (alexandria:ensure-list file-paths))) + (let ((file-paths-list (a:ensure-list file-paths))) (when (or skip-prompt (y-or-n-p "Are you sure you want to clobber all the output sections of the following files?~%~@ @@ -348,7 +348,7 @@ IF-EXISTS has the standard Common Lisp meaning. See http://l1sp.org/cl/open." file-paths-list)) (dolist (file file-paths-list) (format t "~&Updating ~A" file) - (alexandria:write-string-into-file + (a:write-string-into-file (join-strings (loop :for test-case :in (parse-golden-file file) :for input := (golden-test-case-input test-case) :for output := (funcall output-callback input)