• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Counting the items in anested list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Counting the items in anested list


  • Subject: Re: Counting the items in anested list
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 17 May 2001 11:58:46 -0700

On 5/17/01 9:12 AM, "garbanzito" <email@hidden> wrote:

> at 5/16/01, 3:49 PM -0600, they whom i call Ehsan Saffari wrote:
>>
>> looks like a repeat loop is the only answer.
>
> not necessarily:
>
> -- counts non-list items in nested lists

Steve, Ehsan wasn't trying to count non-list items. He was trying to count
the "basic" lists {"a, "b"}, {"c", "d"}, {"e", "f"} (namely 3) etc. whether
they occur as ordinary items or as sub-items of compound sublists such
{{"c", "d"}, {"e", "f"}} or as sub-sub-sub items, etc. within a master-list
such as

{{"a", "b"}, {{"c", "d"}, {"e", "f"}}}

That's what he told us at the beginning. Running your script gets the number
of strings (6), not the number of lists of the form {m, n}, namely 3.


He's trying to get every item or sub-item which is itself a list but which
doesn't itself have any further lists as subitems. I managed that with a
repeat loop incorporating a recursive handler. (Check my last post.) See if
you can do away with the repeat loop if you can.

--
Paul Berkowitz


  • Follow-Ups:
    • Re: Counting the items in anested list
      • From: garbanzito <email@hidden>
References: 
 >Re: Counting the items in anested list (From: garbanzito <email@hidden>)

  • Prev by Date: Re: Extracting image data from Quark
  • Next by Date: Re: Scope of globals, parents and children, "load script" and all that jazz
  • Previous by thread: Re: Counting the items in anested list
  • Next by thread: Re: Counting the items in anested list
  • Index(es):
    • Date
    • Thread