`2sqrt(2)` is allowed, but `2√2` is not. Is this a bug?

The manual says

| Function | Description |
|:------------------------ |:-------------------------------------------------------------------------- |
| sqrt(x), √x | square root of x |

However,

julia> 2sqrt(2)
2.8284271247461903

julia> 2√2
ERROR: syntax: extra token "√" after end of expression

Is this a bug, or intended? (To me, 2√2 looks much better/cleaner than 2sqrt(2) or 2*√2…)

1 Like

Currently, multiplication by juxtaposition is not allowed for prefix operators. I don’t think we’d want to allow 2!true, for example. So no, this is not a bug.

However, it seems pretty reasonable to allow this for the root operators as a future feature.

1 Like

@Sleort it would be great if you could open an issue on GitHub for this feature request.

It seems too complex to allow it for some prefix operators and not for others. Is there an elegant way to handle this?

@juliohm done :slight_smile: