in reply to Re^6: Distinguish between missing and undefined arguments with subroutine signatures (semipredicate problem)
in thread Distinguish between missing and undefined arguments with subroutine signatures

> It does not prevent the sub from being called with more arguments than allowed.

hmm ... you are going to extremes now. :)

so

->mutate(FIELD) is a getter for FIELD

->mutate(FIELD,VALUE) is a setter for FIELD

->mutate(FILED,VALUE,OTHER...) shouldn't compile

I think, in this particular case you can still apply a prototype of ($;$) together with the signature ($field,@values)

At least theoretically, not sure if it's still implemented that way.

UPDATE

well not with methods, see other post:

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^7: Distinguish between missing and undefined arguments with subroutine signatures (semipredicate problem)
  • Select or Download Code