Vectors & Vector Literals

It seems reasonable to include vectors in Better Scheme. However some questions arise in their use.

  1. Should they be resizeable?
  2. Should we have Scheme style vector literals? e.g. #(1 2 3)
  3. Should [ ] be used to represent vectors?

It seems that if vectors are to be included they should be provided equal status with lists. This would indicate not including Scheme style vector literals as there is no equivalent for lists. Also, using brackets for vectors allows quoted brackets to be used for vector literals. This would require giving vectors an equivalent evaluation semantics to lists. This all may be reasonable if Better Scheme is used for scripting and so vectors are not second class citizens.

Resolution

Bracket style vectors were added. This makes them first-class like lists. They are not resizeable. The evaluation semantics of vectors are identical to that of lists. They can be used in macro patterns where they a synonymous with lists. Macro patterns match lists and vectors equally.



jwalker@cs.oberlin.edu