[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Equivalent of Perl 'join' ?
From: |
CdeMills |
Subject: |
Re: Equivalent of Perl 'join' ? |
Date: |
Thu, 16 Dec 2010 13:39:32 -0800 (PST) |
John W. Eaton wrote:
>
>
> or
>
> join = @(expr, list) [(sprintf (["%s", expr], list{1:end-1})),
> list{end}]
>
> Have we beaten this topic to death yet?
>
>
Your solution is indeed clean and elegant. But the first poster who came
with the idea of using sprintf introduced a sensitivity to 'expr' value:
join('%', {'a', 'b', 'c'})
will fail. I know the right form is
join('%%', , {'a', 'b', 'c'}) ,
but still this is an interference from the internal 'engine'. Now, this
won't prevent me of sleeping well :-)
Regards
Pascal
--
View this message in context:
http://octave.1599824.n4.nabble.com/Equivalent-of-Perl-join-tp3090590p3091712.html
Sent from the Octave - General mailing list archive at Nabble.com.