Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2035 > unrolled thread

Remove MakeExpression settings

Started byPeter Breitfeld <phbrf@t-online.de>
First post2011-05-02 10:53 +0000
Last post2011-05-03 12:23 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Remove MakeExpression settings Peter Breitfeld <phbrf@t-online.de> - 2011-05-02 10:53 +0000
    Re: Remove MakeExpression settings David Bailey <dave@removedbailey.co.uk> - 2011-05-03 09:44 +0000
      Re: Remove MakeExpression settings Peter Breitfeld <phbrf@t-online.de> - 2011-05-03 12:23 +0000

#2035 — Remove MakeExpression settings

FromPeter Breitfeld <phbrf@t-online.de>
Date2011-05-02 10:53 +0000
SubjectRemove MakeExpression settings
Message-ID<ipm2f1$58n$1@smc.vnet.net>
I made some settings using MakeExpression and MakeBoxes. Suppose I use

beautyOut[a_]:=MakExpression[...]

I can find these definitions in Definition[MakeBoxes] and
Definitions[MakeBoxes].

Sometimes I want to switch off these definitions. The only way I found
is to use Quit.

My question:
Is it possible, to remove the definitions made from the set of
definitons of MakeExpression and Makeboxes?

Thank you
Peter
-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de

[toc] | [next] | [standalone]


#2042

FromDavid Bailey <dave@removedbailey.co.uk>
Date2011-05-03 09:44 +0000
Message-ID<ipoipp$g2j$1@smc.vnet.net>
In reply to#2035
On 02/05/2011 11:53, Peter Breitfeld wrote:
> I made some settings using MakeExpression and MakeBoxes. Suppose I use
>
> beautyOut[a_]:=MakExpression[...]
>
> I can find these definitions in Definition[MakeBoxes] and
> Definitions[MakeBoxes].
>
> Sometimes I want to switch off these definitions. The only way I found
> is to use Quit.
>
> My question:
> Is it possible, to remove the definitions made from the set of
> definitons of MakeExpression and Makeboxes?
>
> Thank you
> Peter
One possibility is not to remove them but activate/deactivate them based 
on a global variable

mySwitch=True;

MakeExpression[...,StandardForm]:=Module[.............]/;mySwitch;

Set up this way, they can be activated/deactivated at will.

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [next] | [standalone]


#2072

FromPeter Breitfeld <phbrf@t-online.de>
Date2011-05-03 12:23 +0000
Message-ID<ipos3l$i41$1@smc.vnet.net>
In reply to#2042
David Bailey wrote:

> On 02/05/2011 11:53, Peter Breitfeld wrote:
>> I made some settings using MakeExpression and MakeBoxes. Suppose I use
>>
>> beautyOut[a_]:=MakExpression[...]
>>
>> I can find these definitions in Definition[MakeBoxes] and
>> Definitions[MakeBoxes].
>>
>> Sometimes I want to switch off these definitions. The only way I found
>> is to use Quit.
>>
>> My question:
>> Is it possible, to remove the definitions made from the set of
>> definitons of MakeExpression and Makeboxes?
>>
>> Thank you
>> Peter
> One possibility is not to remove them but activate/deactivate them based 
> on a global variable
>
> mySwitch=True;
>
> MakeExpression[...,StandardForm]:=Module[.............]/;mySwitch;
>
> Set up this way, they can be activated/deactivated at will.
>
> David Bailey
> http://www.dbaileyconsultancy.co.uk
>

Thanks to David and John!

I now use the following approach. The Definitions are strored in
FormatValues[MakeBoxes] and FormatValues[MakeExpression]. I now maintain
a list "beautyList" which contains all Symbols I want beauty.

I have a Definition defBeauty[a_], which makes setting in MakeBoxes and
MakeExpression. To find these definitions in the FormatValues list, I
add a nonsense form to the form parameter of MakeBoxes/Expression. e.g.

MakeBoxes[bla, form:StandardForm|TraditionalForm|WEIRD]...

The function undefBeauty[a] now looks for the pattern WEIRD, deletes the
entry in FormatValues[...], removes a from beautyList and calls
defBeauty for all remaining entries in beautyList. This works quite good. 

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web