Re: Re: hierarchical packaging (was: Java API)

Ralf Juengling <[email protected]> Tue, 14 Feb 2006 09:38:19 -0800 (PST)
Newsgroups gmane.lisp.lush.devel
Message-ID <[email protected]>
On Mon, 13 Feb 2006, Yann LeCun wrote:

> Hey Ralf,
>
> you can already do:
>
> (package mystuff
>  (private print)
>  (dm print (dummy . arg) '())
>
>  (de the (rest) (of your))
>  (de code (goes) (here) (print some debugging info))
> )

Thanks! I have to admit that I misunderstood what 'package'
does when I looked at it the first time. That indeed helps
with the name clash problem. I wonder why package isn't used
anywhere in the lush libraries.


> What else do you need?

Package helps with my most pressing concerns. But since you
asked, let me add a few suggestions for possible improvements:

o You want to document the public interface a module provides.
   So using package you should need to state what you want to
   be public not what you want be private. The syntax could
   look like this:
   (package <package-name>
            (<symbol1> ... <symboln>) ;; public defs

     (de there (goes) (your-code))
     ...
   )

o Another purpose of explicit import statements is that they
   more specifically document module depencies. Hence I still
   would like to use something like

   (import (read-lines write-lines) from "libc/shell")

   For now an implementation of 'import' could just verify
   that the listed symbols are indeed defined in the module to be
   loaded. If we ever get to implement a more flexible libload
   mechanism, then we could change the semantics of import to the
   intended selective import later.

Ralf


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642