Raku / raku.org

Source code for https://raku.org/
https://raku.org/
Artistic License 2.0
70 stars 50 forks source link

"No such method ˆname" #142

Closed Pytheas01 closed 4 years ago

Pytheas01 commented 4 years ago

I am getting the following error message when I run the below use-butterfly.p6 script on Macosx 10.14.6.

No such method 'ˆname' for invocant of type 'Butterfly' in method who-am-i at /Users/phi/Desktop/p6/Butterfly.pm6 (Butterfly) line 1 in block at use-butterfly.p6 line 4

use-butterfly.p6:

use Butterfly; 
my $b = Butterfly.new; 
$b.who-am-i;

Butterfly.pm6:

unit class Butterfly; 
method who-am-i { put  self.ˆname };

Here's the perl6 version I'm using:

This is Rakudo version 2020.01 built on MoarVM version 2020.01.1 implementing Perl 6.d.

I am running the use-butterfly.p6 script as follows:

perl6 -I . use-butterfly.p6

MasterDuke17 commented 4 years ago

20:50 | Voldenet | I've seen that problem by phi and 20:50 | Voldenet | m: class Butterfly { method who-am-i { put self.ˆname }}; Butterfly.new.who-am-i 20:50 | camelia | rakudo-moar 9e8adb659: OUTPUT: «No such method 'ˆname' for invocant of type 'Butterfly'␤ in method who-am-i at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤» 20:51 | Voldenet | no idea what uses ˆ instead of ^ 20:52 | MasterDuke | ha! 20:52 | MasterDuke | Voldenet++ 20:52 | MasterDuke | unicodable6: ˆ 20:52 | unicodable6 | MasterDuke, U+02C6 MODIFIER LETTER CIRCUMFLEX ACCENT [Lm] (ˆ)

Pytheas01 commented 4 years ago

Hi, Here's some additional information. In VS Code 1.4.1 for Macosx, whenever you type a caret (circumflex accent) using the US International PC keyboard, you get a small ^. You then have to press the spacebar to get a regular-sized ^. The above issue may be due to the fact that I "forgot" to press the spacebar after typing the caret. I have had the same issue before when typing a tilde in VS Code preceding a C++ destructor: CLand didn't recognize the character.