Hello,

Sorry for being so late.

Le dim. 26 nov. 2023 à 18:00, Waldek Hebisch <de...@fricas.org> a écrit :
>
> On Sun, Nov 26, 2023 at 05:20:11PM +0100, Grégory Vanuxem wrote:
> > Hi here,
> >
> > I have read some discussions about using Unicode. Frankly speaking,
> > that reminds me of the past, when Debian developers did not want to
> > support 64 bits by default instead of 32 bits. They were wrong.  From
> > my point of view Unicode is a must have. Otherwise the Lisp subsystem
> > is outdated, I think:
> >
> > 'a' ∈ "abcd"
> >
> > must return true. We are in 2023 and almost 2024.
> >
> > As of now with SBCL:
> >
> > (1) -> 'a' ∈ "abcd"
> >   Line   1: 'a' ∈ "abcd"
> >            ....AB
> >   Error  A: Improper syntax.
> >   Error  B: The character #\ELEMENT_OF is not a FriCAS character.
> >    2 error(s) parsing
> >
> > (3) -> "a" ∈ "abcd"
> >   Line   1: "a" ∈ "abcd"
> >            ....AB
> >   Error  A: Improper syntax.
> >   Error  B: The character #\ELEMENT_OF is not a FriCAS character.
> >    2 error(s) parsing
>
> Well, you can do:
>
> (4) -> α(x) == x + 1
>                                                                    Type: Void
> (5) -> β := 2
>
>    (5)  2
>                                                         Type: PositiveInteger
> (6) -> α(β)
>    Compiling function α with type PositiveInteger -> PositiveInteger
>
>    (6)  3
>                                                         Type: PositiveInteger
>
> so, as you see Unicode is supported.

Thanks for making me remember greek letter support. In fact I also no
longer remember where this is implemented. But that's a good thing
this is supported. Since I sometimes interact with Julia I like the
way it supports Unicode in a terminal, for example \in plus <TAB> will
replace \in with ∈ automatically. It even completes functions or
unicode commands so \empt plus two <TAB> will complete to \emptyset
and after ∅. It could be interesting I think to add this type of
support in terminal supporting unicode in FriCAS. And even for Jupyter
notebook, Jfricas, why not.

> But FriCAS has no definition
> for ∈, so
> (7) -> _∈ + β
>
>    (7)  ∈ + 2
>                                                     Type: Polynomial(Integer)
> works because leading _ intructs FriCAS to treat ∈ as identifier,
> but FriCAS has no idea that you want ∈ to be infix operator.

Yes, and it's a pity I think. But when I speak of Unicode support in
terminal or spad/input file I do not think about all unicode
characters, just, say, greek letters and, grossly, mathematical
related characters. After, some 'look like" character can be
introduced. For example, Chrome, Firefox etc. refused to add unicode
URL support to their browser because of security concerns. There is a
cyrilic character that looks very like the 'l' (L), so gmail, google,
apple can easily be spoofed.

But what do you think of adding support to some mathematical operators
in Unicode notation?

> (8) -> 'a' in "abcd"
>   Line   1: 'a' in "abcd"
>            ....A
>   Error  A: Improper syntax.
>    1 error(s) parsing
>
> OK, FriCAS knows that 'in' is a keyword, so does not complain here.
> But syntax does not allow 'in' as operator.
>
> > This is why I kept supporting Julia String. Even if this is not my aim
> > to keep supporting Julia String. Try that for syntax highlighting:
> >
> > "((?:[[:alpha:]_\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{So}←-⇿])(?:[[:word:]_![:word:]_\\?\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{Mn}\u0001-¡]|[^\\P{Mc}\u0001-¡]|[^\\P{Nd}\u0001-¡]|[^\\P{Pc}\u0001-¡]|[^\\P{Sk}\u0001-¡]|[^\\P{Me}\u0001-¡]|[^\\P{No}\u0001-¡]|[′-‷⁗]|[^\\P{So}←-⇿])*)({(?:[^{}]|{(?:[^{}]|{[^{}]*})*})*})?\\??(\\()",
>
> I am not sure what you mean here.  This certainly is not valid
> definition of Vim highlighting.

Definitively no. I only use Vim in terminals for "quick" use. This is
just an unicode regular expression, the 'syntax highlighting' is
irrelevant here, sorry. But, again, It would be good I think to add
more support for unicode characters (and of course unicode based
operators). About this, I do not even have tested to add Unicode
special characters in Spad, say, greek letters.

The regular expression above comes from another project, and I still
use it for future use. I'm writing a VSCode [1]  extension for FriCAS
but that's a big project. Even if it is time consuming it advances. I
will unhide it from GitHub in the next two month I hope.

Thanks for the response.

- Greg

[1] Codium for pure open source version

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/CAHnU2daz0drSKRpEUUN35TmFhSMnEvS2ECChAVPaxxtP05zZaQ%40mail.gmail.com.

Reply via email to