Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am interested in making a simple accounting style line calculator that allows me to interact with it something like this:

In[]:   4 + 5
Out[]:  9
In[]:   +3
Out[]:  12
In[]:   *2
Out[]:  24
In[]:   /4
Out[]:  6

In the front end, I can do this with:

$PreRead = (ReplaceAll[#, {"*" :> "% *", "+" :> "% +", "-" :> "% - ", 
 "/" :> "% /"}] &)

(And stop it by $PreRead =.) which works nicely, however I would like to use the numberpad, and the + key on the number pad starts a free form input.

So, I thought I'd be sneaky and open up a kernel window. Sadly, the above assignment of $PreRead doesn't seem to execute in the Kernel, even though it looks like the variable has been assigned properly.

I'm interested in why $PreRead isn't behaving the same in the Kernel window as it would in the front end, and it wouldn't hurt to know if it is possible to shut off the keymapping of the numberpad + key to free form input.

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.