Why FOR Loop last iteration ITEM not available GLOBALLY?

Indeed. In fact, if anyone wants to have python’s way of things, they already can replicate that with Julia: simply define a struct and have all associated methods accept an instance of it as their first argument. After all in python instanceOfClass.methodcall(*args) is just a syntactic sugar of Class.methodcall(instanceOfClass, *args), and it’s easy to do the same in Julia. Class inheritance can always be replaced by composition (which can often be a better option anyway). But of course the real magic of Julia can only be unleashed when we really embrace multiple dispatch.

1 Like