red / REP

Red Enhancement Process
BSD 3-Clause "New" or "Revised" License
10 stars 4 forks source link

Wish: make block! pair! #90

Open Oldes opened 3 years ago

Oldes commented 3 years ago

It could be possible to preallocate block size using pair! value. Now it is:

>> make block! 2x2
*** Script Error: cannot MAKE block! from: 2x2

But it could be like make block! 4 (preallocating block to hold at least 4 values)

greggirwin commented 3 years ago

I think this falls into array or table territory. Pair implies 2 axes, while blocks are flat, unless it worked as a preallocator like make block! <int>, but with sub-blocks like array.

Oldes commented 3 years ago

Block can be used as a table.. to add pair is easy.. but I understand it's not a priority.

Btw.. you talk about table quite often recently.. is there any proposal?

I often have a block with given number of columns and I hate to do new-line/skip call when I need nice output in console.. and that is just the cheapest one.. I would like to have also chance to specify column widths and colors.. having a datatype which would do formating for me would be nice.

greggirwin commented 3 years ago

We have a number of thoughts from months past, which overlap with other design elements. e.g. a formatted table is basically a spreadsheet, so ties to format and HOF.