Re:Input Line Evaluation
- To: mathgroup at smc.vnet.net
- Subject: [mg42760] Re:Input Line Evaluation
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Fri, 25 Jul 2003 05:08:05 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
jmt wrote: > I am trying to have every input line commands managed by Mathematica and sent to > another program. I thought I could use $Pre and a function t that performs a redirection > to the other program, something like > SetAttributes[$Pre,HoldAll] > $Pre:=(t[#];Identity[#])& > but, with for instance, > t = Print[Unevaluated[#]]& > > 1+1 (ENTER TO EVALUATE) > 2 > Out[]= 2 > > How can I have the t function get the full input line ? > > You need a $Pre with better control of evaluation. Try the following. $Pre=Function[{a},t[Unevaluated[a]];Identity[Unevaluated[a]],{HoldAll}] -------------------- Regards, Ted Ersek Download Mathematica tips, tricks from http://www.verbeia.com/mathematica/tips/Tricks.html