|
From: | David Bateman |
Subject: | Re: packaging system |
Date: | Wed, 22 Jun 2005 14:15:24 +0200 |
User-agent: | Mozilla Thunderbird 0.8 (X11/20040923) |
Stefan van der Walt wrote:
Which dict is which? You use dict as a function and a variable.... Do we need the complexity of a tree structure for dependency check. I thought the interest of that was to reduce the amount of work required in checking the dependencies. This makes sense in a linux distribution with a large number of installed packages, but will octave really ever have more than a 100 or so packages installed at any time. So the flat structure might be easier to get running and maintained initially.I like your idea. Wouldn't it be easier to implement it as some sort of tree structure, instead of a flat one? Unfortunately, we don't have python's dictionaries, but maybe we can do something similar in Octave like function [value, idx] = search(dict, key) value = []; for idx = 1:rows(dict) if strcmp(dict(idx,1), key) value = dict{idx,2}; return; endif endfor idx = 0; endfunction function d = dict(d, key, new_value) if (nargin == 0) d = cell(0,2); return endif [value, idx] = search(d, key); if (idx == 0) idx = rows(d)+1; endifd(idx, 1) = key;d(idx, 2) = new_value;endfunction
In any case, its an internal implementation issue of how the full dependency table is kept. If we run into performance problems, we can always switch to a dependency tree in the future with no visible effect on the user as long as the DESCRIPTION file format supports it..
Cheers David
then have three other function, one to remove a package, one to add a package to the table and another to validate the dependency table,like...Ok, none of the above code is checked as I wrote it straight into my e-mail client, but at least it gives an idea of what I'm thinking about.. Including allowing cell-arrays to install/uninstall, it addresses the issues of circular dependencies and dependencies on uninstalling...Fortunately, the inmind-Octave-parser is pretty flexible :) Regards Stéfan
-- David Bateman address@hiddenMotorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax) 91193 Gif-Sur-Yvette FRANCE
The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary
[Prev in Thread] | Current Thread | [Next in Thread] |