[Maxima-commits] [git] Maxima CAS branch, master, updated. branch-5_31-base-183-gf44d669



Robert Dodier <robert.dodier at gmail.com> writes:
> On 2013-12-11, Rupert Swarbrick <rswarbrick at gmail.com> wrote:
>
>>> +	 (mfuncall $format_prompt destination control-string arguments))
>>> +	(t
>>> +	 (let ((*print-circle* nil))
>>> +	   (concatenate 'string
>>> +			*prompt-prefix*
>>> +			(apply 'aformat destination control-string arguments)
>>> +		        *prompt-suffix*)))))
>>
>> NO! This is a terrible idea. Please see my previous emails.
>
> Um, readers probably can't deduce what is the problem here by piecing
> together comments made in a long chain of emails. I know I can't.

Oops, good point. For example, the one archived here:

  http://permalink.gmane.org/gmane.comp.mathematics.maxima.general/44076

The relevant paragraph:

  The problem I was trying to solve is that without some sort of
  protection like this, it's possible for the user to make Maxima
  completely unusable. I can understand if you believe that user code
  should never be run when drawing a prompt, but I don't agree that it's
  sensible to run user code per prompt without some sort of protection.

The code above runs a user-supplied Maxima function (the mfuncall line
at the top) without some sort of protection, every time a prompt gets
drawn. When the inevitable merror gets thrown, we draw a new prompt...

The reason I'm being so emphatic about this is that I managed to hose
several Maxima sessions when writing my patch in the first place - it's
quite easy to do!


Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20131212/6cd10d57/attachment.pgp>;