Skip to content

Increment #541

Open
Open
@Beliavsky

Description

@Beliavsky

Many other languages allow i += 1 instead of i = i + 1. When you are incrementing a variable with a long name, or an array section, or a component of a derived type, it is possible to write i = j + 1 by mistake, where it was intended that i be incremented. Therefore I suggest that stdlib have an elemental increment subroutine that works with real and integer types, so that

call increment(i,inc)

has the same meaning as

i = i + inc

I got this idea from Nim, where you can write inc(i,1) instead of i = i + 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions