Skip to content

Function 'Branch' visibility #378

@meemoeuk2

Description

@meemoeuk2

Hi, I try to write in functional rather than OO style code.
Is there any chance of Blitzmax getting Function 'Branch' visibility for its variables?
Visible to any sub-function called within the Function.
Similar to Fields in OO code, whereby the field has less visibility than a Global, but more visibility than a Local.

Global a:Int = 1


Function calculate(c:Int)
 Local b:Int =2
 Branch e:Int = 4

 Print a+b+c+calc2()
End Function 


Function calc2()
 Return e+5
End Function 

Print calculate(3)

results in
15
since e is visible in calc2.

currently when i want a 'Branch' variable in my Functional style code I either have to make it a Global, or pass it down thru function parameters.

thanks

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