Execute HQ9+/Common Lisp: Difference between revisions

m
Fixed syntax highlighting.
(use case instead of cond, don't put an extra newline in quining)
m (Fixed syntax highlighting.)
 
(2 intermediate revisions by 2 users not shown)
Line 1:
{{implementation|HQ9+}}{{collection|RCHQ9+}}[[Category:Common Lisp]]
=={{header|Common Lisp}}==
{{implementation|HQ9+}}{{collection|RCHQ9+}}[[Category:Common Lisp]]
 
The interpreter (in [[Common Lisp]]) accepts a string, treated as program text, or a pathname object, in which case the contents of the file are the program text.
 
<langsyntaxhighlight lang="lisp">(defun slurp (filespec)
"Return the contents of the file as a string."
(with-output-to-string (out)
Line 35 ⟶ 34:
Go to the store and buy some more~%~
99 bottles of beer on the wall.~%")))
finally (return accumulator)))</langsyntaxhighlight>
9,482

edits