Package

nl.rabobank.oss.rules

utils

Permalink

package utils

Visibility
  1. Public
  2. All

Type Members

  1. case class FileSourcePosition(fileName: String, line: Int, column: Int, offset: Int, length: Int) extends SourcePosition with Product with Serializable

    Permalink
  2. sealed trait SourcePosition extends AnyRef

    Permalink
  3. case class SourceUnknown() extends SourcePosition with Product with Serializable

    Permalink

Value Members

  1. object FactMacros

    Permalink

    FactMacros contains two compile-time macros which allow the easy creation of a Fact, without having to explicitly repeat the name of the Fact as an argument.

    FactMacros contains two compile-time macros which allow the easy creation of a Fact, without having to explicitly repeat the name of the Fact as an argument. This makes it easier to define Facts for use in a DSL, as the name of the val to which it is assigned, becomes the name of the Fact itself.

    Without these macros, you would need to create Facts as follows:

    val MyFact = new SingularFact[Int]("MyFact")

    This redundancy of the Fact's name is not just a nuisance to type, it actually causes trouble when renaming the Fact, or trying to copy its declaration. In both situations, you *must* also alter the name parameter manually. The compiler and IDE tooling cannot help you track these errors down and so you are bound to find out about them at runtime, with potentially uninformative error messages.

    If instead, you use these macros, these troubles will be taken away. Define your Facts like this and have the IDE and compiler warn you about duplicate names etc:

    val MyFact = FactMacros.defineFact[Int]("Description")

  2. object PrettyPrinter

    Permalink

Ungrouped