Alex Giannakopoulos wrote:
On 17 November 2012 02:39, Raul Miller <rauldmil...@gmail.com> wrote:
On Fri, Nov 16, 2012 at 11:53 AM, Alex Giannakopoulos
then cheap tricks like "padding" to read will have to be discarded,
and something more serious adopted. (I mean, you're not going to
pad a 3-d cube with 6 copies of itself, are you? LOL)
Why not?
For contrast, in lisp, it's traditional to use lists which double the
storage needed to represent a list of numbers
[...etc]
Also, on my phone, I've numerous applications I do not use and which I
cannot turn off which each occupy about 8MB. In contrast, six copies
of a 3D tic-tac-toe board is probably about 1k of memory...
That's an interesting perspective Raul, thanks.
However, my concern was not the saving of 1k mem, but a deeper elegance
issue. I may be wrong here, I don't know, but I always prefer my data to
exist as only one copy, and as many references to it as are needed.
The perfect opportunity to (re)read
Compilation and delayed evaluation in APL
Leo J. Guibas, Douglas K. Wyatt
POPL '78
Proceedings of the 5th ACM SIGACT-SIGPLAN symposium on Principles of
Programming Languages
Pages 1-8
1978
http://dl.acm.org/citation.cfm?id=512761
for the idea of delaying evaluation of data accessors. You could have several
views with different transformations onto the same data, without having to have
several copies of the data. As a J programmer you shouldn't have to think like
that, as long as the implementors of J think like that.
... peter
And while a 3D tic-tac-toe is not that taxing on memory, the same can't be
said of 10k x 10k x 10k cellular automaton.
Anyway, I'll see how it goes once I write it. Thanks for all your help.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm