introducing abstract types to mc

Roland Illig roland.illig at gmx.de
Fri Sep 24 19:31:35 UTC 2004


Hi,

I'd like to introduce more abstract types into mc. That is, to separate 
cleanly which files (or functions) _use_ a data type and which ones 
_implement_ the basic operation on variables of this type.

As an example I have picked the type FileOpContext. There are only four 
files that need the internals of the type. The others only use variables 
of the type FileOpContext *.

Using this approach we can quickly tell which functions operate directly 
on the type. Keeping the number of these functions minimal we have 
better control of keeping the internal state of these types valid. For 
example, an abstract type may have some constructors and one destructor. 
As most files cannot access the internal fields of the type, they must 
use a constructor to create a variable of that type. The constructor can 
ensure that all fields get reasonable values. And in case of a 
modification of the type, the number of functions you must look after is 
kept minimal.

So far for now ...

Roland
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc-fileopctx-abstracttype.patch
Type: text/x-patch
Size: 6380 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20040924/8eefd4a5/attachment.bin>


More information about the mc-devel mailing list