Would anyone miss convertOctals?

Ralf Bitter rabit at revigniter.com
Thu Jun 9 11:25:45 EDT 2022



On 09.06.22 14:44, 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?

Yes


> 
>    2) If you do, have you ever actually used it in any scripts which are 
> actually still in use?

Yes, revIgniter uses "convertOctals" and "umask" dealing with access 
permissions of files and folders.

> 
>    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?

Sure, I would exchange them with carrots.

> 
>    4) If you do use/have used it, had you ever noticed that it has been 
> slightly broken for years?

I have to admit, no.

> 
> 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!
> 

Ralf




More information about the use-livecode mailing list