Skip to content

Unpacking variables from arrays #186

@14NGiestas

Description

@14NGiestas

I usually unpack variables from arrays when it's meaningful, eg:

subroutine cool_stuff(self, coords)
    integer(INT32) :: coords
    ...
    x = coords(1)
    y = coords(2)
    z = coords(3)
    self % coolest = [x**2, y**2, z**2]
end subroutine

I would be nice if i could unpack variables from vectors, maybe in the args:

subroutine cool_stuff(self, [x, y, z])
    integer(INT32) :: x, y, z
    self % coolest = [x**2, y**2, z**2]
end subroutine

Or even something like this:

subroutine cool_stuff(self, coords)
    integer(INT32) :: coords(3)
    integer(INT32) :: x, y, z
    [x, y, z] = coords
end subroutine

Metadata

Metadata

Assignees

No one assigned

    Labels

    Clause 10Standard Clause 10: Expressions and assignment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions