The effect you are seeing is from boxed display
and has nothing to do with the dyad ": or laminate.

   ] a=: 'aa';'bbbbbbbb'
+--+--------+
|aa|bbbbbbbb|
+--+--------+
   ] b=: 'cccc';'dddd'
+----+----+
|cccc|dddd|
+----+----+
   2 2$a,b
+----+--------+
|aa  |bbbbbbbb|
+----+--------+
|cccc|dddd    |
+----+--------+

In boxed display, the contents of each box is put
into the upper left corner of its space.  You can 
explore the details of boxed display in
http://www.jsoftware.com/jwiki/Essays/Boxed_Array_Display



----- Original Message -----
From: Bill Harris <[EMAIL PROTECTED]>
Date: Thursday, April 5, 2007 11:21 am
Subject: Re: [Jprogramming] ": error?

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Roger Hui <[EMAIL PROTECTED]> writes:
> 
> > I box the results to show better any justification.
> 
> That makes sense.
> 
> > When there is only one number it's hard to see the
> > justification, if any.  Use more than one number.
> 
> I did, and I get your results:
> 
>     < 10j2 ": 11^i.5 1
> +----------+
> ¦      1.00¦
> ¦     11.00¦
> ¦    121.00¦
> ¦   1331.00¦
> ¦  14641.00¦
> +----------+
>   < 0j2 ": 11^i.5 1
> +--------+
> ¦    1.00¦
> ¦   11.00¦
> ¦  121.00¦
> ¦ 1331.00¦
> ¦14641.00¦
> +--------+
> 
> But...
> 
> Try this:
> 
> ,----[ 29.ijs ]
> | a=: 'Line 1'; 10j2 ": 12345.67
> | a=: a,:'Line 2'; 10j2 ": 6543.21
> |
> | b=: 'Line 1'; 0j2 ": 12345.67
> | b=: b,:'Line 2'; 0j2 ": 6543.21
> `----
> 
> ,----[ Fresh ijx session ]
> |   load 'c:\program files\j601\temp\29.ijs'
> |    a
> | +-----------------+
> | ¦Line 1¦  12345.67¦
> | +------+----------¦
> | ¦Line 2¦   6543.21¦
> | +-----------------+
> |    b
> | +---------------+
> | ¦Line 1¦12345.67¦
> | +------+--------¦
> | ¦Line 2¦6543.21 ¦
> | +---------------+
> |    9!:14''
> | j601/2006-11-17/17:05
> |   $ each a
> | +----+
> | ¦6¦10¦
> | +-+--¦
> | ¦6¦10¦
> | +----+
> |   $ each b
> | +---+
> | ¦6¦8¦
> | +-+-¦
> | ¦6¦7¦
> | +---+
> `----
> 
> I almost I see what's going on, but I'm still confused.  6543.21 is
> right-justified in it's space.  As the DoJ says "enough space is
> allocated" and the number is only 7 wide, it's shoved up against the
> right of it's 7-character-wide space.  When I create B, ,: seems to
> extend the cell with 6543.21 by appending a space, which then 
> messes up
> the right justification.
> 
> Except the definition of laminate says it reshapes atomic 
> arguments, and
> neither argument to ,: seem to be atomic.  
> 
> And except that $ each b says the length is still 7, not 8.
> 
> What am I misunderstanding?
> 
> Thanks,
> 
> Bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to