1. Re: Eu vs perl, strings
------=_NextPart_000_0272_01BF40D3.B979AF20
charset="iso-8859-1"
----- Original Message -----
From: Cuny, David at DSS <David.Cuny at DSS.CA.GOV>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Tuesday, December 07, 1999 3:19 PM
Subject: Re: Eu vs perl
> Everett Williams wrote:
>
> > The one blind spot that would trip this little scenario
> > is the doctrinaire, silly attitude toward string functionality.
>
> I've seen this comment appear a number of times, and I still can't grasp
the
> point you are trying to make here.
>
> A Euphoria string behaves much like a C string, and allows the same sort
of
> operations. In fact, Euphoria strings have the additional benefit of not
> being byte size, allowing you to (theoretically) work with non-byte
> solutions, such as UNICODE.
>
> I'm not trying to be a Euphoria bigot here - I really can't see what that
is
> missing from the language.
I think a *real string* handling library would help. I am spoiled by things
like what is in the attached file. So i can do things like this code
snipette:
if ( *!* at user-?*?*.dialup.mindspring.com iswm %1 ) {
if ( $2 == 3 ) {
return *!* $+ $right($remove($gettok($gettok(%1,1,64),2,42),~),9) $+
@user-* $+ $gettok($gettok($gettok(%1,1,46),2,64),2,63) $+
*.dialup.mindspring.com
}
etc. Btw, that is working mirc code, but it may not copy well thru the
email.
And the annoying crashes caused by out-of-bounds testing of sequences is ,
well, annoying. I fear that adding these functions as include files will
result in slowing down Eu to the point it is unusable, so imho they should
be part of the core. Also,, printing things in Eu isn't all that easy, i
have lines like this fairly often:
puts(1,datastr1[3] & " " & sprintf("%d", charvalues[datastr1[3] - 64] ) &
"\n")
And, if the "strings" were really type-free, i wouldn't need the
sprintf("%d",etc) call there, right?, `cause that location of that sequence
has a numeral in it as a string, not a ascii char value, or it could have,
with a free-form string array. With 4(?) print functions in Eu, and all the
possible params for how to format the sequences to be printed, sometimes i
end up guessing which to use and trying several. But i guess that's what
debugging is for. Anyhow,, string routines are a necessity for parsing
spoken/written languages, which i do a lot of. As i am often sitting on my
soapbox preaching in favor of communications, having the ability in Eu to
manipulate strings it recieves from the outside world would be a definite
plus, imho. I just wrote a *simple* crossword puzzle solver a la Scrabble,
it uses Eu for searching word list for the 15+million possibilities (and the
Eu is freaky fast doing that too), computing word values, then Eu narrows
the list to the top range of word values, then it passes the resulting file
name to mirc for *sorting* the strings for max word value because it was a
one line command in mirc to put each line into a scroll-able window, all
lines in the window sorted: "aline @puzzle %puzzline" , and then save the
window to a text file, or not.
Kat,
who relishes easy puter-human interfaces, which leaves out Perl.
------=_NextPart_000_0272_01BF40D3.B979AF20
name="Strings.txt"
Content-Transfer-Encoding: quoted-printable