I'm looking at integrating this a bit more tightly into Felix: the tools, the 
compiler,
and of course provide library stuff.

The idea is simple: a "directory stack" is a stack of directories. Duh!

When you open a file for reading:

        open_input(stack, filename)

filename is looked for in the stack, top dow.

When you open a file for writing, you always write in the top of stack 
directory.

If you do read + write open, the file is searched as for reading, and if found
but not in top of stack it is copied there, and then that is opened.

The effect is a "poor mans src control". Consider the stack

curdir
home
local-mods
felix-library

Then if you compile some library.flx file, the output stuff goes in curdir.
This is good because felix-library and local-mods are read-only anyhow.

With a bit of sex thrown in, you could also recognize filename.patch files
that shadowed a filename file, and generate a patched file "on the fly".

The problem this stuff is meant to solve is this: at present, Felix decides
to write *.cpp etc files right next to the *.flx file. It's supposed to do that!
Unfortunately that won't work for read-only directories.

Also whilst lookup paths provide shadowing on read, writes still go
either in some fixed place or next to the shadow file.. which can still
be read only.

Stacks also solve another problem. Consider directory

        felix/lib/std/*.flx

files. We could share std/*.flx except that there are 
dependencies on

        felix/lib/plat/*.flx

which contains generated files. If you wanted to share the standard library
globally, that's no good.

Directory stacks solve that problem too. The stack is just a path on a directory
tree, with branches for each config. In that case, there's actually a fixed
algorithm for specifying the stack, which is cool .. like I said, it's the path
on the tree so you could have this stack:

        share/unix/linux/x86_64/gcc/4.2
        share/unix/linux/x86_64/gcc
        share/unix/linux/x86_64
        share/lunix/linux
        share/unix
        share

specified by a single pathname.

--
john skaller
skal...@users.sourceforge.net





------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to