So far, no-one here has suggested using “closures” which I personally find ideal for having specific data be associated with a specific function. A search for Julia and closures should give you a lot of references, one of them is Julia Language Tutorial => Introduction to Closures . It is a functional programming technique and if I understand you correctly, then this can provide what you are asking for.
I use this technique a lot in places where I would have encapsulated things in an object in an OO language.