[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #\a octothorpe syntax vs SRFI 10




On Tue, 4 Jan 2005, Bradd W. Szonye wrote:

>arrays, however. For those, I prefer something much terser. The proposed
>syntax is almost good enough; however, I would rather it specify the
>array /dimensions/ rather than rank. That's more consistent with
>existing extensions, like PLT's #n(...) syntax for vectors.

Now there's an interesting thought.

We could just give the dope vector directly at the array definition
for static arrays.  That would scotch the zero-size dimension problem
with the notation and it would also be more readable.

We already have a (sort-of) convention that a number preceding a
prefix code is an argument to the code; what about multiple numbers?

Thus, our 5x4x3x2 array could be written

#5*4*3*2A(...)
or
#5*4*3*2A<typespec>(...)

or similar.  I think this is better enough in terms of
being able to express zero-size dimensions, enhanced
human-readability and maintainability that I wouldn't
object to the increased verbosity. It is not compatible
with the CL prior art, but makes up for it by being
dog-easy to understand.

>Specifying the dimensions also permits a convenient shorthand for
>repetitive arrays: If there aren't enough elements for a dimension,
>simply repeat the last element. For example, #100(1) is shorthand for
>#(1 1 1 1 ... 1)

True that.  I think I like this idea better than the current
proposal.

			Bear