I have a :get route with easy-routes that, when hit, runs one function (quick-test). The function quick-test returns two values. Both are strings.
(easy-routes:defroute test-file ("/test-file" :method :get) (&get filename)
(quick-test filename))
However, when the form is sent to "/test-file", only one line is visible in the dom.
I then tried using multiple value bind. But the result is the same.
(easy-routes:defroute test-file ("/test-file" :method :get) (&get filename)
(multiple-value-bind (a b) (quick-test filename)
(values (format nil "~a" a)
(format nil "~a" b))))
My goal is to be able to run quick test and see all returned values on the dom.
Is there a way to do that?
For completeness, here is the form:
<form id="form" action="/test-file" method="get">
<input type="text" name="filename" placeholder="type the filename"/>
<input type="submit" value="Send"/>
</form>
Valuescan return more values, but if your function expects some expression, it takes only the first returned value and discards the rest. For example,floorreturns two values, but+takes only the first:This question can also help you: values function in Common Lisp
Defrouteprobably does the same and takes only the first value.You can fix your route for example like this: