unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Reader syntax for accessing arrays
@ 2011-08-22 23:17 Panicz Maciej Godek
  2011-08-23  8:10 ` Johan Hidding
  2012-01-09 15:39 ` Andy Wingo
  0 siblings, 2 replies; 8+ messages in thread
From: Panicz Maciej Godek @ 2011-08-22 23:17 UTC (permalink / raw)
  To: guile-user

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[i][j] *= 2;

Indeed, LISP is intended for processing lists, but there are certain
tasks where dealing with
arrays is inevitable. So perhaps it would be a good idea to use square
brackets, as it is
done in C, to access arrays, so that
[a i j]
could be understood by the interpreter as
(ref-array a i j)
where ref-array is the appropriate getter with setter.

Therefore I wonder how could this functionality be implemented in
guile, or, preferably,
in generic R^5RS. [I've heard that R^6RS makes no distinction between [] and ()]

Regards
Maciek



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-01-09 15:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-22 23:17 Reader syntax for accessing arrays Panicz Maciej Godek
2011-08-23  8:10 ` Johan Hidding
2011-08-23 18:03   ` Panicz Maciej Godek
2011-08-24 10:51     ` Ludovic Courtès
2011-08-24 18:45       ` Panicz Maciej Godek
2011-08-24 19:52         ` Johan Hidding
2011-08-26 21:02           ` Panicz Maciej Godek
2012-01-09 15:39 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).