morphism-values.org 1.4 KB

Parameter Morphisms might require pulling parameter values or package names

For example, a generic without-tests will need the package name (--without-tests=package-name)

#:PACKAGE-NAME and #:PARAMETER-VALUE may be used for these

Seamlessly concatenate with strings in the cdr

Using keywords makes it seamlessly extensible - no new syntax for new additions

Example

Morphisms to compile a package without tests and with the master branch


  (parameter/morphism #:transform (without-tests . #:PACKAGE-NAME)
                                  (with-branch . #:PACKAGE-NAME "=master"))

Morphisms to compile a package with a GCC optimization level specified by an enumerated parameter


  (parameter/morphism #:transform (with-configure-flag . "-O" #:PARAMETER-VALUE))

Note that capitalization of the keywords is purely for the purpose of emphasis. Another interesting thing to note is that #:parameter-value does not need any arguments. This is because morphism-match assigns morphisms parameter-wise, and we can pull the value from that. For example if we had a local branch morphism with values old, master and stable,


  (parameter/morphism #:transform (with-branch . #:PACKAGE-NAME "=" #:PARAMETER-VALUE))

TODO Ask Pjotr and Gabor for more possible keywords

Will give us the precise value at the branch.