jckarter/clay — pull request #480 by stepancheg (2013-01-14 23:47:23+00:00)
Title: sequence constructor API refactoring

Before this commit `Vector` functions were over-overloaded: call
to

```
Vector[T](a)
```

could interpret `a` as a sequence or as an element parameter. This
is over-overloading that make code harder to read and maintain.

This commit changes sequence construction API. New convention is
proposed:

Let `Foo` be sequence type.

Calls

```
Foo(arg)
Foo[T](arg)
```

assume arg is a sequence. Call

```
foo(..args)
```

interpret args as elements for new foo sequence. Latter call does
not work when args list is empty (because type parameter for `Foo`
cannot be infered and thus must be specified).

To deal with this problem, `elements` function is proposed:

```
Foo[T](elements(..args))
```

`elements` function with non-empty parameters list returns an array
of arguments, and `elements` with empty args returns special
sequence-like record NoElements, that has no type parameter (thus
`elements()` call does not fail, unlike `vector()`).

This patch changes vector, vectorQueue and deque.