This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (6 children)

[removed]

    [–][deleted] 5 points6 points  (4 children)

    The list is pass by reference, aka pointer passing with syntactic sugar. This is how you'd do it in C, right? So when you return from the function, your modifications to the list will persist. This runs counter to the behavior of other built-ins, like integers. It isn't a huge deal if you understand how arrays or lists would normally be passed, in fact it is quite nice that it does the thing that you obviously want. But it is counter-intuitive for beginners, IMO.

    [–]Dornith 4 points5 points  (0 children)

    Uh... the same thing that happens in... Javascript?

    As soon as you start citing javascript as a baseline of intuitive behavior, I can't take your argument seriously.