Re: length() of an atom
- Posted by euphoric (admin) Jul 28, 2010
- 1625 views
DerekParnell said...
I want to make coding simpler for people so returning 1 is much more user-friendly than -1.
Also, what is the unit-of-measure returned by length()? I'm suggesting it is 'elements'.
{x,y} has 2 elements involved {x} has 1 element involved {} has zero elements involved x has 1 element involved
Elements only exist in the context of a sequence. No sequence, no elements. That last 'x' is not an element.
Regardless, I don't think this change will hurt much, if at all. So have at it. :)
But I'm curious, how does returning 1 for length(atom) make coding simpler and more user-friendly? What case did you discover works better with length(atom) returning 1?