octave-maintainers
[Top][All Lists]
Advanced

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

Re: Third input argument to __makeinfo__


From: Carlo de Falco
Subject: Re: Third input argument to __makeinfo__
Date: Sat, 10 Sep 2011 01:10:21 +0200

On 9 Sep 2011, at 23:32, c. wrote:

> 
> On 9 Sep 2011, at 22:48, Rik wrote:
> 
>> It's always possible, particularly if you're willing to try your hand at
>> the coding.
> 
> Of course, I'd like to clean-up myself the mess I created ;)
> 
>> The old code was awkward and took 20 lines to do what is now accomplished
>> in a single regular expression.  Let's not go back to that.
>> 
>> Instead try something like
>> 
>> regexprep (text, '@seealso *\{([^}]*)\}', replace_function("$1"));
>> 
>> where replace_function accepts a string argument, which is the inside of
>> the @seealso{} block, and where replace_function returns a string value
>> which will entirely replace the @seealso reference.
> 
> this looks nice but would require changing the meaning of the function handle 
> parameter,
> I'd prefer not 
>> Good luck,
>> Rik
>> 
>> p.s. replace_function was just a casual name choice.  You can use something
>> more appropriate.
> 
> I think I can achieve the previous behaviour of __makeinfo__ in a one-liner by
> 
> text = feval (see_also,  strtrim (strsplit (regexp (prova, '@seealso 
> *\{([^}]*)\}', 'tokens', 'once'){:}, ',', true)));
> 
> this is nice because it would allow generate_html to work as-is
> but is there a simpler way to do the same?
> 
> c.

After a bit more testing, the attached is the best I managed to come up with.
I'll wait longer before pushing this time ;)
c.


Attachment: open_q3QFtU7U.txt
Description: Text document


reply via email to

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