Just been inspired to add a couple of functions .. I said inspired,
not that it had been done .. ;)

        abstract-exec-precise (program, switches, arguments);
        abstract-exec-sloppy (program, switches, arguments);
        abstract-exec-interactive (program, switches, arguments);

What these do: they use flx_pkgconfig to lookup the abstract
program name in the config data base, in the corresponding
file fields:

        executable: /usr/bin/diff
        switches: "-c"

are found. We then call /usr/bin/diff -c arguments (with popen or something).
The database switches *replace* the programmed ones.

If the package is not found, -precise aborts. However sloppy just tries to
exec the program. So I can write

        abstract-exec-sloppy ("diff", list ("-c"), list(file1, file2));

and it will work on Unix. It will fail on Windows, so on Windows you
just create a 

        config/diff.fpc

file with a suitable executable and switches field. Note the arguments
have to be the same.

The interactive version prompts the user for the required information,
and creates the config file (probably in ~/.felix/config so we'd better add
that to he config path. At present, this location will actually be copied
into the master when you build .. not sure if that's a good idea or not
if its also a live config directory).

It may be better to have just one routine, and use an environment
variable to choose the strategy (precise, sloppy, interactive).

Anyhow comments welcome.

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




------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to