[plt-scheme] Typed Scheme: vector-length isn't bound in the typed-scheme language
> Subject says it all.
I'm still learning Typed Scheme, so hopefully someone can correct me if
I'm going astray. I see a set of environmental definitions in the
private/base-env.ss file using Typed Scheme 1.5.
I added the following to the definition of the "initial-env" near the
bottom:
[vector-length (-poly (a) (-> (make-vec a) N))]
It probably doesn't matter where it goes as long as it's with the other
type declarations, but I put this right next to the definitions of the
types for vector->list and list->vector. Afterwards, vector-length
appeared to typecheck ok for me.
But "string-length" and "string-ref" also appears to be missing. Would
the following be correct types for those?
[string-length (-String . -> . N)]
[string-ref (-String N . -> . -Char)]
Best of wishes!