[erlang-questions] -spec tuple variable size
Sun Dec 2 23:02:16 CET 2012
On 1/12/2012, at 11:03 AM, Dmitry Kolesnikov wrote:
> On Nov 30, 2012, at 2:26 AM, "Richard O'Keefe" <> wrote:
>> Let me put it this way:
>> why do YOU care whether all the elements of the tuple have
>> the same type?
> One of my current limitation is that tuple elements MUST be a _particular_ data type.
That really doesn't answer the question, although it may clarify it.
You don't want "any size tuple all of whose elements are the same type,
whatever that type is", but "any size tuple all of whose elements are
of _this_ specific type", but you have not as yet told us what _this_
specific type happens to be.
However, the question stands:
- why does it _have_ to be a tuple?
- why do _you_ care about the types?
> I simply want to validate that client writes tuples with supported data types.
- why can't the _clients_ validate?
- _who_ is restricting the types?
> E.g. I do not have a support for nested tuples yet.
- what are _you_ doing that cares what the elements of a tuple are?
You're hinting at a setup that sounds quite un-natural in Erlang, and
as yet we have no clear idea of what the application-level problem is.
More information about the erlang-questions