kyonifer / koma

A scientific computing library for Kotlin. https://kyonifer.github.io/koma
Other
270 stars 23 forks source link

Add convenience method for re-using existing ValidationContexts #19

Closed drmoose closed 7 years ago

drmoose commented 7 years ago

This PR adds a simple convenience function that I've added as an extension method elsewhere on projects that use golem. It allows one to intuitively re-use a validation context thus:

ctx.validate {
    /* your validation here */
}

instead of the more verbose and unintuitive

ctx.apply {
    /* your validation here */
    validate()
}