     init( x: Float, y: Float, z: Float ) {
         self.v = [x,y,z]
     }
+    var lensq: Float {
+        return v[0] * v[0] + v[1] * v[1] + v[2] * v[2]
+    }
+    var length: Float {
+        return sqrt( self.lensq )
+    }
 }
 
-
 struct Vec4: Vector {
-    var count = 4
+    let count = 4
     private var v = [Float]( count: 4, repeatedValue: 0.0 )
     subscript( index: Int ) -> Float {
         get             { return v[index]     }

// unsafe base

protocol Vector {
    subscript( index: Int ) -> Float { get set }
}

struct Vec<T:Nat>: Vector {
    private var v = [Float]( count: T.literal(), repeatedValue: 0.0 )
    subscript( index: Int ) -> Float {
        get {
            return v[index]
        }
        set( newValue ) {
            v[index] = newValue
        }
    }
}


}

struct Vec2: Vector, SpecializedVector {
    let count = 2
    private var v = [Float]( count: 2, repeatedValue: 0.0 )
    subscript( index: Int ) -> Float {
        get             { return v[index]     }
