Groups | Search | Server Info | Login | Register
Groups > comp.lang.misc > #11726
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | ram@zedat.fu-berlin.de (Stefan Ram) |
| Newsgroups | comp.lang.misc |
| Subject | Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays |
| Date | 28 Dec 2025 23:22:27 GMT |
| Organization | Stefan Ram |
| Lines | 27 |
| Expires | 1 Jan 2027 11:59:58 GMT |
| Message-ID | <algorithms-20251229001717@ram.dialup.fu-berlin.de> (permalink) |
| References | <10ilrbc$25ihi$10@dont-email.me> <10ir98e$4b53$1@dont-email.me> <loops-20251228151118@ram.dialup.fu-berlin.de> <algol-20251228152842@ram.dialup.fu-berlin.de> <counting-20251228154105@ram.dialup.fu-berlin.de> <python-20251228154513@ram.dialup.fu-berlin.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | news.uni-berlin.de kSYu3MXu2FnEXMtAU+r7gQ3ktJC/B55G3eVRHgpSFM9wVi |
| Cancel-Lock | sha1:6aTbjQeJjinWtXOa3IQfdNlMNEY= sha256:x/kWrsFTepOlqE9KwnIUVN8Sd86PToIrKjjQ7m32D0s= |
| X-Copyright | (C) Copyright 2025 Stefan Ram. All rights reserved. Distribution through any means other than regular usenet channels is forbidden. It is forbidden to publish this article in the Web, to change URIs of this article into links, and to transfer the body without this notice, but quotations of parts in other Usenet posts are allowed. |
| X-No-Archive | Yes |
| Archive | no |
| X-No-Archive-Readme | "X-No-Archive" is set, because this prevents some services to mirror the article in the web. But the article may be kept on a Usenet archive server with only NNTP access. |
| X-No-Html | yes |
| Content-Language | en |
| Xref | csiph.com comp.lang.misc:11726 |
Show key headers only | View raw
ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted: >ranges =[ range( b ) for b in [ 2, 3, 2, 2 ]] >for digits in itertools.product( *reversed( ranges )): print( *digits ) And readers who do not know Python well might think: "There are surely some large data structures created there. Could this go out of memory?" But Python generates everything only on demand, so the expressions just denote /algorithms/, not data structures! Or, algorithms disguised as data structures. (For example, when you write "range(1000)" in Python, it's a kind of sequence of 1000 numbers you can iterate through as if it was an array of 1000 numbers, but this is just an illusion; in fact, it only needs much less memory than an array of 1000 numbers would need.) It's a bit like in SQL where executing a JOIN also does not mean the cartesian product it is based on is actually generated as data in memory or on disk. In C++, templates are executed at compile time, so they cannot be used to implement algorithms that are intended to be based on run-time data.
Back to comp.lang.misc | Previous | Next — Previous in thread | Next in thread | Find similar
Algol 68 (or generally) - arbitrarily nested arrays of arrays Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-12-26 12:25 +0100
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays Andy Walker <anw@cuboid.co.uk> - 2025-12-28 12:53 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays ram@zedat.fu-berlin.de (Stefan Ram) - 2025-12-28 14:13 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays ram@zedat.fu-berlin.de (Stefan Ram) - 2025-12-28 14:29 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays ram@zedat.fu-berlin.de (Stefan Ram) - 2025-12-28 14:41 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays ram@zedat.fu-berlin.de (Stefan Ram) - 2025-12-28 14:45 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays ram@zedat.fu-berlin.de (Stefan Ram) - 2025-12-28 23:22 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-12-28 15:53 +0100
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-12-28 15:47 +0100
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays Andy Walker <anw@cuboid.co.uk> - 2025-12-30 16:29 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-01-01 12:21 +0100
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays David Brown <david.brown@hesbynett.no> - 2026-01-01 17:18 +0100
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays bart <bc@freeuk.com> - 2025-12-28 15:32 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-12-28 23:48 +0100
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-12-28 22:54 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays bart <bc@freeuk.com> - 2025-12-28 23:07 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-12-28 23:29 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays antispam@fricas.org (Waldek Hebisch) - 2025-12-28 21:43 +0000
Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-12-28 23:50 +0100
csiph-web