Code Review: bigdecimal-2

tfpt review “/shelveset:bigdecimal-2;REDMOND\jflam”
Comment :
BigDecimal contribution from Peter Bacon D.

Code looks good. There might have been less churn to have CodeContext
on each method now so that we can use it to get a Config later – but
there’s also something to be said for making it work first.

Style consistency issues:
The line endings in bigdecimal.cs appear to be a mix of LF and CRLF.
They should all be CRLF.
We tend to prefer not to say “this.varname = x”; if the symbol name
conflicts, it should be changed if possible.

One more note:

    // TODO: This static field need to be added to a hash on 

RubyExecutionContext
private static readonly BigDecimal.Config _config = new
BigDecimal.Config();
internal static BigDecimal.Config GetConfig() { return _config;
}

There is already API on RubyContext for what you need:

    public bool TryGetLibraryData(object key, out object value)
    public object GetOrCreateLibraryData(object key, Func<object> 

valueFactory)
public bool TryAddLibraryData(object key, object value, out
object actualValue)

Tomas

I’m going ahead and removing the static field. Love the
GetOrCreateLibraryData API! :slight_smile:

Thanks,
-John

I noticed the file name casing is wrong: bigdecimal.cs, fraction.cs. Was
it broken by some transformation?

Tomas