From: Rick M. <obj...@gm...> - 2007-04-19 11:55:35
|
One problem I keep having with suppliers is remembering to code the "s~next" at the end of my loops. It would be nice if DO/LOOP directly supported iteration over a supplier, at least the mechanics part. I see two possible ways to do this: 1) Have the loop just handle the stepping of the next element: DO s SUPPLIER expr say s~index 'is' s~item END 2) Have supplier handle assignment of both the item and index to variables for you. DO item, index SUPPLIER expr say index 'is' item END NOTE: I am not suggesting either of these as the syntax. I'm frankly at a point where I don't have a syntax I particularly like for either of these. I just picked something out of thin air to have a conceptual starting point. My personal preference is option 2), but that presents the greater syntax challenge. I do think is much easier to work with in the loop body. Rick |
From: Rony G. F. <Ron...@wu...> - 2007-04-19 14:55:25
|
Rick McGuire wrote: > One problem I keep having with suppliers is remembering to code the > "s~next" at the end of my loops. It would be nice if DO/LOOP directly > supported iteration over a supplier, at least the mechanics part. > > I see two possible ways to do this: > > 1) Have the loop just handle the stepping of the next element: > > DO s SUPPLIER expr > > say s~index 'is' s~item > > END This looks more "generic" and easier to memorize as its pattern looks very much like "DO s OVER expr". Just a question: would a "FOR" statement be allowed on this one? Like: DO s SUPPLIER myQueue~supplier FOR 3 -- process the first three index/items pairs at the most say s~index":" s~item END --- Ad supplier: one piece of information that I am missing is an "ITEMS" method returning the number of items that the supplier has. This becomes important, if one receives a supplier object, but has no means to get independently to the collection itself (e.g. the suppliers that get returned by .Class' METHODS or .Object's INSTANCEMETHODS and the like). Regards, ---rony |
From: Rick M. <obj...@gm...> - 2007-04-19 15:02:03
|
FOR is not allowed on DO OVER, so I don't see any reason why it would be allowed on a supplier variation either. Discussion of allowing FOR on other than the repetitive form is something that should be considered separately from this issue. Rick On 4/19/07, Rony G. Flatscher <Ron...@wu...> wrote: > > > Rick McGuire wrote: > > One problem I keep having with suppliers is remembering to code the > "s~next" at the end of my loops. It would be nice if DO/LOOP directly > supported iteration over a supplier, at least the mechanics part. > > I see two possible ways to do this: > > 1) Have the loop just handle the stepping of the next element: > > DO s SUPPLIER expr > > say s~index 'is' s~item > > END > > This looks more "generic" and easier to memorize as its pattern looks very > much like "DO s OVER expr". > > Just a question: would a "FOR" statement be allowed on this one? > > Like: > > DO s SUPPLIER myQueue~supplier FOR 3 -- process the first three > index/items pairs at the most > say s~index":" s~item > END > > > --- > > Ad supplier: one piece of information that I am missing is an "ITEMS" > method returning the number of items that the supplier has. This becomes > important, if one receives a supplier object, but has no means to get > independently to the collection itself (e.g. the suppliers that get > returned by .Class' METHODS or .Object's INSTANCEMETHODS and the like). > > Regards, > > ---rony > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > |
From: Lee P. <le...@sa...> - 2007-04-19 15:27:15
|
[ 1702149 ] Include table of contents html I see this was closed with 'no further discussion'. I know that each document has a TOC, what I was requesting was a TOC of the documents, as shown in the attached file. Lee |