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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c5f73eda096e667b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-07 12:17:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.net.uni-c.dk!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Neat and tidy solution to following problem? Date: Tue, 7 May 2002 19:17:50 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1020799070 18503 129.241.83.78 (7 May 2002 19:17:50 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Tue, 7 May 2002 19:17:50 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:23666 Date: 2002-05-07T19:17:50+00:00 List-Id: On Tue, 7 May 2002 19:24:27 +0100, chris.danx wrote: > Hi, > > As part of an assignment we have to split text up into words, and check if > they're in a document. I'm ok with the assignment I just wondered if there > was an Ada like equivalent to tuples that didn't involve defining an > explicit record type (say word_and_remaining type)? We did a similar task > in Haskell and by passing out more than one item of different types as a > single item was very tidy and easy (see below). I'm not sure I understand your question as I don't know Haskell and cannot understand the code. But if you have your whole text in a string why don't you find the beginning and end position of the words and then scan the document for them? But probably I'm talking about something different :-) Preben