octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: packaging system


From: Stefan van der Walt
Subject: Re: packaging system
Date: Wed, 22 Jun 2005 19:32:51 +0200
User-agent: Mutt/1.5.6i

On Wed, Jun 22, 2005 at 02:15:24PM +0200, David Bateman wrote:
> Stefan van der Walt wrote:
> 
> >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;
> >   endif
> >   
> >   d(idx, 1) = key;
> >   d(idx, 2) = new_value;
> >   
> >endfunction
> >
> > 
> >
> Which dict is which? You use dict as a function and a variable.... Do we 

You can just rename `Dict: The Function' to set_dict or whatever.
Hey, it parses :)

> 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 

I think Bill is right -- we don't need to reinvent the wheel twice.
Finding an efficient transportable C++ implementation might not be so
easy though -- I'll take a look.  As you say, anything that gets the
job done is good for now.

Cheers
Stéfan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]