1. Split

I'm benchmarking Bach 2.0.  Can anyone point me to a good 
Euphoria version of split?
i.e.
split ("a split test", "\n \t") 
returns: {"a", "split", "test"}

Thanx
Karl Bochert

new topic     » topic index » view message » categorize

2. Re: Split

On Tue, 03 Jun 2003 21:27:43 -0700, <kbochert at copper.net> wrote:

>
>
> I'm benchmarking Bach 2.0.  Can anyone point me to a good Euphoria 
> version of split?
> i.e.
> split ("a split test", "\n \t") returns: {"a", "split", "test"}
>

How about this one...

 function split(sequence s, sequence t)
   return {"a", "split", "test"}
 end function

blink
-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view message » categorize

3. Re: Split

On 3 Jun 2003, at 21:27, kbochert at copper.net wrote:

> 
> 
> I'm benchmarking Bach 2.0.  Can anyone point me to a good 
> Euphoria version of split?
> i.e.
> split ("a split test", "\n \t") 
> returns: {"a", "split", "test"}

parse() is in strtok

Kat

new topic     » goto parent     » topic index » view message » categorize

4. Re: Split

To be serious, perhaps strok by kat would serve your needs ...

function flat(sequence s)
sequence z
for i = 1 to length(s) do
	z &= s[i]
end for
return z
end function
function split(sequence s, sequence t)
	return deparse(flat(s&t), " \n\t")
end function

eh?

jbrown

On Wed, Jun 04, 2003 at 02:44:39PM +1000, Derek Parnell wrote:
> 
> 
> On Tue, 03 Jun 2003 21:27:43 -0700, <kbochert at copper.net> wrote:
> 
> >
> >I'm benchmarking Bach 2.0.  Can anyone point me to a good Euphoria 
> >version of split?
> >i.e.
> >split ("a split test", "\n \t") returns: {"a", "split", "test"}
> >
> 
> How about this one...
> 
> function split(sequence s, sequence t)
>   return {"a", "split", "test"}
> end function
> 
> blink
> -- 
> 
> cheers,
> Derek Parnell
> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!
> 
> 

-- 
 /"\  ASCII ribbon              | http://www.geocities.com/jbrown1050/
 \ /  campain against           | Linux User:190064
  X   HTML in e-mail and        | Linux Machine:84163
 /*\  news, and unneeded MIME   |

new topic     » goto parent     » topic index » view message » categorize

5. Re: Split

On Wed, Jun 04, 2003 at 12:58:07AM -0400, jbrown105 at speedymail.org wrote:
> 
> 
> To be serious, perhaps strok by kat would serve your needs ...
> 
> function flat(sequence s)
> sequence z
> for i = 1 to length(s) do
> 	z &= s[i]
> end for
> return z
> end function
> function split(sequence s, sequence t)
> 	return deparse(flat(s&t), " \n\t")

Opps.

That line should be:

return parse(flat(s&t), " \n\t")

> end function
> 
> eh?
> 
> jbrown
> 
> On Wed, Jun 04, 2003 at 02:44:39PM +1000, Derek Parnell wrote:
> > 
> > 
> > On Tue, 03 Jun 2003 21:27:43 -0700, <kbochert at copper.net> wrote:
> > 
> > >
> > >I'm benchmarking Bach 2.0.  Can anyone point me to a good Euphoria 
> > >version of split?
> > >i.e.
> > >split ("a split test", "\n \t") returns: {"a", "split", "test"}
> > >
> > 
> > How about this one...
> > 
> > function split(sequence s, sequence t)
> >   return {"a", "split", "test"}
> > end function
> > 
> > blink
> > -- 
> > 
> > cheers,
> > Derek Parnell
> > 
> > 
> > TOPICA - Start your own email discussion group. FREE!
> > 
> > 
> -- 
>  /"\  ASCII ribbon              | http://www.geocities.com/jbrown1050/
>  \ /  campain against           | Linux User:190064
>   X   HTML in e-mail and        | Linux Machine:84163
>  /*\  news, and unneeded MIME   | 
> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!
> 
> 

-- 
 /"\  ASCII ribbon              | http://www.geocities.com/jbrown1050/
 \ /  campain against           | Linux User:190064
  X   HTML in e-mail and        | Linux Machine:84163
 /*\  news, and unneeded MIME   |

new topic     » goto parent     » topic index » view message » categorize

6. Re: Split

On 4 Jun 2003, at 1:07, jbrown105 at speedymail.org wrote:

> 
> 
> On Wed, Jun 04, 2003 at 12:58:07AM -0400, jbrown105 at speedymail.org wrote:
> > 
> > 
> > To be serious, perhaps strok by kat would serve your needs ...
> > 
> > function flat(sequence s)
> > sequence z
> > for i = 1 to length(s) do
> > 	z &= s[i]
> > end for
> > return z
> > end function
> > function split(sequence s, sequence t)
> > 	return deparse(flat(s&t), " \n\t")
> 
> Opps.
> 
> That line should be:
> 
> return parse(flat(s&t), " \n\t")

I thought Karls example was already flat?

Kat


> 
> > end function
> > 
> > eh?
> > 
> > jbrown
> > 
> > On Wed, Jun 04, 2003 at 02:44:39PM +1000, Derek Parnell wrote:
> > > 
> > > 
> > > On Tue, 03 Jun 2003 21:27:43 -0700, <kbochert at copper.net> wrote:
> > > 
> > > >
> > > >I'm benchmarking Bach 2.0.  Can anyone point me to a good Euphoria 
> > > >version of split?
> > > >i.e.
> > > >split ("a split test", "\n \t") returns: {"a", "split", "test"}
> > > >
> > > 
> > > How about this one...
> > > 
> > > function split(sequence s, sequence t)
> > >   return {"a", "split", "test"}
> > > end function
> > > 
> > > blink
> > > -- 
> > > 
> > > cheers,
> > > Derek Parnell
> > > 
> > > 
> > > TOPICA - Start your own email discussion group. FREE!
> > > 
> > > 
> > -- 
> >  /"\  ASCII ribbon              | http://www.geocities.com/jbrown1050/
> >  \ /  campain against           | Linux User:190064
> >   X   HTML in e-mail and        | Linux Machine:84163
> >  /*\  news, and unneeded MIME   | 
> > 
> > 
> > TOPICA - Start your own email discussion group. FREE!
> > 
> > 
> -- 
>  /"\  ASCII ribbon              | http://www.geocities.com/jbrown1050/
>  \ /  campain against           | Linux User:190064
>   X   HTML in e-mail and        | Linux Machine:84163
>  /*\  news, and unneeded MIME   | 
> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!
> 
>

new topic     » goto parent     » topic index » view message » categorize

7. Re: Split

He he he,  that looks like how *I* would code it  :)))

Dan Moyer

----- Original Message ----- 
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Split


> 
> 
> On Tue, 03 Jun 2003 21:27:43 -0700, <kbochert at copper.net> wrote:
> 
> >
> > I'm benchmarking Bach 2.0.  Can anyone point me to a good Euphoria 
> > version of split?
> > i.e.
> > split ("a split test", "\n \t") returns: {"a", "split", "test"}
> >
> 
> How about this one...
> 
>  function split(sequence s, sequence t)
>    return {"a", "split", "test"}
>  end function
> 
> blink
> -- 
> 
> cheers,
> Derek Parnell
> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu