gregspurrier / shen-ruby

ShenRuby is a port of the Shen programming language to Ruby
Other
76 stars 7 forks source link

Coerce Ruby Arrays to Vectors? #12

Closed deech closed 9 years ago

deech commented 10 years ago

This isn't an issue but a suggestion for the next version. How would you feel about coercing Ruby Arrays to vectors instead of cons lists? This way the length attribute can be preserved and to me it seems like a more intuitive mapping.

gregspurrier commented 9 years ago

With the new KLambda backend introduced in 0.11.0 and the Shen->Ruby interop introduced in 0.12.0, I decided to take the approach of requiring an explicit choice between lists and vectors when converting ruby Enumerables to Shen data types.

This gives better performance and doesn't constrain the user.