• Nighed@feddit.uk
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    3 days ago

    I’m from C# that has the following for your list example:

    // If you add an item to this list, it will effect usages outside. You can't reassign it though.
    public void Example(List<string> exampleParam)
    
    //Full passing by ref, if you re-assign it to a complete new object, outside usages will be effected
    public void Example(ref List<string> exampleParam)
    
    //Output only, this acts as if the method assigned a variable named exampleParam. 
    public void Example(out List<string> exampleParam)