Skip to content
Snippets Groups Projects
Verified Commit dbd7401c authored by Vladimir Sedach's avatar Vladimir Sedach
Browse files

Renamed uri-template internal function to uri-template-to-string

parent abfc81f4
Branches
No related tags found
No related merge requests found
2019-08-17 Vladimir Sedach <vas@oneofus.la>
* uri-template.lisp (uri-encode):
Avoid copying strings.
* uri-template.lisp (uri-encode): Avoid copying strings.
(uri-template-to-string): Renamed uri-template to
uri-template-to-string, so that the internal function would
not be exported along with the template name.
2019-08-16 Vladimir Sedach <vas@oneofus.la>
......
......@@ -58,9 +58,7 @@ read-uri-template (function)
read URI templates from your own dispatch character.
uri-template (symbol)
The car of the list that the URI template reader produces. A
function or macro.
This symbol also names the named-readtables readtable that provides
This symbol names the named-readtables readtable that provides
the #U dispatch macro.
uri-template-bind (macro)
......
......@@ -49,7 +49,8 @@ The standard URI components look like:
%uri-fragment hash
%uri-head http://user@www.foo.com:8080
%uri-tail /dir/abc?bar=baz&xyz=1#hash"
;; template is expected to look like output of #U: '(uri-template &rest args)
(assert (eq (car template)
'uri-template-to-string))
(let* ((template (cdr template))
(template-vars (mapcar (lambda (x)
(car (last (second x))))
......
......@@ -23,5 +23,5 @@
(parenscript:defpsmacro uri-encode (x)
`(encode-u-r-i-component ,x))
(parenscript:defpsmacro uri-template (&rest template-args)
(parenscript:defpsmacro uri-template-to-string (&rest template-args)
`(+ ,@template-args))
......@@ -54,14 +54,11 @@ read URI templates from your own dispatch character."
,x1
(princ-to-string ,x1))))))
(defun uri-template (&rest template-args)
"The car of the list that the URI template reader produces. A
function or macro.
This symbol also names the named-readtables readtable that provides
the #U dispatch macro."
(defun uri-template-to-string (&rest template-args)
"The head of the list that the URI template reader produces. A
function or macro."
(format nil "~{~A~}" template-args))
(defun uri-template-reader (stream subchar arg)
(declare (ignore subchar arg))
`(uri-template ,@(read-uri-template stream t)))
(cons 'uri-template-to-string (read-uri-template stream t)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment