See steps to reproduce.
On ColdFusion, this yields a five-element array with each character as an element. On Railo it's just a single-element array with the whole string in the first element.
ColdFusion's behaviour dates back to at least CFMX7 (that's the oldest version I have on tap).
There is no suggestion one way or the other in the ColdFusion docs (http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f0f.html) whether an empty string should be allowable as a delimiter like this, but CF has worked this way since before Railo existed, so that's perhaps an adequate precedent? I could see arguments either way, but if a zero-length delimiter is illegal, then this should perhaps raise an exception. If it's valid, it should work the same as ColdFusion does, I think?
Cheers.
In my book the definition of a bug is when behavior strays from documentation.
I personally don't think that we should support this, as empty-string is Not a delimiter (while I do like the ability to iterate over the chars in a string).
Let's see what Micha thinks.
--
typos, misspels, and other weird words brought to you courtesy of my mobile device.
a blank space, comma, or other character or symbol that indicates the beginning or end of a character string, word, or data item
A delimiter is a sequence of one or more characters used to specify the boundary between separate, independent regions in plain text or other data streams.
At the risk of repeating myself -- I'm with Matt on this one :-)
--
typos, misspels, and other weird words brought to you courtesy of my mobile device.
In my book the definition of a bug is when behavior strays from documentation.
I personally don't think that we should support this, as empty-string is Not a delimiter (while I do like the ability to iterate over the chars in a string).
Let's see what Micha thinks.
Space IS indeed a very valid delimiter. We're not talking about a Space here but about an empty-string.
--
typos, misspels, and other weird words brought to you courtesy of my mobile device.
String.split() is a Java method and in the absence of a method with that name in ACF/Railo it is resolved via reflection at runtime.
--
typos, misspels, and other weird words brought to you courtesy of my mobile device.
Whenever you try to access a property/method of an object, if it is not found then Railo/ACF attempts to resolve it in java via reflection.
This is very useful when you use a 3rd party library or ad-hoc java classes.
--
typos, misspels, and other weird words brought to you courtesy of my mobile device.
For me the discussion is a little bit like, "how does the shape of a car change when you drive against a wall?"
Adding a bif called split as alias for listtoarray makes sense from my point of view.
I would actually love it if we had member functions like isEmpty() and len() on strings
--
typos, misspels, and other weird words brought to you courtesy of my mobile device.
I would actually love it if we had member functions like isEmpty() and len() on strings
Adam wrote:
> The upside for everyone is that it'll be briefer this time
Heh, if that's a briefer version, I think they did us all a favour! ;)
I agree though: the sensible choice is between throwing an error or being compatible with CF.