Function: nrepl--normalize-port

nrepl--normalize-port is a byte-compiled function defined in nrepl-client.el.

Signature

(nrepl--normalize-port PORT)

Documentation

Return PORT as a string, whatever it arrived as.

Ports are strings throughout the client, but a number is the natural thing to hand to nrepl-connect or cider-connect from Lisp. Accepting both and settling on one keeps the equal comparisons that match sessions and REPLs from failing on a number that looks just like the string beside it.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260920.725/nrepl-client.el
(defun nrepl--normalize-port (port)
  "Return PORT as a string, whatever it arrived as.
Ports are strings throughout the client, but a number is the natural thing
to hand to `nrepl-connect' or `cider-connect' from Lisp.  Accepting both and
settling on one keeps the `equal' comparisons that match sessions and REPLs
from failing on a number that looks just like the string beside it."
  (if (numberp port)
      (number-to-string port)
    port))