Nick Lockwood

Results 215 comments of Nick Lockwood

@jmserrato I'm not sure I understand what you mean by "evaluate is throwing the error". The expression "2+3.5" seems to work correctly if your region is set to French. Are...

I'm not sure how function like `pow(4,5)` would work if `,` was being used as the decimal separator. Do you know how this is normally handled in French apps? I'm...

There's not a super-elegant way to do this right now, but basically yes you'd need to reimplement the standard operator logic inside your own handlers. Here's an example: ```swift let...

@penacristian you should be able to implement this yourself currently by providing custom operator implementations. The problem with making it part of the standard library is that + is currently...

@wildthink the problem is that Expression doesn't support `inout` arguments. The left hand side of `=` is mutated by the assignment, but there's no way to do that because it's...

@wildthink correct. Symbol lookup is done separately prior to calling the operator implementation. Using AnyExpression, you can do something like have every symbol evaluate to an instance of a custom...

@wildthink that seems very similar to my original implementation. What happens if you try to reassign a value to `a` after you’ve assigned it the first time? I’m guessing you’ll...

@wildthink you’d probably also get rather confusing errors if you try to use a variable before first assigning it. For `scope.eval(“5 * a”)` Instead of “symbol not found” the error...

@wildthink the BoxedValue solution I mentioned would work if you don’t mind having to reimplement the standard operators. I can knock up an example for you if you like?

@wildthink it's no trouble. This is something that really ought to be supported properly, but I've not really had a need for it besides the REPL example. There are probably...