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: 103376,7e53a790494d0d3d X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Equivalent to C++'s 'this' for tasks? Date: 1997/05/23 Message-ID: #1/1 X-Deja-AN: 243372103 References: <5ltfe8$edr$1@goanna.cs.rmit.edu.au> <5m2elp$ii4$1@goanna.cs.rmit.edu.au> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-05-23T00:00:00+00:00 List-Id: In article <5m2elp$ii4$1@goanna.cs.rmit.edu.au>, Dale Stanbrough wrote: >I would like something that doesn't require delving into stuff that >the rationale claims is mainly used for building scheduling systems. Within a type, the type name refers to the "current instance" of that type, sort of like "this" or "self" in some other languages. So, within a task body for task type T, T refers to the currently running task. So you can say "T'Unchecked_Access" and pass that access value around and so forth. This only works for *limited* types, such as tasks, because the current instance is defined to be aliased only for limited types. And because of the accessibility rules, it has to be 'Unchecked_Access, rather than 'Access -- this is because you might create a task of type T within a more-nested procedure -- the "Unchecked_" is supposed to warn you of this potential for dangling pointers. To read about this stuff, look up "current instance", "aliased", and "accessibility level" in the index of the RM. - Bob