On Wed, Feb 08, 2017 at 09:52:58AM +0000, dean wrote:
> When developing non-trivial functions in isolation....you need to copy some
> of the supporting scaffolding over from your main program to support it.
> When you subsequently come to "load" the module into your main
> program...there's a danger of duplicate scaffolding.

This is normally not a problem. Typical soure files are written in such a way
that you can re'load' them any time, and as often as you want. PicoLisp loads
files extremely fast.

In fact this is the normal way of interactive development.

> Is there some way to hide the copied scaffolding in your module along with
> the module's main clause upon loading


> or perhaps with the flick of a "switch".
> I'm thinking of Python's `if __name__ == '__main__' and Perl's unless
> (caller) {...}

I don't know Python and Perl well enough. But perhaps 'once' is what you think

   (once (load "xxx.l"))

However, this disables the above development style. Same goes for any other
similar method, e.g.

   (unless foo  # 'foo' is defined in "foo.l"
      (load "foo.l") )


   `(not foo)  # Abort loading this file if 'foo' is defined
   (de foo ()  # Otherwise go ahead and define stuff
      ... )

♪♫ Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to