#5251: [with patch, needs review] preparser bug in parsing the backslash "solve
right" notation
--------------------+-------------------------------------------------------
 Reporter:  was     |        Owner:  mhansen 
     Type:  defect  |       Status:  assigned
 Priority:  major   |    Milestone:  sage-3.3
Component:  misc    |   Resolution:          
 Keywords:          |  
--------------------+-------------------------------------------------------
Comment (by was):

 {{{
 22:57 < wstein> mhansen -- Hi -- I posted some remarks on #5251
 22:58 < mhansen> I'm reading them now.
 22:58 < wstein> I'm ashamed of how bad the preparser is on \.
 22:58 < wstein> It's all my fault, of course.
 22:58 < wstein> I also just wrote Robertwb to ask him to comment on the
 ticket... even though that
                 might mean waiting for his
 22:58 < wstein> feedback until Monday.
 23:02 < mhansen> One quick fix on the safe side would be to eliminate the
 stopping condition.  That's
                  how I figured it was implemented anyway.  I only thought
 a simple "A \ x" syntax was
                  supported.
 23:02 < wstein> A\x + B\y would be a disaster.
 23:02 < wstein> Of course, it already is :-)
 23:02 < mabs> :)
 23:02 < wstein> sage: preparse(r'A\x + B\y')
 23:02 < wstein> 'A._backslash_(x + B)._backslash_(y)'
 23:03 < mhansen> Obviously no one has used it for anything too involved
 :-)
 23:03 < wstein> without the stopping, we would have
 23:03 < wstein> sage: preparse(r'v = A\x  # find the solution')
 23:03 < wstein> 'v = A._backslash_(x  )# find the solution'
 23:03 < wstein> oops
 23:03 < wstein> that's now
 23:03 < wstein> we would have
 23:03 < wstein> 'v = A._backslash_(x  # find the solution)'
 23:04 < wstein> I wonder if we should deprecate it?
 23:04 < wstein> I like the feature, but the implementation is so bad.
 23:04 < wstein> And doing it right might be quite hard.
 23:04 < wstein> Also, it clearly can't be used that much...
 23:05 < mhansen> I would probably throw in a deprecation warning until we
 do a proper fix.
 23:05 < wstein> Use, I definitely mean by deprecate that there would be a
 deprecation warning.
 23:05 < mhansen> Just so anyone who uses it knows there are "issues".
 23:05 < wstein> Yep.
 23:05 < wstein> How to do it -- ?
 23:05 < wstein> One way would be to add something to A._backslash_
 23:05 < wstein> The other would be to actually make the preparser itself
 emit a warning as it preparses.
 23:05 < wstein> The latter would be more robust.
 23:06 < mhansen> That was what I was envisioning.
 23:06 < wstein> It's possible other code already in preparser.py can be
 used though to quickly fix this
                 problem well.
 23:06 < wstein> Robertwb wrote is particularly good at this sort of thing,
 being a "compiler guy".
 23:06 < mhansen> Agreed.  He has some other improvements to the preparser
 at #5106.
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5251#comment:3>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to