I could see a couple of nice uses for having the ability to do block-local imports, but I’m not sure if that would solve the problems that (33) is meant to address, which is that using importall makes it to too easy to accidentally monkey-patch Base and that using import sometimes makes it hard to know the provenance of functions being extended by a module. The latter is way less problematic than the former: single function import has a lot of good use cases, even if it’s a bit too non-local for my taste. It’s only importall that makes things really hard to keep track of.
— John On Dec 31, 2013, at 3:54 PM, Brian Rogoff <[email protected]> wrote: > IMO the main reason for (33) is that Julia presently lacks any local import > feature. At least a few languages with module systems add these; see for > instance OCaml > http://caml.inria.fr/pub/docs/manual-ocaml-4.01/extn.html#sec225 and also > Ada, which allows with/use inside of blocks. > > Is there a reason that a similar feature wouldn't work well with Julia too? > > -- Brian > > On Tuesday, December 31, 2013 7:01:23 AM UTC-8, John Myles White wrote: > One of the things that I really like about working with the Facebook codebase > is that all of the code was written to comply with a very thorough internal > style guideline. This prevents a lot of useless disagreement about code > stylistics and discourages the creation of unreadable code before anything > reaches the review stage. > > In an attempt to emulate that level of thoroughness, I decided to extend the > main Julia manual’s style guide by writing my own personal style guideline, > which can be found at https://github.com/johnmyleswhite/Style.jl > > I’d be really interested to know what others think of these rules and what > they think is missing. Right now, my guidelines leave a lot of wiggle room. > > — John >
