sorry, mistyped to2 to2 =: [: <"1 [: ,."0/&>/ [ +&.> [: i.@:>:&.> -~
----- Original Message ----- From: Brian Schott <[email protected]> To: Programming forum <[email protected]> Cc: Sent: Monday, August 18, 2014 5:32:43 PM Subject: Re: [Jprogramming] dsl for spreadsheet like input selectors I am not getting good results with to2. I am playing with the following. CP=: {@(,&<) cross =: [: CP &>/< @:i.@>:"0 0 1 -.~&(,&cross) 2 3 ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ │0 2│0 3│1 0│1 1│1 2│1 3│2 0│2 1│2 2│2 3│ └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ On Mon, Aug 18, 2014 at 4:25 PM, 'Pascal Jasmin' via Programming < [email protected]> wrote: > spreadsheets have a range selection syntax like A1:C3&F4~B2 which means > the block range from A1 to C3 with the cell F4 added, and the cell B2 > removed. > > Ignoring the letter conversions, here are some useful J functions for > building a list of selectors (can be used with both { and }). Conjunctions > are used for their power to be higher precedence functions, and reduction > of parentheses. Perhaps the only really neat feature of this dsl is the > use of conjunctions, as the functions themselves are pretty simple. At the > same time, the conjunctions might get in the way if using these functions > within forks. > > the 3 core spreadsheet combiners: > > to2 =: ( [: <"1 [: ,."0/&>/ [: i.@:>: each -~) > to =: 2 : 'm ,@:to2 n' > and=: ~.@:,&boxopen > less =: -.&boxopen > > -- (B=) ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
