Never use octal. pretty much any entries theses days are decimal or
hexadecimal. Even binary (bit shifting or masks) is exceedingly rare
On 6/9/2022 8:44 AM, Mark Waddingham via use-livecode wrote:
So I'm currently sitting here about to embark on fixing
<https://quality.livecode.com/show_bug.cgi?id=23653> (which is the
final thing to sort out before being able to merge my constant
expression patch) and I was reminded of 'convertOctals'.
Now, generally, I am somewhat averse to actually removing any language
feature (even those we have deprecated, unless we absolutely have to!)
- however, I would really like to make convertOctals have no effect at
all in 10.0+ as it adds a disproportionate amount of complexity
compared to (what I think, at least) its utility is (particularly in
the context of things 'coming next' like the script compiler).
So three questions:
1) Do you know what convertOctals is, and what it does?
2) If you do, have you ever actually used it in any scripts which
are actually still in use?
3) If you do use it in any scripts which are still in use, would you
be willing to change them to not use it?
4) If you do use/have used it, had you ever noticed that it has been
slightly broken for years?
Now, its always better to offer a carrot when there is a stick (or in
this case, an axe) being wielded and the carrot in this case would be
to expand the numeric literal syntax to add both explicit octal and
binary number literals alongside hexadecimal:
0xabcdef - hex literal
0o777 - octal literal
0b101110101
The key difference between 0o777 and using 0777 (with convertOctals
true) is that the former is not ambiguous at parse time, it doesn't
require a runtime property set to true in order for the engine to
convert the string to a number correctly.
Please let me know your thoughts :)
Warmest Regards,
Mark.
P.S. In the scheme of 'breaking changes' - we've already made a number
of them for 10 already, and my gut tells me removing convertOctals is
likely to cause less consternation than those we already have - but I
could be wrong!
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode