Ingo Blechschmidt wrote:
Are signatures going to be an exposed first class object in Perl 6?
I hope so, too.
  # Signature objects should stringify to a canonized form, e.g.:
  # ~sub (Str $bar, CoolClass $z where {...}) {...}.signature ==>
  # 'Str $bar, ANONCLASS(0xDEADBEEF)'
  # (BTW, I don't think it's possible to display anonymous subtypes more
  # friendly, as the where-clause may contain arbitrary code, and Code
  # objects are not (yet?) fully introspectable -- i.e.
  # &foo.statements[3].line doesn't work.)

  # Number of required args
  # Hash name -> class

  # etc.

Translations of the corresponding Pugs types into Perl 6 code is at:


However they are mostly still sketches.  If you have specific ideas about
the Code::Signature signature in Pure Perl terms, place it in;


These objects will eventually be what you get from &foo.meta, etc.  Or at
least I assume that the way to get to the object's signature will be .meta.
Maybe the "Code" class will define a ".signature" method as an alternative
to .meta.signature.


Reply via email to