Re: What exactly is a 'record' in Ada 95?

From: Dmitry A. Kazakov (mailbox_at_dmitry-kazakov.de)
Date: 09/08/04


Date: Wed, 8 Sep 2004 20:22:01 +0200

On Wed, 08 Sep 2004 14:27:32 +0200, matthias_k wrote:

> ... Is 'record' the only type modifier?

It depends on what you count under type modifiers. Very roughly Ada's "type
modifiers":

abstract - abstract type = it has no instances (values), "interface"
access - pointer
aliased - values can be referenced (can get a pointer to)
all - target values can be in any storage pool
array - true array
class - class-wide type (has polymorphic values)
delta / digits - used for real numbers to specify precision
in / in out / out - standard subtypes of subroutine parameters
limited - type which values cannot be copied
mod - used with modular numbers
new - a type clone
new...with - a type extension
null record - has no members, empty record
private - a type which implementation is hidden
protected - a type which values are concurrently used in a safe way
range - used with numeric types to specify values range
record - has members, but not protected
tagged - a class member type (see class above), an extensible type
task - values are active objects, "threads"

-- 
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de


Relevant Pages

  • Re: Derived type - valued function with pointer member.
    ... If I understand what you want to do, the only reason you need the pointer attribute is because the allocatable attribute for derived type components didn't make it into f95. ... When I make the %vec's allocatable arrays instead, the program segfaults on calling vplus. ... I think the safer route is to create specific allocate and destroy functions for the vector data type and use those. ... Default is to test ALL the pointer members ...
    (comp.lang.fortran)
  • Re: hiding structure members
    ... to declare objects of structure that was typedefed in the header file, but I could not use any of the members of the structure outside the .c file which delcared it. ... You probably have the definition in scope without knowing it. ... Or the typedef is a pointer, like 'typedef struct my_struct *my_struct_p', in which case you'd be malloc'ing memory only for a pointer, not for the struct itself. ...
    (comp.lang.c)
  • Re: Typecasting Pointers
    ... > fact that a pointer to a structure, when suitably cast, points to the ... > 1 Two types have compatible type if their types are the same. ... > if their tags and members satisfy the following requirements: ...
    (comp.lang.c)
  • Re: What type is a structure?
    ... array is not an array. ... A structure's type is not "pointer". ... a one-to-one correspondence between their members such that each pair of ... There you can look for struct type and compatibility. ...
    (comp.lang.c)

Loading