a question on use and . in class declarations

A question on the "use" in a class declaration.

In "use $.x". does the dot have a special meaning
or is it just to make the value ($.x) easier to
access ($objectname.x)?

Many thanks,
-T
0
perl6
12/31/2020 1:41:42 AM
perl.perl6.users 1547 articles. 0 followers. Follow

1 Replies
15 Views

Similar Articles

[PageSpeed] 50

On 12/30/20 5:41 PM, ToddAndMargo via perl6-users wrote:
> A question on the "use" in a class declaration.
> 
> In "use $.x". does the dot have a special meaning
> or is it just to make the value ($.x) easier to
> access ($objectname.x)?
> 
> Many thanks,
> -T


 From my in progress notes on OOP:


*** addressing values inside an object ***

    The dot itself is technically an operator, it means "call the method
    'apples' on the preceding object".  So $FruitStand.apples translates
    to "call the method 'apples' on the object $FruitStand" [11]

[11] https://webchat.freenode.net/?channels=#raku: guifa2 2020-12-30 
18:06:23

0
perl6
12/31/2020 6:24:14 AM
Reply: