Skip to content

Can't define variables in function #9

@bredelings

Description

@bredelings

It looks like if you define variables in a function, then they can't be referenced outside the function. This makes code like the following not work:

function Integer[] cumsum(Integer[] xs) {
         acc = 0
         for (ix in 1:3) {
             acc = acc + xs[ix]
             ys[ix] = acc
         }
         return ys
}

While it would be ideal if such things would work, it might be OK to just document what you can and cannot expect from functions.

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