• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSExpression is incorrect?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSExpression is incorrect?


  • Subject: Re: NSExpression is incorrect?
  • From: Dave DeLong <email@hidden>
  • Date: Mon, 22 Nov 2010 20:35:06 -0800

Thanks for this suggestion, Ben.  I ultimately went with a combination of this suggestion (dynamically determining associativity) and Ronald's suggestion (allowing the user to choose).  My parser will start with the associativity used by NSExpression, but provides a property to change it.

Thanks!

Dave

On Nov 21, 2010, at 3:33 AM, Ben Haller wrote:

>  Another option would be to make your code mimic whatever NSExpression is doing on that machine, by evaluating 2 ** 3 ** 2 (once, and caching the result) and seeing whether it comes out as 64 or 512.  That way if/when Apple fixes their bug, your code will seamlessly follow suit.
>
>  Which of these alternatives is best depends upon how your code is going to be used, of course.  Roland's suggestion of a compatibility switch seems good; the behavior I suggest could be a third option for that switch.  Then the user of the class can decide what they want to get.  Probably the best default would be to use the correct (right associative) parsing, though, as it seems unlikely that a whole lot of code specifically depends upon this bug in NSExpression, so for most clients there is probably no need to propagate the buggy behavior...
>
> Ben Haller
> McGill University
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSExpression is incorrect? (From: Dave DeLong <email@hidden>)
 >Re: NSExpression is incorrect? (From: Roland King <email@hidden>)
 >Re: NSExpression is incorrect? (From: Ben Haller <email@hidden>)

  • Prev by Date: Re: Obtaining all points on a line segment
  • Next by Date: Radio dial buttons [iOS]
  • Previous by thread: Re: NSExpression is incorrect?
  • Next by thread: help with bindings
  • Index(es):
    • Date
    • Thread