From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12254 invoked from network); 27 Jul 2001 19:13:02 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 27 Jul 2001 19:13:02 -0000 Received: (qmail 28757 invoked by alias); 27 Jul 2001 19:12:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15510 Received: (qmail 28745 invoked from network); 27 Jul 2001 19:12:55 -0000 From: "Bart Schaefer" Message-Id: <010727121030.ZM24973@candle.brasslantern.com> Date: Fri, 27 Jul 2001 12:10:30 -0700 In-Reply-To: Comments: In reply to Peter Stephenson "Calculator function" (Jul 27, 11:59am) References: X-Mailer: Z-Mail Lite (5.0.0 30July97) To: Peter Stephenson , zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: Calculator function MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 27, 11:59am, Peter Stephenson wrote: > > I keep meaning to add this. Maybe someone has a better one somewhere? This is pretty nifty. Questions as they pop into my head: > +Each line typed is evaluated as an expression. The prompt shows a number, > +which corresponds to a positional parameter where the result of that > +calculation is stored. For example, the result of the calculation on the > +line preceeded by `tt(4> )' is available as tt($4). Why not have the prompt look like `$4= ' instead of `4> '? > +# Line editing and history are available. A blank line or `q' quits. Hrm, I'd rather that blank lines were just ignored ... I think ... > +# To do: > +# - separate zcalc history from shell history using arrays --- or allow > +# zsh to switch internally to and from array-based history. I posted a function some while back that switches history contexts by dumping the history to a file, then zeroing and restoring HISTSIZE. I can't seem to track it down just now ... there's something sort of like it in zsh-users/3506. What were you thinking of, here? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net