From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,ea30c4e9c3d00b X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,ea30c4e9c3d00b X-Google-Attributes: gid103376,public From: adam@irvine.com Subject: Re: Ultimate Language feature list Date: 1998/05/13 Message-ID: <6jcjqq$jl4$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 352904251 X-Http-User-Agent: Mozilla/3.0 (X11; I; Linux 2.0.18 i586) Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed May 13 17:04:25 1998 GMT Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1998-05-13T00:00:00+00:00 List-Id: Well, as long as we're talking about what language features we want, here's one I've always wanted: The ability to deal with sequences of objects. I don't mean a list of objects where you have to create an array or linked list in memory that contains all the objects; I mean the ability to write code that talks about sequences of objects even though the program only generates one at a time. So I'd like to be able to write a function like this: -- Integer_List is a "traditional" linked list of integers function Nonzero_Elements_Of (List : Integer_List) return sequence of Integer is begin List_P := List; while List_P /= null loop if List_P.Data /= 0 then return List_P.Data; -- Note: this RETURN would return one integer but -- would NOT terminate the function; eventually the -- caller would return to this point in the function -- to get more end if; List_P := List_P.Next; end loop; end; and the caller would have primitives available to test for the end of the sequence, get the next element of the sequence, etc.; or you'd have constructs like: for Int in Nonzero_Elements_Of (My_List) loop ... end loop; which would set Int in turn to each element returned by the function; or you'd have ways to deal with the whole sequence, e.g. you could pass the function result of Nonzero_Elements_Of as an "in" parameter to another procedure that declares a "sequence of Integer" as a parameter. Etc. Of course, there would be no requirement that a sequence be finite. Well, I can dream. Naturally, this dream has come up again since I'm involved in another discussion involving how to implement an iterator. -- Adam -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading