[REBOL] Re: idea for pre-processing
From: nitsch-lists:netcologne at: 21-Jun-2002 17:07
Am Freitag, 21. Juni 2002 15:58 schrieb Robert M. Muench:
> > -----Original Message-----
> > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]On Behalf Of
> > Ammon Johnson
> > Sent: Thursday, June 20, 2002 9:19 PM
> > To: [rebol-list--rebol--com]
> > Subject: [REBOL] Re: idea for pre-processing
> >
> > I think that he wants to be able to automatically remove debugging
> > lines from his code so that they don't even add the overhead of an if
> > statement. He is talking about stablizing, enhancing, speeding up his
> > app *after* debugging is done, and he is ready to release a final product
> > to his customers... ;-)
>
> Hi, yep that's what I mean too. The 'if or 'version etc. would be removed
> after the script was send to the pre-processor/linker. The linker could
> include all functions used from external files through do %XYZ.r as well.
> This will result in one script file for distribution. Robert
thats what this snippet does.
use it like
save %release.r no-debug load/all %with-debug.r
kills comments too.
define
debug: :do
and each block prefixed with 'debug will be done in the debug-version
and removed in the release.
no-debug: func [src] [
rule: [
any [
begin: 'debug block! :begin (remove remove
begin)
| into rule
| skip
]
]
parse src rule
src
]
src: copy/deep orig: [a b debug [c] [1 2 debug [3 4] 5 6] [debug [?]]
e f]
no-debug src
? src
? orig
and
do no-debug load %file.r