I'd like to use CodeFormatterPrint to serialize definitions and a canonical but readable way. For this, all the code it produces should, when evaluated, restore the definitions I had in place.
But this does not always work:
ClearAll@f
f[veryveryveryveryveryveryveryverylongname,
veryveryveryveryveryveryveryverylongname] /; a > 0 := a;
CodeFormatterPrint@f
produces
f[
veryveryveryveryveryveryveryverylongname,
veryveryveryveryveryveryveryverylongname
]
/;
(a > 0) :=
a
which cannot be parsed correctly because /; stands on its own.
/; should be at the end of the line above such that the expression is not yet complete.
I'd like to use
CodeFormatterPrint
to serialize definitions and a canonical but readable way. For this, all the code it produces should, when evaluated, restore the definitions I had in place.But this does not always work:
produces
which cannot be parsed correctly because
/;
stands on its own./;
should be at the end of the line above such that the expression is not yet complete.