Category:J: Difference between revisions

Content added Content deleted
m (fix types typo)
Line 84: Line 84:
=== Types ===
=== Types ===


Perhaps also worth noting is that when thinking about J programs, it can be convenient to think of an instance of an array as a type. This is somewhat different from the usual treatment of type (where all potential values in a context are treated as a type).
Perhaps also worth noting is that when thinking about J programs, it can be convenient to think of an instance of an array as a type. This is in some ways different from the usual treatment of type (where all potential values in a syntactic context are treated as a type but the types are typically far more constrained than "an array").


J's type hierarchy supports arrays of arbitrary size and dimension, and array contents may be numeric, character or boxed. Thus, for example, we might work with an array of boxes, each box containing a one dimensional array of characters -- or, informally: strings.
J's type hierarchy supports arrays of arbitrary size and dimension, and array contents may be numeric, character or boxed. Thus, for example, we might work with an array of boxes, each box containing a one dimensional array of characters -- or, informally: strings.