Re: Object Introspection for Existence of Methods: How?

2015-03-22 Thread Henk van Oers


On Sun, 22 Mar 2015, Tom Browder wrote:

On Fri, Mar 20, 2015 at 2:02 PM, Tom Browder tom.brow...@gmail.com wrote:

On Mar 20, 2015 1:51 PM, Tobias Leich em...@froggs.de wrote:

if $obj.^can($method_name) {...


That doesn't seem to work with private methods.  Any trick to accomplish that?


What part of 'private' did you mis?

If you write private methods you do not need introspection.

--
Henk


Re: Object Introspection for Existence of Methods: How?

2015-03-22 Thread Henk van Oers


On Sun, 22 Mar 2015, Tom Browder wrote:

On Sun, Mar 22, 2015 at 7:13 PM, Henk van Oers h...@signature.nl wrote:

On Sun, 22 Mar 2015, Tom Browder wrote:

I'm trying to write a test.

To test what? Your own typo's?


The tests are for a public Perl 6 module translated from an existing
Perl 5 module.

Do Perl 6 modules not need tests?


Yes they need tests.


If so, which ones do they need?


The public interface.


and  which can be left off?


The private stuff.

You can not test for 'random_name'.

This is not about Perl. It's OO-programming.

--
Henk


Re: Object Introspection for Existence of Methods: How?

2015-03-22 Thread Tom Browder
On Fri, Mar 20, 2015 at 2:02 PM, Tom Browder tom.brow...@gmail.com wrote:
 On Mar 20, 2015 1:51 PM, Tobias Leich em...@froggs.de wrote:
 if $obj.^can($method_name) {...

That doesn't seem to work with private methods.  Any trick to accomplish that?

-Tom


Re: Object Introspection for Existence of Methods: How?

2015-03-22 Thread Tom Browder
On Sun, Mar 22, 2015 at 7:13 PM, Henk van Oers h...@signature.nl wrote:
 On Sun, 22 Mar 2015, Tom Browder wrote:
 I'm trying to write a test.
 To test what? Your own typo's?

The tests are for a public Perl 6 module translated from an existing
Perl 5 module.

Do Perl 6 modules not need tests?  If so, which ones do they need? and
which can be left off?

-Tom


Re: Object Introspection for Existence of Methods: How?

2015-03-22 Thread Henk van Oers


On Sun, 22 Mar 2015, Tom Browder wrote:

On Sun, Mar 22, 2015 at 6:22 PM, Henk van Oers h...@signature.nl wrote:

On Sun, 22 Mar 2015, Tom Browder wrote:

On Fri, Mar 20, 2015 at 2:02 PM, Tom Browder tom.brow...@gmail.com
wrote:

On Mar 20, 2015 1:51 PM, Tobias Leich em...@froggs.de wrote:

if $obj.^can($method_name) {...

That doesn't seem to work with private methods.  Any trick to accomplish
that?

What part of 'private' did you mis?
If you write private methods you do not need introspection.


I'm trying to write a test.


To test what? Your own typo's?

--
Henk