SRFI-10 syntax vs. #nA syntax Aubrey Jaffer (03 Jan 2005 05:23 UTC)
Re: SRFI-10 syntax vs. #nA syntax bear (03 Jan 2005 06:01 UTC)
Re: SRFI-10 syntax vs. #nA syntax Per Bothner (03 Jan 2005 06:37 UTC)
Re: SRFI-10 syntax vs. #nA syntax Aubrey Jaffer (03 Jan 2005 19:16 UTC)
Re: SRFI-10 syntax vs. #nA syntax Bradd W. Szonye (04 Jan 2005 22:28 UTC)
Re: SRFI-10 syntax vs. #nA syntax Per Bothner (04 Jan 2005 23:03 UTC)
Re: SRFI-10 syntax vs. #nA syntax Bradd W. Szonye (05 Jan 2005 01:59 UTC)
Re: SRFI-10 syntax vs. #nA syntax Per Bothner (05 Jan 2005 02:13 UTC)
Re: SRFI-10 syntax vs. #nA syntax Bradd W. Szonye (05 Jan 2005 03:08 UTC)
Re: SRFI-10 syntax vs. #nA syntax Per Bothner (05 Jan 2005 03:39 UTC)
Re: SRFI-10 syntax vs. #nA syntax Shiro Kawai (05 Jan 2005 02:39 UTC)
Re: SRFI-10 syntax vs. #nA syntax Bradd W. Szonye (05 Jan 2005 02:48 UTC)
Re: SRFI-10 syntax vs. #nA syntax Taylor Campbell (03 Jan 2005 22:40 UTC)
Re: SRFI-10 syntax vs. #nA syntax Bradd W. Szonye (05 Jan 2005 00:07 UTC)
Re: SRFI-10 syntax vs. #nA syntax Matthias Radestock (05 Jan 2005 01:25 UTC)
Re: SRFI-10 syntax vs. #nA syntax Bradd W. Szonye (05 Jan 2005 02:41 UTC)
Re: SRFI-10 syntax vs. #nA syntax Taylor Campbell (05 Jan 2005 02:52 UTC)
Re: SRFI-10 syntax vs. #nA syntax Aubrey Jaffer (05 Jan 2005 03:25 UTC)
Re: SRFI-10 syntax vs. #nA syntax Bradd W. Szonye (05 Jan 2005 03:54 UTC)

Re: SRFI-10 syntax vs. #nA syntax Per Bothner 05 Jan 2005 02:13 UTC

Bradd W. Szonye wrote:

>>There is also a problem in that the syntax fails in the case of rank-0
>>arrays.  That is an argument for leaving in the 'A'.
>
> I have a better solution: If the "array" has rank 0, also omit the "#"!
> After all, that's what the Scheme writer will do when printing a scalar.

In APL, a rank-0 array is the same as a scalar.  In Scheme, it would be
difficult to make them the same.  One reason is mutability: a rank-0
array in Scheme and Common Lisp is actually a cell that contains a
mutable value.  Even thpugh we talking about literals which are
upposed to be immutable, that doesn't solve the problem whether the
dereferencing is automatic or not: a 0-rank mutable array is a cell,
which is different from the value stored in it.  I.e. getting its value
requires some kind of array-ref function call.  An immutable value is
one where setting is prohibited (undefined), but getting uses the same
functions as for accessing a mutable value.  Hence,  scalar cannot be
equivalent to a rank-0 array in Scheme, even though it is the same in
APL.

> I don't think the reader/writer/programmer interface needs to support an
> array syntax for 0-rank "arrays," however. Indeed, I suspect that it
> shouldn't, because it just introduces a "noise" token that can obfuscate
> data but provide no real information.

The difference is that between a cell and the value stored in the cell.
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/