Raghav Gururajan <[email protected]> writes:
> (replace 'install
> (lambda _
> (for-each (lambda (solution)
> (with-directory-excursion solution
> ((assoc-ref copy:%standard-phases 'install)
> #:install-plan
> (list ("src" (string-append
> "include/" solution)
> #:include-regexp '("\\.h$"))))))
> (list
> "qtlockedfile"
> "qtpropertybrowser"
> "qtservice"
> "qtsingleapplication"
> "qtsoap"))))
[…]
> I get Wrong type to apply: "src"
As Julien wrote this is expected as you have an expression that starts
with a string:
("hello" whatever)
This will try to apply the string "hello" to the argument “whatever”. I
don’t know how to apply a string to anything, and neither does Scheme.
I would go with quasiquotation:
--8<---------------cut here---------------start------------->8---
(with-directory-excursion solution
((assoc-ref copy:%standard-phases 'install)
#:install-plan
`(("src" ,(string-append "include/" solution)
#:include-regexp ("\\.h$")))))
--8<---------------cut here---------------end--------------->8---
The expression following #:install-plan is quoted (so it’s inert data),
and we temporarily unquote to evaluate the “string-append” expression;
then we go straight back to “data mode”, so we don’t have to explicitly
quote “("\\.h$")”.
--
Ricardo