brownplt / pyret-lang

The Pyret language.
Other
1.07k stars 109 forks source link

Tables' `select-columns` is broken #1348

Closed blerner closed 6 years ago

blerner commented 6 years ago
table-examp = table: name :: String, age :: Number, favorite-color :: String, height :: Number, male :: Boolean
  row: "Bob", 12, "blue", 62, false
  row: "Alice", 17, "green", 55, true
  row: "Eve", 13, "red", 70, false
end

table-examp.select-columns([list: "name", "age", "favorite-color", "height", "male"])

causes an internal error. This is specifically triggered when the number of selected columns is greater than the number of rows, because the arrays are sized incorrectly in table.js.

blerner commented 6 years ago

Will be fixed by https://github.com/brownplt/pyret-lang/commit/2ed73b0db3945f180589ee01001fa5057e08ed88, once that merges to horizon.