Anonymous user
Talk:Align columns: Difference between revisions
m
→poll: short or general?
Line 54:
Given that:
# The <code>9!:
# using these foreigns has side effects which would need to be reverted after the desired effect is acheived, further cluttering the solution, and
# using foreigns that control global formatting to acheive local formatting might be considered cute at best, and
# the task calls for "''allow[ing] each word in a column to be [aligned]''", which could imply the need to align words or columns independently, then
should we scrap our short (if cute) solution, and replace it with a longer, but more general solution? As a (possibly desirable) side-effect, a solution which eschewed the foreigns would be more comparable to others written in languages which lack a built-in formatting & alignment facility.
Line 88:
Example use:
colalign text NB. Default is left
'C' colalign text NB.
Or another candidate, such as:
colAlign =: 'L'&$: : (format@:align parse)
format =: [: > (,. ' '&,.)&.>/
align =: cols |."1&.>~ (<nowiki>''</nowiki>;1) <;.1 rotation
cols =: <@:>"1@:|:@:]
rotation =: (<.@*"1 2: %~ 'LCR'&i.)~ offset
Line 101:
Example of use:
colAlign text NB. Default is left
'C' colAlign text NB. Can specify a different
'RCLRCLRCLRCL' colAlign text NB. or for each column independently,
(6 12 (] {~ (?.@$ #)) 'LCR') colAlign text NB. or for each word independently.
Of course, we could include
--[[User:DanBron|DanBron]] 02:39, 3 December 2008 (UTC)
|