librasteve / raku-Physics-Measure

do calculations on objects with value, units and error
Artistic License 2.0
11 stars 2 forks source link

REPL error #62

Closed bazzaar closed 11 months ago

bazzaar commented 11 months ago
bazzaar:~/Documents/raku> raku
Welcome to Rakudo™ v2023.08.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2023.08.

To exit type 'exit' or '^D'
[0] > use Physics::Measure :ALL;
Nil
[1] > my $θ1 = ♎️<45°30′30″>;
===SORRY!=== Error while compiling:
Malformed initializer
------> my $θ1 =⏏ ♎️<45°30′30″>;
    expecting any of:
        prefix
        term
[1] >

... and yet the same code (with a say $θ1; at the end) in a file runs as expected:

bazzaar:~/Documents/raku> raku angle_test.raku
45°30′30″
librasteve commented 11 months ago

I confirm the same issue on the repl.

I successfully tried this is App::Crag:

crag 'say ♎️<43°30′30″>'    #43°30′30″
crag 'say libra<43°30′30″>'  #43°30′30″

I tried the unicode free version in my repl and that failed the same way as the unicode version.

So I conclude that (at least for the libra style) that Physics::Measure is not supported by the repl model of export prefix persistence. Since the repl should be regarded as a toy in many ways, I do not plan to fix this.

I would suggest you look at one of the three modes that have been tested: