Newsgroups: perl.perl6.language
From: Austin_Hasti...@Yahoo.com (Austin Hastings)
Date: Wed, 5 May 2004 20:12:24 -0400
Local: Wed, May 5 2004 8:12 pm
Subject: Specifying class interfaces with AUTOMETH
I was looking at *Unit the other day, and at the very satisfying "Mock
Objects" systems that have grown up around them for automated testing. In a Decorator/delegation context, it seems like yet another case where 1- In(tro)spect the classes you want to replicate/extend and determine their 2- Use AUTOMETH[DEF] to implement a single point of code that catches the AUTOMETHDEF { The benefits of option 2 is no 'eval', more straightforward code, etc. The big drawback is that once you've extended a class in this fashion, How, then, would I go about specifying my 'intented' interface? That is, I want to handle all or part of the interface via a switching A12 is not clear on this point: it mentions (teasingly) AUTOMETH and From A12: `Perl 6's version of .meta.can returns a "WALK" `... it [.meta.can] will exclude from the list of From this, I infer that .meth.can (and dispatchery in general) will traverse Apparently the AUTOMETH code will be invoked to determine what code matches This seems an awkward way to implement dispatch, since the price of using Also, it precludes having multiple candidates from a single source -- like Given that we've got a signature mechanism, it should be straightforward to This has the side-benefit of solving my problem nicely: I can "declare" the Comment? =Austin You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||