You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A deeper refactor is needed but I'll postpone it since it is a long refactor that may break some functionality (special care is needed).
The idea is simple. Define the routine below and delete the url methods that specialize over string and quri:uri.
(defuncoerce-to-url (url-designator)
"Ensure URL-DESIGNATOR is of type `quri:uri'."
(typecase url-designator
(string (quri:uri url-designator))
(quri:uri url-designator)))
Redefine the url-designator type as below.
(deftypeurl-designator ()
"A URL designator type is either a string or a `quri:uri'."`(orstringquri:uri))
These 2 ideas will enable refactoring the following odd idiom,
As to ensure that convert strings to
quri:uri
objects, we have defined:url
methods for strings and quri:uriensure-url
string->url
strings->urls
Also we have defined the type
url-designator
, as to accommodate that a URL may be of typequri:uri
orstring
, but that seems a bit premature.The text was updated successfully, but these errors were encountered: