Skip to content

Instantly share code, notes, and snippets.

@WtzLAS
WtzLAS / Main.scala
Created March 26, 2023 19:40
Scala 3 Dependent Vec
import scala.compiletime.ops.*
import scala.compiletime.ops.int.*
import scala.reflect.ClassTag
import java.util.Scanner
class Vec[N <: Int, A: ClassTag](using ValueOf[N])(val arr: Array[A]):
def size() = valueOf[N]
def print() = for i <- 0 until valueOf[N] do println(arr(i))

Keybase proof

I hereby claim:

  • I am wtzlas on github.
  • I am wtz_lasr (https://keybase.io/wtz_lasr) on keybase.
  • I have a public key ASCPHUN5yao5tZUR6iG5EjYBNJ1KFQ2qL55fstUZcRKbzQo

To claim this, I am signing this object: