On Tue 23 Aug 2011 01:17, Panicz Maciej Godek writes:
> (array-set! a (* (array-ref a i j) 2) i j))
> seems to be unnecessarily prolix, for in C, language designed
> specifically to access arrays,
> the same operation could be written as
> a[i][j] *= 2;
With the appropriate macrology, it could l
Howdie,
I would agree that specifying a rigid behavior for [] and {} brackets
is pretty far away from the minimalistic spirit of scheme. However,
section 7.1.1 of R5RS specification states, that characters [, ], {, }
and | are "reserved for further extension of the language".
(R6RS, on the other h
Hi,
I think it is a question of philosophy. The suggested [] syntax
contains the scent of both infix notation (would [7 '* 6] work?) and
work on arrays in stead of lists (also in the case of object member
reference; the most straight forward implementation would be having a
memory offset assigned t
Hello,
>>> Otherwise you could make a wrapper around the array in the form of a
>>> closure. In that case, your example could be written
>>> (*=! (a i j) 2)
>
> You could even write macros for this. I would actually find it more
> elegant than additional syntax.
The *=! operator could be easily
Hi,
Panicz Maciej Godek skribis:
>> Hi Maciej,
>> I've been thinking among the same lines. At the same time this syntax could
>> be used to access members of a 'struct' or 'class' object. It should be
>> relatively simple to write a small interpreter (or maybe a pre-compiler).
>
> I thought that
> Hi Maciej,
> I've been thinking among the same lines. At the same time this syntax could
> be used to access members of a 'struct' or 'class' object. It should be
> relatively simple to write a small interpreter (or maybe a pre-compiler).
I thought that maybe it could be achieved using the guile
Hi Maciej,
I've been thinking among the same lines. At the same time this syntax could
be used to access members of a 'struct' or 'class' object. It should be
relatively simple to write a small interpreter (or maybe a pre-compiler).
Otherwise you could make a wrapper around the array in the form of
Hi,
I've noticed that one of the biggest inconveniences of lisp is a very
clumsy way of accessing arrays.
Having to write
(array-set! a (* (array-ref a i j) 2) i j))
seems to be unnecessarily prolix, for in C, language designed
specifically to access arrays,
the same operation could be written as
a