octave-maintainers
[Top][All Lists]
Advanced

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

Re: pkg.m is busted, gen_doc_cache sematics changed


From: John W. Eaton
Subject: Re: pkg.m is busted, gen_doc_cache sematics changed
Date: Wed, 25 Feb 2009 13:12:05 -0500

On 25-Feb-2009, Jaroslav Hajek wrote:

| Noticing your changes, I simplified and optimized the code by using
| setdiff to delete already cached dirs and vectorized string splitting
| based on cell2mat:
| http://hg.savannah.gnu.org/hgweb/octave/rev/eea0e1b45ec0
| 
| Maybe the splitting function, str_split (splits a string into a cell
| array using one or more separator chars)
| would be useful in general? Octave has "split", which returns a padded
| character matrix, and that's inconvenient for unequal length strings
| (and also slow). OTOH, we already have a "feature freeze" state, so I
| leave it up to you.

Thanks.  I thought about using "cellstr (split (...))", but decided
against it since it would strip trailing blanks (if any) from the
elements of the path, which could lead to a hard to find bug.  Then I
thought about writing a function like you did, but just wanted to get
something working quickly without having to think too much about
it...

Anyway, I have now wanted a function like split_str more than once, so
I think it would be a good thing to have.

I think it would be generally more useful than split, which was
written before cell arrays were available in Octave, so maybe we
should just consider changing the behavior of split?  There are 11
calls to split in the Octave sources, and 6 of those convert the
result to a cell array.  Since split is not a Matlab function, we only
have to think about whether it is important enough to keep backward
compatibility with Octave.  I think if cell arrays had been around
when split was written, we would have made split return a cell array.

jwe


reply via email to

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