* Ovid <publiustemp-catal...@yahoo.com> [2012-03-22T17:08:31]
> In trying to explain this, I got stuck on "Item" and "Value". I have the
> following note about them:

We discussed this briefly on Twitter.  For the record, it was around

  https://twitter.com/ovidperl/status/182936878192934912

> A word about the types in Moose::Util::TypeConstraints. "Any" means "anything"
> (duh). An "Item" is the same as "Any" and in your author's consultation with
> Moose experts, there was confusion expressed as to why these were different

My guess is that it's vestigal from some concept of validating non-scalars.
But I don't know.  "It never comes up."

> A "Value" is "anything which is defined and not a reference". But since
> everything which is a "Value" is also a "Str" (String) type, it's also
> unclear why "Value" was included, except for possibly defining future types
> which may apply.

As we discussed, this is not true.  Str is a subset of Value, and not identical
to it.  For example, C<< *main >> is accepted by Value and not by Str.  There's
nothing too weird about this.

"foo" is a Str but not a Num, but we don't need any other type just to cover
it.  (NonNumStr?  AlphanumStr?)  Value is like that.  I'm not sure I've ever
seen Value used to good effect.  It's not a particuarly useful thing to
validate.  But it's a meaningful part of the hierarchy, and it got named.  It
could be useful if we end up with other non-reference values someday, but I
wouldn't bother with it.

  "Value" is "anything which is defined and not a reference."  Almost
  any time you say this, you really mean Str (a string), as the only things
  that fall into Value and not Str are pretty esoteric.

-- 
rjbs

Attachment: signature.asc
Description: Digital signature

Reply via email to