Feature SS-2409
1 vote

UnitsOf(): Return value for indeterminate argument

Created by Martin Kraska on 9/18/2016 6:36 PM Last Updated by Martin Kraska on 9/19/2016 7:58 AM
%
 (hrs)
Logged: 0   (hrs)

 Description

I propose to change the behaviour of UnitsOff() such that it returns itself unless all symbols except units evaluate numerically.

Current state: If UnitsOf() is called with an undefined argument, it returns 1.

I think this is a bug and would expect some error message like "unknown" or "xxx is not defined"

This example demonstrates that even the mechanism of not allowing UnitsOf() to be called for undefined arguments is not sufficient. This mechanism is fooled by a simple definition chain. Instead, the function should determine inside if it can provide a valid result.

    Martin Kraska (Monday, September 19, 2016 7:58 AM) #

Looks good, thanks.

    smath (Monday, September 19, 2016 1:33 AM) #

Fixed.