less/less.js — pull request #1577 by seven-phases-max (2013-10-03 06:45:15+00:00)
Title: Added `length` function (#1542). Added scalar value handling for `extract` and `length` (#1576).

Notes:
* See #1576 "for scalar value handling".
* Values like `@var: a b c, 1 2 3` (see #1542) are interpreted as a "multidimensional" array/list of values - this is current `extract` behaviour and `length` just follows the same pattern. (See included tests for details).
* Interplolated values like ~"@{var-1}, @{var-2}, @{var-3}, etc" are treated as a scalar value - not an array/list. This functionality is somewhat beyond both functions scope and need some further discussion/discussion anyway...
* While escaped empty value `~""` is interpreted as an array of length 1, a "true empty value" works as zero-length-array (see test/css/extract-and-length.css:120 and test/less/extract-and-length.less:97)
* See included tests for more advanced details...