brownplt / pyret-lang

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

table.js' `getRow[Content]As{Record,Getter,RecordFromHeaders}` considered harmful? #1353

Closed blerner closed 6 years ago

blerner commented 6 years ago

getRowAsRecord is never used. I'm not sure what the others do, exactly, but they don't produce Rows (meaning, branded values), which means the following code

fun num-is-even(n): num-modulo(n, 2) == 0 end
table: a row: 2 end.build-column("oops", num-is-even)

leaks implementation details: image If the return value from getRowContentAsGetter were branded, the rendering would appear as a Row value as it should.

blerner commented 6 years ago

This doesn't appear fixed on horizon yet: I'm seeing the same output as above. It's fixed for me locally, though -- maybe pyret-horizon.herokuapp hasn't been refreshed for some reason?

blerner commented 6 years ago

(Oh right, we needed to push to CPO also in order for this to update pyret-horizon. Nvm.)