Last active
August 29, 2015 14:21
-
-
Save pjazdzewski1990/ac21c9ce9f65da978069 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit class EncogArray1[T](val elem1: T) { | |
def |(v: T) = new EncogArray2[T](elem1, v) | |
} | |
case class EncogArray2[T](elem1: T, elem2: T) { | |
def |(v: T) = new EncogArray3[T](elem1, elem2, v) | |
} | |
case class EncogArray3[T](elem1: T, elem2: T, elem3: T) { | |
def |(v: T) = new EncogArray4[T](elem1, elem2, elem3, v) | |
} | |
case class EncogArray4[T](elem1: T, elem2: T, elem3: T, elem4: T) { | |
def |(v: T) = new EncogArray5[T](elem1, elem2, elem3, elem4, v) | |
} | |
case class EncogArray5[T](elem1: T, elem2: T, elem3: T, elem4: T, elem5: T) { | |
def |(v: T): EncogArray5[T] = throw new UnsupportedOperationException("DSL (for now) handles Arrays up to 4 elements!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment