11712 |
variable is really just an Emacs Lisp variable that contains a Calc number |
variable is really just an Emacs Lisp variable that contains a Calc number |
11713 |
or formula.) A variable's name is normally composed of letters and digits. |
or formula.) A variable's name is normally composed of letters and digits. |
11714 |
Calc also allows apostrophes and @code{#} signs in variable names. |
Calc also allows apostrophes and @code{#} signs in variable names. |
11715 |
The Calc variable @code{foo} corresponds to the Emacs Lisp variable |
(The Calc variable @code{foo} corresponds to the Emacs Lisp variable |
11716 |
@code{var-foo}. Commands like @kbd{s s} (@code{calc-store}) that operate |
@code{var-foo}, but unless you access the variable from within Emacs |
11717 |
on variables can be made to use any arbitrary Lisp variable simply by |
Lisp, you don't need to worry about it.) |
|
backspacing over the @samp{var-} prefix in the minibuffer. |
|
11718 |
|
|
11719 |
In a command that takes a variable name, you can either type the full |
In a command that takes a variable name, you can either type the full |
11720 |
name of a variable, or type a single digit to use one of the special |
name of a variable, or type a single digit to use one of the special |
11721 |
convenience variables @code{var-q0} through @code{var-q9}. For example, |
convenience variables @code{q0} through @code{q9}. For example, |
11722 |
@kbd{3 s s 2} stores the number 3 in variable @code{var-q2}, and |
@kbd{3 s s 2} stores the number 3 in variable @code{q2}, and |
11723 |
@w{@kbd{3 s s foo @key{RET}}} stores that number in variable |
@w{@kbd{3 s s foo @key{RET}}} stores that number in variable |
11724 |
@code{var-foo}. |
@code{foo}. |
11725 |
|
|
11726 |
To push a variable itself (as opposed to the variable's value) on the |
To push a variable itself (as opposed to the variable's value) on the |
11727 |
stack, enter its name as an algebraic expression using the apostrophe |
stack, enter its name as an algebraic expression using the apostrophe |
11728 |
(@key{'}) key. Variable names in algebraic formulas implicitly have |
(@key{'}) key. |
11729 |
|
|
11730 |
|
xxx |
11731 |
|
Variable names in algebraic formulas implicitly have |
11732 |
@samp{var-} prefixed to their names. The @samp{#} character in variable |
@samp{var-} prefixed to their names. The @samp{#} character in variable |
11733 |
names used in algebraic formulas corresponds to a dash @samp{-} in the |
names used in algebraic formulas corresponds to a dash @samp{-} in the |
11734 |
Lisp variable name. If the name contains any dashes, the prefix @samp{var-} |
Lisp variable name. If the name contains any dashes, the prefix @samp{var-} |
14141 |
turn into the @code{assign} function, which Calc normally displays |
turn into the @code{assign} function, which Calc normally displays |
14142 |
using the @samp{:=} symbol. |
using the @samp{:=} symbol. |
14143 |
|
|
14144 |
The variables @code{var-pi} and @code{var-e} would be displayed @samp{pi} |
The variables @code{pi} and @code{e} would be displayed @samp{pi} |
14145 |
and @samp{e} in Normal mode, but in C mode they are displayed as |
and @samp{e} in Normal mode, but in C mode they are displayed as |
14146 |
@samp{M_PI} and @samp{M_E}, corresponding to the names of constants |
@samp{M_PI} and @samp{M_E}, corresponding to the names of constants |
14147 |
typically provided in the @file{<math.h>} header. Functions whose |
typically provided in the @file{<math.h>} header. Functions whose |
17222 |
|
|
17223 |
If your system does not have a suitable @samp{date} command, you |
If your system does not have a suitable @samp{date} command, you |
17224 |
may wish to put a @samp{(setq var-TimeZone ...)} in your Emacs |
may wish to put a @samp{(setq var-TimeZone ...)} in your Emacs |
17225 |
initialization file to set the time zone. The easiest way to do |
initialization file to set the time zone. (Since you are interacting |
17226 |
|
with the variable @code{TimeZone} directly from Emacs Lisp, the |
17227 |
|
@code{var-} prefix needs to be present.) The easiest way to do |
17228 |
this is to edit the @code{TimeZone} variable using Calc's @kbd{s T} |
this is to edit the @code{TimeZone} variable using Calc's @kbd{s T} |
17229 |
command, then use the @kbd{s p} (@code{calc-permanent-variable}) |
command, then use the @kbd{s p} (@code{calc-permanent-variable}) |
17230 |
command to save the value of @code{TimeZone} permanently. |
command to save the value of @code{TimeZone} permanently. |
27851 |
The @kbd{s s} (@code{calc-store}) command stores the value at the top of |
The @kbd{s s} (@code{calc-store}) command stores the value at the top of |
27852 |
the stack into a specified variable. It prompts you to enter the |
the stack into a specified variable. It prompts you to enter the |
27853 |
name of the variable. If you press a single digit, the value is stored |
name of the variable. If you press a single digit, the value is stored |
27854 |
immediately in one of the ``quick'' variables @code{var-q0} through |
immediately in one of the ``quick'' variables @code{q0} through |
27855 |
@code{var-q9}. Or you can enter any variable name. The prefix @samp{var-} |
@code{q9}. Or you can enter any variable name. |
|
is supplied for you; when a name appears in a formula (as in @samp{a+q2}) |
|
|
the prefix @samp{var-} is also supplied there, so normally you can simply |
|
|
forget about @samp{var-} everywhere. Its only purpose is to enable you to |
|
|
use Calc variables without fear of accidentally clobbering some variable in |
|
|
another Emacs package. If you really want to store in an arbitrary Lisp |
|
|
variable, just backspace over the @samp{var-}. |
|
27856 |
|
|
27857 |
@kindex s t |
@kindex s t |
27858 |
@pindex calc-store-into |
@pindex calc-store-into |
28036 |
special variables @code{inf}, @code{uinf}, and @code{nan} (which are |
special variables @code{inf}, @code{uinf}, and @code{nan} (which are |
28037 |
normally void). |
normally void). |
28038 |
|
|
28039 |
Note that @code{var-pi} doesn't actually have 3.14159265359 stored |
Note that @code{pi} doesn't actually have 3.14159265359 stored |
28040 |
in it, but rather a special magic value that evaluates to @cpi{} |
in it, but rather a special magic value that evaluates to @cpi{} |
28041 |
at the current precision. Likewise @code{var-e}, @code{var-i}, and |
at the current precision. Likewise @code{e}, @code{i}, and |
28042 |
@code{var-phi} evaluate according to the current precision or polar mode. |
@code{phi} evaluate according to the current precision or polar mode. |
28043 |
If you recall a value from @code{pi} and store it back, this magic |
If you recall a value from @code{pi} and store it back, this magic |
28044 |
property will be lost. |
property will be lost. |
28045 |
|
|
28050 |
followed by an @kbd{s t} in two important ways. First, the value never |
followed by an @kbd{s t} in two important ways. First, the value never |
28051 |
goes on the stack and thus is never rounded, evaluated, or simplified |
goes on the stack and thus is never rounded, evaluated, or simplified |
28052 |
in any way; it is not even rounded down to the current precision. |
in any way; it is not even rounded down to the current precision. |
28053 |
Second, the ``magic'' contents of a variable like @code{var-e} can |
Second, the ``magic'' contents of a variable like @code{e} can |
28054 |
be copied into another variable with this command, perhaps because |
be copied into another variable with this command, perhaps because |
28055 |
you need to unstore @code{var-e} right now but you wish to put it |
you need to unstore @code{e} right now but you wish to put it |
28056 |
back when you're done. The @kbd{s c} command is the only way to |
back when you're done. The @kbd{s c} command is the only way to |
28057 |
manipulate these magic values intact. |
manipulate these magic values intact. |
28058 |
|
|
28214 |
use a different file instead of @file{.emacs}.) |
use a different file instead of @file{.emacs}.) |
28215 |
|
|
28216 |
If you do not specify the name of a variable to save (i.e., |
If you do not specify the name of a variable to save (i.e., |
28217 |
@kbd{s p @key{RET}}), all @samp{var-} variables with defined values |
@kbd{s p @key{RET}}), all Calc variables with defined values |
28218 |
are saved except for the special constants @code{pi}, @code{e}, |
are saved except for the special constants @code{pi}, @code{e}, |
28219 |
@code{i}, @code{phi}, and @code{gamma}; the variables @code{TimeZone} |
@code{i}, @code{phi}, and @code{gamma}; the variables @code{TimeZone} |
28220 |
and @code{PlotRejects}; |
and @code{PlotRejects}; |
28226 |
@kindex s i |
@kindex s i |
28227 |
@pindex calc-insert-variables |
@pindex calc-insert-variables |
28228 |
The @kbd{s i} (@code{calc-insert-variables}) command writes |
The @kbd{s i} (@code{calc-insert-variables}) command writes |
28229 |
the values of all @samp{var-} variables into a specified buffer. |
the values of all Calc variables into a specified buffer. |
28230 |
The variables are written in the form of Lisp @code{setq} commands |
The variables are written with the prefix @code{var-} in the form of |
28231 |
|
Lisp @code{setq} commands |
28232 |
which store the values in string form. You can place these commands |
which store the values in string form. You can place these commands |
28233 |
in your @file{.emacs} buffer if you wish, though in this case it |
in your @file{.emacs} buffer if you wish, though in this case it |
28234 |
would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i} |
would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i} |