Re: left, right? head, tail? which one?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jason Gade wrote:
> 
> Some of these forms already have an idiom in Euphoria (left, right). The pad
> and trim stuff might be useful, I'm not sure. I kinda agree with Matt up
> above.

Can you give me an example of how you would do:

sequence s
s = head({1,2,3,4,5}, 3) -- {1,2,3}
s = head({1,2}, 55) -- {1,2}
s = head("John Doe", 30) -- "John Doe"
s = head("John Doe" 3) -- "Joh"


I do a lot of string processing and checking length each time is the pits, thus
most languages provide some form of left, right, mid that do bounds checking.
[1..3] will not work. [3..$] will not work.

In regards to trim and pad... yes, in string processing they are very helpful,
again, the reason that most languages (even python as stated previously) have
them.

> Jeremy, have you looked into Kat's strtok library?

I have it downloaded, but I have not got into the section yet of the standard
library of string tokenizing so I have not spent any real time with it.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu