"Fraser Jackson" <[EMAIL PROTECTED]> wrote:
> The following using the r beta has some behaviour I do not understand. On 
> testing it appears unchanged from J601.

Here is a simplier example that shows this (works in J 4.06d-6.02):
   <"0 $. 2 3
|nonce error
|       <"0$.2 3
   [b =: <@]"0 $. 2 3
0 | +-+
1 | |2|
  | +-+
  | |3|
  | +-+
   3!:0 b
32768
   [c =: ({&a.)"0 $. 97 98
0 | a
1 | b
   3!:0 c
2048

I would guess that the J interpreter may "largely" support
sparse box and character arrays, but that there are certain issues
that might produce undesirable behavior (which is why they're disabled),
Special code for < sensibly checks this, but that is circumvented by <@]

So far, I have found several such anomalies:
1) Monadic ". works with sparse characters, but dyadic ". does not
2) sparse boxes cannot be opened (Open and Raze have no effect;
   However, >"0 DOES work)
3) L. L: and S: on sparse boxes crash the interpreter.
4) Attempts to produce sparse extended/rational/unicode/symbol arrays using
   similar techniques produce syntax errors (rather than domain or nonce errors)

   u: c
|domain error
|       u:c
   u:"0 c
|syntax error
|   u:"0 c
   u:"0 $.^:_1 c
ab

For experimentation, characters can be transparently
coerced into sparse form:
   sparsec =: {&a."0@:$.@:(a.&i.)
   sparsec 'hi'
0 | h
1 | i

-- Mark D. Niemiec <[EMAIL PROTECTED]>

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to