Skip to content

Reduced verbosity for allocate/select type #107

@jacobwilliams

Description

@jacobwilliams

I seem to encounter this sort of thing a lot:

class(abs_class),allocatable :: my_class

allocate( specific :: my_class )
select type (my_class)
class is (specific)
  !... now can access specific my_class members...
end select 

It would be nice to combine the allocate/select type/class is into one line. If you're going to allocate a class, and then immediately do something with it, the amount of code here seems excessive.

I'm not sure what the syntax would look like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Clause 11Standard Clause 11: Execution control

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions