What does the reader of arrays and hashes return in scalar context? #80
-
What does the reader of arrays and hashes return in scalar context? 6.2.3.2 :reader(optional_identifier) https://github.com/Ovid/Cor/blob/master/rfc/attributes.md#6232-readeroptional_identifier
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
This will behave as Perl does if you use an array or hash in scalar context. A reader in scalar context returns the number of elements for an array field, and the number of keys (since Perl 5.26) for a hash field. So, |
Beta Was this translation helpful? Give feedback.
-
At the present time, we don't plan to put attributes on fields which are not scalars because the behavior isn't clear. This would be a feature for after the MVP. |
Beta Was this translation helpful? Give feedback.
-
@yuki-kimoto You do seem to be asking a lot of questions lately that could be quite easily answered by reading the spec / current implementation / inspiration from Object::Pad. Engagement is good, but perhaps you could do some of your own research first before raising all these questions? |
Beta Was this translation helpful? Give feedback.
At the present time, we don't plan to put attributes on fields which are not scalars because the behavior isn't clear. This would be a feature for after the MVP.