Gerhard Niklasch on Thu, 1 Feb 2001 18:07:53 +0100 (MET) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: gp and strings |
In response to: > Message-ID: <3A79873B.3C7E7007@math.uni-siegen.de> > Date: Thu, 01 Feb 2001 16:56:43 +0100 > From: Nils-Peter Skoruppa <skoruppa@math.uni-siegen.de> > > does anybody know of a method to > convert the string "pari" into ["p", "a", "r", "i"] > (from within gp, of course). Not easily *within* gp (I may be missing something (*)) but certainly *from* within gp, if you allow yourself to invoke awk or perl through gp's extern() -- where it'll be a (long) one-liner. (* for laughs: in fact if I take your question more literally than you probably intended it, there is a trivial way to do it in gp -- parisize = 4000000, primelimit = 500000 (18:05) gp > pari()=["p","a","r","i"]; (18:06) gp > eval("pari") %1 = ["p", "a", "r", "i"] -- but I don't _quite_ think this is general enough for your purposes. ;) Enjoy, Gerhard