Functional Programming with Sequence Variables: The Sequentica Package
Mircea Marin, Johann Radon · 2008
Sequence variables are an advanced feature of modern languages which allows to program in a declarative and easy to understand way. Functional programming with sequence variables relies on the choice of a matcher, which in general is not unique. We propose a number of idioms for programming with sequence variables which enable the user to control the choice of the matcher. To this end we have developed the package Sequentica, which extends the language of Mathematica with our programming constructs. Our extensions enable (1) to control the selection of matcher by annotating sequence variables with priorities and ranges for their lengths, and (2) to compute optimum values characterized by a score function which must be optimized. We illustrate the usefulness of our extensions and describe how they have been implemented.