[Jprogramming] Open, padding with zeroes
Dan Bron
j at bron.us
Wed Dec 5 12:15:34 UTC 2012
Here's a previous discussion of this topic, which includes tools in the spirit of >!. :
http://www.jsoftware.com/pipermail/programming/2010-December/021289.html
-Dan
Please excuse typos; composed on a handheld device.
On Dec 5, 2012, at 5:55 AM, Roger Hui <rogerhui.canada at gmail.com> wrote:
>> The dictionary entry for Open says: 'Results of different shapes are
> padded as defined
>> in Section II B. ', but Section II B is not about padding. Should it have
> been another section?
>
> The relevant passage in II B (
> http://www.jsoftware.com/help/dictionary/dictb.htm ) is this:
>
> Commonly these individual shapes agree, but if not, they are first brought
> to a common rank by introducing leading unit axes to any of lower rank, and
> are then brought to a common shape by *padding* with an appropriate
> *fill*element: space for a character array,0 for
> a numeric array, and a boxed empty list for a boxed array. For example:
>
> The fill element used for this purpose is not subject to !. .
>
>
> On Wed, Dec 5, 2012 at 2:26 AM, Bo Jacoby <bojacoby at yahoo.dk> wrote:
>
>> Dear J'ers
>>
>> The Fit conjunction (!.) changes the default fill character like this
>> 3 ({.!.'0') '11'
>> 110
>> but Fit gives domain error with Open:
>>> '11';'111'
>> 11
>> 111
>> (>!.'0')'11';'111'
>> |domain error
>> | ( >!.'0')'11';'111'
>>
>> I want this
>> 110
>> 111
>>
>> What is the work-around?
>>
>> The dictionary entry for Open says: 'Results of different shapes are
>> padded as defined in Section II B. ', but Section II B is not about
>> padding. Should it have been another section?
>>
>> - Bo
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list