-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
empty %w #1394
Comments
@yrashk Yeah it should, not sure why %w()b works but %w()a doesn't... I'll investigate. |
I am also curious why ex(6)> %w()b
"" Also, iex(7)> %w()c
** (ErlangError) erlang error: {:bad_generator, ""}
:erl_eval.expr/3 |
I know why. It's a bad but simple bug. def split(""), do: "" Should be: def split(""), do: [""] |
Follow-up: Should String.split("") return [""] or [] ? |
My logic suggests [""] On Mon, Jul 8, 2013 at 3:03 PM, Devin Torres notifications@github.comwrote:
|
@yrashk What do you expect when you do %w()a ? [:""] ?? |
[] On Mon, Jul 8, 2013 at 3:09 PM, Devin Torres notifications@github.comwrote:
|
@yrashk Then they have different functionality and split_words becomes more complicated :-/ |
That means %w() should be [] too. I guess that makes sense. |
well, %w means "words" but if the thing is empty, then it means there are I think %w(), %w()a and %w()c should return the same thing — an empty list On Mon, Jul 8, 2013 at 3:12 PM, Devin Torres notifications@github.comwrote:
|
Indeed. |
Shouldn't this return an empty list?
cc @devinus
The text was updated successfully, but these errors were encountered: