On Mon, Jul 27, 2026 at 06:52:55PM +0200, 'Ralf Hemmecke' via FriCAS - computer algebra system wrote:
> As I understand, an underscore at the beginning of an identifier must be
> doubled in the input to mean that there is just one underscore in the
> identifier.
>
> %%% (15) -> __foo := "bar"
>
> (15) "bar"
>
> This actually defines the identifier _foo internally.
>
> %%% (16) -> __foo
>
> (16) "bar"
>
> %%% (17) -> )clear prop __foo
>
> %%% (17) -> __foo
>
> (17) "bar"
>
> Why does this variable keep its value? There is obviously a difference in
> handling underscores in SPAD and on a )clear line.
> Isn't that a bit confusing for a user?
Yes, it is. Unfortunatly several function do not use scanner to get
symbols, but simply take space-delimited sequence of characters
and treats it as symbol name. Sometimes functions use some
ad-hoc handling of underscores (that used to be the case with
older HyperDoc search). We should fix this.
> %%% (18) -> _foo
>
> (18) foo
>
> That is clear, since just one underscore escapes the initial f and that
> gives f.
>
> %%% (19) -> )clear prop _foo
>
> %%% (19) -> __foo
>
> (19) _foo
>
> %%% (20) -> _foo
>
> (20) foo
>
--
Waldek Hebisch