Groups | Search | Server Info | Login | Register


Groups > comp.lang.misc > #11726

Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays

From ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups comp.lang.misc
Subject Re: Algol 68 (or generally) - arbitrarily nested arrays of arrays
Date 2025-12-28 23:22 +0000
Organization Stefan Ram
Message-ID <algorithms-20251229001717@ram.dialup.fu-berlin.de> (permalink)
References (1 earlier) <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>

Show all headers | 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 | NextPrevious in thread | Next in thread | Find similar


Thread

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