On 12/20/2016 11:00 PM, Waldek Hebisch wrote:
> The first example for 'split' (and probably the only one in FriCAS
> book) is to split on spaces.  In such case the expected behaviour
> is to treat several consecutive spaces as a single separator.

Yes, that's a good reason to keep the current implementation.
Still I wonder why

  for i in mn..n while s.i = c repeat 0

defines a variable i that is visible outside of the for loop. I wouldn't
have expected this.

> So yes, there is good reason for current implementation.  OTOH
> what you expect is reasonable too.  In other languages there is
> quite a lot of functions which perform various splitting/parsing
> tasks.  ATM I am not sure if we should add a second version of
> split or some more general function...

First of all, the documentation should be made clearer. If a developer
first has to program some examples to find out how exactly split
behaves, that's certainly not a good thing.

I would somehow tend to provide two functions, one that provides the
strings between two single separator characters and another one that
returns the same list but with the empty strings removed from that list.
No idea what good names for both types of functions are.

Ralf


-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to