fend icon indicating copy to clipboard operation
fend copied to clipboard

Use $ in identifiers

Open NickGeek opened this issue 3 years ago • 3 comments

I would like to be able to use $ in fend like $200/3 to 2dp to print approx. $66.66.

NickGeek avatar Jun 11 '21 08:06 NickGeek

Partially implemented in ac1655d8549d378b89b69b38a3763a6b66ac83e5:

> $200/3 to 2dp
approx. $66.66
> $3 * 7
$21

You can test it here.

Unfortunately there are still some cases where the parser produces an error, particularly when $ is part of a larger left-hand side expression with same/higher precedence (e.g. multiplication). In these cases you currently need to write e.g. 7$ instead of $7.

> 3 * $7
Error: $3 is not a function
> 3 * 7$
$21

printfn avatar Jun 11 '21 11:06 printfn

Nice! Would it be worth adding other currency symbols too?

NickGeek avatar Jun 11 '21 11:06 NickGeek

Euro (€) already works, and it's usually written after the number so that should be fine. I'll add support for £ now.

printfn avatar Jun 11 '21 11:06 printfn