taruss
7/28/2015 11:40:00 PM
On Monday, July 27, 2015 at 2:30:24 PM UTC-7, Jeremy Smith wrote:
> Hi Folks,
>
> I'm distributing a Lisp program, as a Clisp binary, and I want to have a
> 'demo' version.
>
> This demo version would be lacking features compared to the paid version.
> ...
> How do I do this in Lisp? Say we have:
>
> (format t "paid version")
>
> How can I omit that at 'load' or 'compile' time?
Well, you really want to do that at compile time (or earlier) otherwise it will
be too late and the code will be distributed.
The read-time macros the others have mentioned are the standard way to do that,
just be sure to only distribute the compiled sources and also make sure you
have everything you want omitted guarded by the read-time conditions.
If you only have the top-level function omitted but include the support, then
anyone with the binary can load it and call the other functions directly
without going through your top-level.