durusmail: qp: spec terminology
spec terminology
2007-02-17
2007-02-17
2007-02-19
2007-02-20
2007-02-20
spec terminology
mario ruggier
2007-02-19
On Feb 17, 2007, at 10:56 PM, David Binger wrote:
> On Feb 17, 2007, at 3:20 AM, mario ruggier wrote:
>
>> It seems to me that the general meaning of "spec" is "anything we can
>> match() a value against"
>
> In my mind, arguments to match(), that describe sets of values, are
> "specifications".
> spec() is just one kind of specification, as are the other variants in
> the list.

Ah, things will be so much simpler if i were to be able to read your
mind ;-)

Anyhow, I think I see your viewpoint... if i consider Specification in
same way as SpecOperator and as other specs, then the way that the term
"spec" is used throughout the module makes sense.

All of these may be passed to match()... in this sense they behave in
the same way. A spec is a spec is a spec... and that is actually very
nice.

But not all specs seem to be quite equal, as a form of a "spec" that
may be appropriate for one context is not necessarily appropriate for
another (although I think that all mixes and matches I can think of
will still *function* correctly, in term of match() result). For
example :

It does not seem to make sense to pass an instance of Specification to
initialize another Specification. The doc attr and other methods are
pretty much pointless for the "inner" spec. Plus you may end up with
needing something like mySpec.spec.spec to access the real "spec", that
is annoying, and ugly. I had something like this happening in some
client code, that triggered me to try and understand this better. In
any case, there is some sort of difference between specs, and one is
obliged to stay aware of it, even if match() doesn't care.

Similarly, for pretty much the same reason, it does not make sense to
pass an instance of Specification to build a ConnectiveSpecOperator, or
as part of an arrangement of types...

Maybe downcasting Specification instances should these be passed as
building blocks to other specs could avoid unnecessary layering of
specs. Anyhow, in my mind there does seem to be some difference, even
if not in primary function... and I tried to find names for the
different forms hoping this could reduce potential for (my) confusion.

mario











reply