Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: recognize "doubled" Unicode characters in Raku ternary operator (question mark and exclamation point). #433

Open
jubilatious1 opened this issue Jul 23, 2024 · 6 comments
Labels
fallback If no other label fits

Comments

@jubilatious1
Copy link

Unicode provides two characters that can (in combination) be used for Raku's ternary operator:


DOUBLE QUESTION MARK
Unicode: U+2047, UTF-8: E2 81 87

‼️
red double exclamation mark
Unicode: U+203C U+FE0F, UTF-8: E2 80 BC EF B8 8F

ATM, ASCII question marks work but Unicode double-question marks do not:

[0] > 1 == 1 ?? True !! False
True
[1] > 1 == 1True !! False
===SORRY!=== Error while compiling:
Confused
------> 1 == 1⏏ ⁇ True !! False
    expecting any of:
        infix
        infix stopper
        statement end
        statement modifier
        statement modifier loop

Same is true for Unicode double-exclamation points:

[2] > 1 == 1 ?? True ‼️ False
===SORRY!=== Error while compiling:
Confused: Found ?? but no !!
------> 1 == 1 ?? True⏏ ‼️ False
    expecting any of:
        infix
        infix stopper

Anyway, I think 1 == 1 ⁇ True ‼️ False looks really cool.

(...and will look even cooler if we can get the Unicode people to accept a GREEN double-question mark).

@lizmat
Copy link
Collaborator

lizmat commented Jul 23, 2024

I wouldn't mind for consistency, but would be very against using colors. Syntax highlighting should be enough: so if you want ‼️, then adjust your syntax highlighting accordingly, I'd say.

@jubilatious1
Copy link
Author

jubilatious1 commented Jul 23, 2024

Hi Liz,

You are quite correct. Initially (above), I wasn't able to locate an uncolored !! Unicode symbol. Only red.

But revisiting the table, I found this one:

‼︎
DOUBLE EXCLAMATION MARK
Unicode: U+203C U+FE0E, UTF-8: E2 80 BC EF B8 8E

Cheers and thank you!

@lizmat
Copy link
Collaborator

lizmat commented Jul 23, 2024

I always use un in these cases:

% un ‼️
 203C DOUBLE EXCLAMATION MARK ‼
 FE0F VARIATION SELECTOR-16 ️

</hint>

@FCO
Copy link
Contributor

FCO commented Jul 31, 2024

rakudo/rakudo#1029

@lizmat
Copy link
Collaborator

lizmat commented Jul 31, 2024

It's unclear to me why this got reverted and why? Some simple code spelunking didn't give me an answer :-(

@FCO
Copy link
Contributor

FCO commented Jul 31, 2024

I don't remember either (if I ever understood)

lizmat added a commit to rakudo/rakudo that referenced this issue Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fallback If no other label fits
Projects
None yet
Development

No branches or pull requests

4 participants