Arc Forumnew | comments | leaders | submitlogin
2 points by ylando 5043 days ago | link | parent

It can look like this:

  In a library file mylib.arc
  (namespace mylib)
  (def func-a ...)
  ...
In a program:

   (use mylib (func-a func-b)) or (use mylib *) or (use mylib)
   Now we can write
   (func-a ...) (func-b ...)
   and for a function that we didn't import inside the
   namespace; we can write:
   (mylib/func-c ...)


3 points by evanrmurphy 5043 days ago | link

It might be more elegant to take advantage of s-expressions for this, as in

  (module mylib
    (def func-a ...))
and

  (w/module mylib
    (func-a ...))
rather than having imperative declarations that apply to an entire file.

Thinking about module/namespace systems in general, I guess as long as definitions are still global by default then they shouldn't bother anyone who doesn't want them. You might also be interested in aw's piece on library dependencies: http://awwx.ws/thinking-about-dependencies

-----