Skip to content

Conversation

stoned
Copy link
Collaborator

@stoned stoned commented Oct 25, 2019

  • Sync output with code example
  • Update code example description
  • Advise .^name usage

The problem

.WHAT was removed from an example in snippet in doc/Language/classtut.pod6 a year ago in favor of .^name: this is a followup

- Sync output with code example
- Update code example description
- Advise .^name usage
=end code

The first two tests each smartmatch against a class name. If the object is
of that class, or of an inheriting class, it returns true. So the object in
question is of class C<Employee> or one that inherits from it, but not
C<GeekCook>.

The C<.WHAT> method returns the type object associated with the object
C<$o>, which tells us the exact type of C<$o>: in this case C<Programmer>.
The call C<$o.^name> tells us the type of C<$o>: in this case C<Programmer>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here it's useful to mention both of them.

Copy link
Member

@AlexDaniel AlexDaniel Oct 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jnth The code doesn't use .WHAT so that's why the output and the description are being tweaked, I think you mean that we should revert the original commit?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See c401786

Copy link
Contributor

@JJ JJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this.

@JJ JJ merged commit 9fc140b into Raku:master Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants