| Bill Allombert on Sat, 21 Jan 2006 14:12:26 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: Two suggestions: |
On Fri, Jan 20, 2006 at 08:27:50PM +0100, Karim Belabas wrote:
> An off-topic answer, which might be useful in another context; using
> a high-level external filter is a good alternative:
>
> code2seq(code) =
> {
> extern("echo " code "|perl -ne 'm/([0-9]+)([a-z]+)([0-9]+)/;
> print \"[$1,\\\"$2\\\",$3]\" ' ")
> }
>
> P.S: for more complicated processing, an external script will be cleaner of
> course, it's a pain to escape all those quotes and backslashes. Also, my
> variant is unfortunately orders of magnitude slower than your "awkward"
> approach.
Well maybe we could provide a string splitting function using the
regex libc, for example
? Strregexp("([0-9]+)([a-z]+)([0-9]+)","11a1")
%1 = ["11","a","1"]
Also, it is in fact easy to find the conductor of a curve name, just
eval() it:
? eval("11a1")
%1 = 11
So maybe the initial forell() is usable after all.
Cheers,
Bill.