Ok so here's a summary of the doc tools.

1. "flx" can run both flx and fdoc formats, in fact they're the same format.
2. The webserver can nest Felix code in fdocs but not vice versa.

3. flx_tangle can now extract three files from an fdoc called fred.fdoc:

        File                                  tag
        (a) fred.flx                    @felix
        (b) fred.expect         @expect
        (c) fred.input                  @input

4. Next commit, flx can process switches:

        --stdout=file
        --stdout                        fred.stdout
        --input=flle
        --input                 fred.input
        --expect=file
        --expect                        fred.expect

Expect implies stdout. The action is to redirect standard input if specified,
and redirect standard output if specified, then compare the saved standard
output with the expect file. Returns 0 if all OK, non-zero on some kind of error
or a mismatch between the output and the expected output.

This means flx_tangle and flx together can run an fdoc tutoriall file as a 
regression test,
verifying the code in the tutorial is correct. Clearly the comparison requires 
the program
be deterministic.

It's currently not possible to check that the compiler catches an error
properly.

5. The new program flx_iscr accepts two commands in an fdoc:

        @tangler nick = filename
        @tangle nick

The first command sets a nickname for a file. The second writes the following
text to the file. Similar to @felix, @expect, @input for flx_tangle, only the 
files
are named. The files aren't written if the contents aren't changed to preserve
the time stamp for dependency checking.

6. The webserver understands these commands too.

7. OK, so now, we can run flx_iscr first to extract arbitrary files, then
either run flx_tangle and execute the *.flx file, or just execute the fdoc
directly.

This allows for more advanced tutorials involving several programs,
library code, demo of plugins or separate compilation, or whatever.

Note that the "executable" code can do build steps. Instead of
writing shell script like:

        flx -c filename.flx

for example, you can write Felix:

        var result = Flx::runflx$ list ('[flx]', '-c', 'filename.flx');

(in fact this is exactly what "flx" itself does .. calls the library with
System::argv!)

--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to