AltME: SDK

Messages

Ladislav
I am not completely sure what your question is, but we use it to:
1) run the code from the source
2) encap the above code as well, both at the same time
When I click on any file icon here, I usually use INCLUDE to run the code, in fact
(and preprocess it at the same time, if needed)
DocKimbel
I just mean enabling any REBOL app to run unchanged from sources (using DO) or encapped.
Ladislav
what is "encapped"? once encapped, it is just an .exe here
but, certainly, I use INCLUDE to run (e.g. when testing) any REBOL application otherwise needing preprocessing, i.e. such that even could not be run by DO; of course, such applications that can be run by DO can be run by INCLUDE as well
DocKimbel
Encapped: executable binary generated by /Encap.
Ladislav
Why would you want INCLUDE to run such application?
DocKimbel
Ok, let's try another way. :-) For a given REBOL app codebase that can be run with DO, can INCLUDE be used in such codebase to enable application preprocessing suitable for /Encap while letting it still be run using a simple DO?
Ladislav
INCLUDE can be used wherever DO can be used. I guess that answers your question.
Or maybe I am still missing what you are asking?
DocKimbel
Actually, what I would need would be an INCLUDE that can replace both DO and #include.
Ladislav
Yes, that is exactly what INCLUDE does
DocKimbel
Can it also replace LOAD and READ (and any other function that reads REBOL or data files from disk)?
Ladislav
LOAD: yes, you should give it a try, IMO
(you may find some other needs and suggest improvements, but I bet the basic functionality is there for you)
DocKimbel
Good, then I'll try it on some simple apps, if it works well enough, I'll be able to replace my own include system with it for bigger projects, like Cheyenne and Red.
Gregg
I use INCLUDE a lot, for both development runs and encapping. I just use different scripts to launch them. That is, I have a %_build.r that calls INLCUDE/LINK to produce an output script, then uses DO on that. %_encap.r, the CALLs encap and does other things like setting icon and version in the EXE.
Typos. %_encap.r calls INCLUDE/LINK, then CALLs encap...
DocKimbel
Ladislav: I just had a quick look at INCLUDE documentation, I still unsure if it can cover my needs. Let's take an example:
    REBOL [ ]
    do %lib/a.r
    do %lib/b.r
    app: context [...]
    app/run
How can I use INCLUDE there to make this script "encappable" (can be passed to Encap for generating an executable) while still being able to evaluate it with DO? Would the following code work?
    REBOL [ ]
     #include %include.r
    include %lib/a.r
    include %lib/b.r
    app: context [...]
    app/run
Gregg
Ladislav may have a different suggestion, but I've found that having build scripts works well for application oriented scripts, those that need to be encapped for deployment. For scripts that don't need to be encapped, I use INCLUDE directly, as you do above.

Last message posted 49 weeks ago.