Fix the call to set_network_coding_system
[emacs.git] / lisp / calc / calc-store.el
blobe8da2bc327a0a3d6d380d35c305036b97b6b6f7c
1 ;;; calc-store.el --- value storage functions for Calc
3 ;; Copyright (C) 1990-1993, 2001-2016 Free Software Foundation, Inc.
5 ;; Author: David Gillespie <daveg@synaptics.com>
7 ;; This file is part of GNU Emacs.
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation, either version 3 of the License, or
12 ;; (at your option) any later version.
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 ;;; Commentary:
24 ;;; Code:
26 ;; This file is autoloaded from calc-ext.el.
28 (require 'calc-ext)
29 (require 'calc-macs)
31 ;;; Memory commands.
33 (defvar calc-store-keep nil)
34 (defun calc-store (&optional var)
35 (interactive)
36 (let ((calc-store-keep t))
37 (calc-store-into var)))
39 (defvar calc-given-value-flag nil)
40 (defvar calc-given-value)
42 (defun calc-store-into (&optional var)
43 (interactive)
44 (calc-wrapper
45 (let ((calc-given-value nil)
46 (calc-given-value-flag 1))
47 (or var (setq var (calc-read-var-name "Store: " t)))
48 (if var
49 (let ((found (assq var '( ( + . calc-store-plus )
50 ( - . calc-store-minus )
51 ( * . calc-store-times )
52 ( / . calc-store-div )
53 ( ^ . calc-store-power )
54 ( | . calc-store-concat ) ))))
55 (if found
56 (funcall (cdr found))
57 (let ((msg
58 (calc-store-value var (or calc-given-value (calc-top 1))
59 "" calc-given-value-flag)))
60 (message "Stored to variable \"%s\"%s"
61 (calc-var-name var) msg))))
62 (setq var (calc-is-assignments (calc-top 1)))
63 (if var
64 (while var
65 (let ((msg
66 (calc-store-value (car (car var)) (cdr (car var))
67 (if (not (cdr var)) "")
68 (if (not (cdr var)) 1))))
69 (message "Stored to variable \"%s\"%s"
70 (calc-var-name (car (car var))) msg))
71 (setq var (cdr var))))))))
73 (defun calc-store-plus (&optional var)
74 (interactive)
75 (calc-store-binary var "+" '+))
77 (defun calc-store-minus (&optional var)
78 (interactive)
79 (calc-store-binary var "-" '-))
81 (defun calc-store-times (&optional var)
82 (interactive)
83 (calc-store-binary var "*" '*))
85 (defun calc-store-div (&optional var)
86 (interactive)
87 (calc-store-binary var "/" '/))
89 (defun calc-store-power (&optional var)
90 (interactive)
91 (calc-store-binary var "^" '^))
93 (defun calc-store-concat (&optional var)
94 (interactive)
95 (calc-store-binary var "|" '|))
97 (defun calc-store-neg (n &optional var)
98 (interactive "p")
99 (calc-store-binary var "n" '/ (- n)))
101 (defun calc-store-inv (n &optional var)
102 (interactive "p")
103 (calc-store-binary var "&" '^ (- n)))
105 (defun calc-store-incr (n &optional var)
106 (interactive "p")
107 (calc-store-binary var "n" '- (- n)))
109 (defun calc-store-decr (n &optional var)
110 (interactive "p")
111 (calc-store-binary var "n" '- n))
113 (defun calc-store-value (var value tag &optional pop)
114 (let ((msg ""))
115 (if var
116 (let ((old (calc-var-value var)))
117 (set var value)
118 (if pop (or calc-store-keep (calc-pop-stack pop)))
119 (calc-record-undo (list 'store (symbol-name var) old))
120 (if tag
121 (let ((calc-full-trail-vectors nil))
122 (calc-record value (format ">%s%s" tag (calc-var-name var)))))
123 (cond
124 ((and (memq var '(var-e var-i var-pi var-phi var-gamma))
125 (eq (car-safe old) 'special-const))
126 (setq msg (format " (Note: Built-in definition of %s has been lost)"
127 (calc-var-name var))))
128 ((and (memq var '(var-inf var-uinf var-nan))
129 (null old))
130 (setq msg (format " (Note: %s has built-in meanings which may interfere)"
131 (calc-var-name var)))))
132 (calc-refresh-evaltos var)))
133 msg))
135 (defun calc-var-name (var)
136 (if (symbolp var) (setq var (symbol-name var)))
137 (if (string-match "\\`var-." var)
138 (substring var 4)
139 var))
141 (defun calc-store-binary (var tag func &optional val)
142 (calc-wrapper
143 (let ((calc-simplify-mode (if (eq calc-simplify-mode 'none)
144 'num calc-simplify-mode))
145 (value (or val (calc-top 1))))
146 (or var (setq var (calc-read-var-name (format "Store %s: " tag))))
147 (if var
148 (let ((old (calc-var-value var)))
149 (if (eq (car-safe old) 'special-const)
150 (error "\"%s\" is a special constant" (calc-var-name var)))
151 (if (not old)
152 (if (memq var '(var-inf var-uinf var-nan))
153 (error "\"%s\" is a special variable" (calc-var-name var))
154 (error "No such variable: \"%s\"" (calc-var-name var))))
155 (if (stringp old)
156 (setq old (math-read-expr old)))
157 (if (eq (car-safe old) 'error)
158 (error "Bad format in variable contents: %s" (nth 2 old)))
159 (calc-store-value var
160 (calc-normalize (if (calc-is-inverse)
161 (list func value old)
162 (list func old value)))
163 tag (and (not val) 1))
164 (message "Variable \"%s\" changed" (calc-var-name var)))))))
166 (defvar calc-var-name-map nil "Keymap for reading Calc variable names.")
167 (if calc-var-name-map
169 (setq calc-var-name-map (copy-keymap minibuffer-local-completion-map))
170 (define-key calc-var-name-map " " 'self-insert-command)
171 (mapc (function
172 (lambda (x)
173 (define-key calc-var-name-map (char-to-string x)
174 'calcVar-digit)))
175 "0123456789")
176 (mapc (function
177 (lambda (x)
178 (define-key calc-var-name-map (char-to-string x)
179 'calcVar-oper)))
180 "+-*/^|"))
182 (defvar calc-store-opers)
184 (defvar calc-read-var-name-history nil
185 "History for reading variable names.")
187 (defun calc-read-var-name (prompt &optional calc-store-opers)
188 (setq calc-given-value nil
189 calc-aborted-prefix nil)
190 (let ((var (concat
191 "var-"
192 (let ((minibuffer-completion-table
193 (mapcar (lambda (x) (substring x 4))
194 (all-completions "var-" obarray)))
195 (minibuffer-completion-predicate
196 (lambda (x) (boundp (intern (concat "var-" x)))))
197 (minibuffer-completion-confirm t))
198 (read-from-minibuffer
199 prompt nil calc-var-name-map nil
200 'calc-read-var-name-history)))))
201 (setq calc-aborted-prefix "")
202 (and (not (equal var "var-"))
203 (if (string-match "\\`\\([-a-zA-Zα-ωΑ-Ω0-9]+\\) *:?=" var)
204 (if (null calc-given-value-flag)
205 (error "Assignment is not allowed in this command")
206 (let ((svar (intern (substring var 0 (match-end 1)))))
207 (setq calc-given-value-flag 0
208 calc-given-value (math-read-expr
209 (substring var (match-end 0))))
210 (if (eq (car-safe calc-given-value) 'error)
211 (error "Bad format: %s" (nth 2 calc-given-value)))
212 (setq calc-given-value (math-evaluate-expr calc-given-value))
213 svar))
214 (intern var)))))
216 (defun calcVar-digit ()
217 (interactive)
218 (if (calc-minibuffer-contains "\\'")
219 (if (eq calc-store-opers 0)
220 (beep)
221 (insert "q")
222 (self-insert-and-exit))
223 (self-insert-command 1)))
225 (defun calcVar-oper ()
226 (interactive)
227 (if (and (eq calc-store-opers t)
228 (calc-minibuffer-contains "\\'"))
229 (progn
230 (erase-buffer)
231 (self-insert-and-exit))
232 (self-insert-command 1)))
234 (defun calc-store-map (&optional oper var)
235 (interactive)
236 (calc-wrapper
237 (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
238 (nthcdr calc-stack-top calc-stack)))
239 (calc-dollar-used 0)
240 (oper (or oper (calc-get-operator "Store Mapping")))
241 (nargs (car oper)))
242 (or var (setq var (calc-read-var-name (format "Store Mapping %s: "
243 (nth 2 oper)))))
244 (if var
245 (let ((old (calc-var-value var)))
246 (if (eq (car-safe old) 'special-const)
247 (error "\"%s\" is a special constant" (calc-var-name var)))
248 (if (not old)
249 (if (memq var '(var-inf var-uinf var-nan))
250 (error "\"%s\" is a special variable" (calc-var-name var))
251 (error "No such variable: \"%s\"" (calc-var-name var))))
252 (let ((calc-simplify-mode (if (eq calc-simplify-mode 'none)
253 'num calc-simplify-mode))
254 (values (and (> nargs 1)
255 (calc-top-list (1- nargs) (1+ calc-dollar-used)))))
256 (message "Working...")
257 (calc-set-command-flag 'clear-message)
258 (if (stringp old)
259 (setq old (math-read-expr old)))
260 (if (eq (car-safe old) 'error)
261 (error "Bad format in variable contents: %s" (nth 2 old)))
262 (setq values (if (calc-is-inverse)
263 (append values (list old))
264 (append (list old) values)))
265 (calc-store-value var
266 (calc-normalize (cons (nth 1 oper) values))
267 (nth 2 oper)
268 (+ calc-dollar-used (1- nargs)))
269 (message "Variable \"%s\" changed" (calc-var-name var))))))))
272 (defun calc-store-exchange (&optional var)
273 (interactive)
274 (calc-wrapper
275 (let ((calc-given-value nil)
276 (calc-given-value-flag 1)
277 top)
278 (or var (setq var (calc-read-var-name "Exchange with: ")))
279 (if var
280 (let ((value (calc-var-value var)))
281 (if (eq (car-safe value) 'special-const)
282 (error "\"%s\" is a special constant" (calc-var-name var)))
283 (if (not value)
284 (if (memq var '(var-inf var-uinf var-nan))
285 (error "\"%s\" is a special variable" (calc-var-name var))
286 (error "No such variable: \"%s\"" (calc-var-name var))))
287 (setq top (or calc-given-value (calc-top 1)))
288 (calc-store-value var top nil)
289 (calc-pop-push-record calc-given-value-flag
290 (concat "<>" (calc-var-name var)) value))))))
292 (defun calc-unstore (&optional var)
293 (interactive)
294 (calc-wrapper
295 (or var (setq var (calc-read-var-name "Unstore: ")))
296 (if var
297 (progn
298 (and (memq var '(var-e var-i var-pi var-phi var-gamma))
299 (eq (car-safe (calc-var-value var)) 'special-const)
300 (message "(Note: Built-in definition of %s has been lost)" var))
301 (if (and (boundp var) (symbol-value var))
302 (message "Unstored variable \"%s\"" (calc-var-name var))
303 (message "Variable \"%s\" remains unstored" (calc-var-name var)))
304 (makunbound var)
305 (calc-refresh-evaltos var)))))
307 (defun calc-let (&optional var)
308 (interactive)
309 (calc-wrapper
310 (let* ((calc-given-value nil)
311 (calc-given-value-flag 1)
312 thing value)
313 (or var (setq var (calc-read-var-name "Let variable: ")))
314 (if calc-given-value
315 (setq value calc-given-value
316 thing (calc-top 1))
317 (setq value (calc-top 1)
318 thing (calc-top 2)))
319 (setq var (if var
320 (list (cons var value))
321 (calc-is-assignments value)))
322 (if var
323 (calc-pop-push-record
324 (1+ calc-given-value-flag)
325 (concat "=" (calc-var-name (car (car var))))
326 (let ((saved-val (mapcar (function
327 (lambda (v)
328 (and (boundp (car v))
329 (symbol-value (car v)))))
330 var)))
331 (unwind-protect
332 (let ((vv var))
333 (while vv
334 (set (car (car vv)) (calc-normalize (cdr (car vv))))
335 (calc-refresh-evaltos (car (car vv)))
336 (setq vv (cdr vv)))
337 (math-evaluate-expr thing))
338 (while saved-val
339 (if (car saved-val)
340 (set (car (car var)) (car saved-val))
341 (makunbound (car (car var))))
342 (setq saved-val (cdr saved-val)
343 var (cdr var)))
344 (calc-handle-whys))))))))
346 (defun calc-is-assignments (value)
347 (if (memq (car-safe value) '(calcFunc-eq calcFunc-assign))
348 (and (eq (car-safe (nth 1 value)) 'var)
349 (list (cons (nth 2 (nth 1 value)) (nth 2 value))))
350 (if (eq (car-safe value) 'vec)
351 (let ((vv nil))
352 (while (and (setq value (cdr value))
353 (memq (car-safe (car value))
354 '(calcFunc-eq calcFunc-assign))
355 (eq (car-safe (nth 1 (car value))) 'var))
356 (setq vv (cons (cons (nth 2 (nth 1 (car value)))
357 (nth 2 (car value)))
358 vv)))
359 (and (not value)
360 vv)))))
362 (defun calc-recall (&optional var)
363 (interactive)
364 (calc-wrapper
365 (or var (setq var (calc-read-var-name "Recall: ")))
366 (if var
367 (let ((value (calc-var-value var)))
368 (or value
369 (error "No such variable: \"%s\"" (calc-var-name var)))
370 (if (stringp value)
371 (setq value (math-read-expr value)))
372 (if (eq (car-safe value) 'error)
373 (error "Bad format in variable contents: %s" (nth 2 value)))
374 (setq value (calc-normalize value))
375 (let ((calc-full-trail-vectors nil))
376 (calc-record value (concat "<" (calc-var-name var))))
377 (calc-push value)))))
379 (defun calc-store-quick ()
380 (interactive)
381 (calc-store (intern (format "var-q%c" last-command-event))))
383 (defun calc-store-into-quick ()
384 (interactive)
385 (calc-store-into (intern (format "var-q%c" last-command-event))))
387 (defun calc-recall-quick ()
388 (interactive)
389 (calc-recall (intern (format "var-q%c" last-command-event))))
391 (defun calc-copy-special-constant (&optional sconst var)
392 (interactive)
393 (let ((sc '(("")
394 ("e" . (special-const (math-e)))
395 ("pi" . (special-const (math-pi)))
396 ("i" . (special-const (math-imaginary 1)))
397 ("phi" . (special-const (math-phi)))
398 ("gamma" . (special-const (math-gamma-const))))))
399 (calc-wrapper
400 (or sconst (setq sconst (completing-read "Special constant: " sc nil t)))
401 (unless (string= sconst "")
402 (let ((value (cdr (assoc sconst sc))))
403 (or var (setq var (calc-read-var-name
404 (format "Copy special constant %s, to: "
405 sconst))))
406 (if var
407 (let ((msg (calc-store-value var value "")))
408 (message (concat "Special constant \"%s\" copied to \"%s\"" msg)
409 sconst (calc-var-name var)))))))))
411 (defun calc-copy-variable (&optional var1 var2)
412 (interactive)
413 (calc-wrapper
414 (or var1 (setq var1 (calc-read-var-name "Copy variable: ")))
415 (if var1
416 (let ((value (calc-var-value var1)))
417 (or value
418 (error "No such variable: \"%s\"" (calc-var-name var1)))
419 (or var2 (setq var2 (calc-read-var-name
420 (format "Copy variable: %s, to: "
421 (calc-var-name var1)))))
422 (if var2
423 (let ((msg (calc-store-value var2 value "")))
424 (message "Variable \"%s\" copied to \"%s\"%s"
425 (calc-var-name var1) (calc-var-name var2) msg)))))))
427 (defvar calc-last-edited-variable nil)
428 (defun calc-edit-variable (&optional var)
429 (interactive)
430 (calc-wrapper
431 (or var (setq var (calc-read-var-name
432 (if calc-last-edited-variable
433 (format "Edit (default %s): "
434 (calc-var-name calc-last-edited-variable))
435 "Edit: "))))
436 (or var (setq var calc-last-edited-variable))
437 (if var
438 (let* ((value (calc-var-value var)))
439 (if (eq (car-safe value) 'special-const)
440 (error "%s is a special constant" var))
441 (setq calc-last-edited-variable var)
442 (calc-edit-mode (list 'calc-finish-stack-edit (list 'quote var))
444 (format-message
445 "Editing variable `%s'" (calc-var-name var)))
446 (and value
447 (insert (math-format-nice-expr value (frame-width)) "\n")))))
448 (calc-show-edit-buffer))
450 (defun calc-edit-Decls ()
451 (interactive)
452 (calc-edit-variable 'var-Decls))
454 (defun calc-edit-EvalRules ()
455 (interactive)
456 (calc-edit-variable 'var-EvalRules))
458 (defun calc-edit-FitRules ()
459 (interactive)
460 (calc-edit-variable 'var-FitRules))
462 (defun calc-edit-GenCount ()
463 (interactive)
464 (calc-edit-variable 'var-GenCount))
466 (defun calc-edit-Holidays ()
467 (interactive)
468 (calc-edit-variable 'var-Holidays))
470 (defun calc-edit-IntegLimit ()
471 (interactive)
472 (calc-edit-variable 'var-IntegLimit))
474 (defun calc-edit-LineStyles ()
475 (interactive)
476 (calc-edit-variable 'var-LineStyles))
478 (defun calc-edit-PointStyles ()
479 (interactive)
480 (calc-edit-variable 'var-PointStyles))
482 (defun calc-edit-PlotRejects ()
483 (interactive)
484 (calc-edit-variable 'var-PlotRejects))
486 (defun calc-edit-AlgSimpRules ()
487 (interactive)
488 (calc-edit-variable 'var-AlgSimpRules))
490 (defun calc-edit-TimeZone ()
491 (interactive)
492 (calc-edit-variable 'var-TimeZone))
494 (defun calc-edit-Units ()
495 (interactive)
496 (calc-edit-variable 'var-Units))
498 (defun calc-edit-ExtSimpRules ()
499 (interactive)
500 (calc-edit-variable 'var-ExtSimpRules))
502 (defun calc-declare-variable (&optional var)
503 (interactive)
504 (calc-wrapper
505 (or var (setq var (calc-read-var-name "Declare: " 0)))
506 (or var (setq var 'var-All))
507 (let* (dp decl def row rp)
508 (or (and (calc-var-value 'var-Decls)
509 (eq (car-safe var-Decls) 'vec))
510 (setq var-Decls (list 'vec)))
511 (setq dp var-Decls)
512 (while (and (setq dp (cdr dp))
513 (or (not (eq (car-safe (car dp)) 'vec))
514 (/= (length (car dp)) 3)
515 (progn
516 (setq row (nth 1 (car dp))
517 rp row)
518 (if (eq (car-safe row) 'vec)
519 (progn
520 (while
521 (and (setq rp (cdr rp))
522 (or (not (eq (car-safe (car rp)) 'var))
523 (not (eq (nth 2 (car rp)) var)))))
524 (setq rp (car rp)))
525 (if (or (not (eq (car-safe row) 'var))
526 (not (eq (nth 2 row) var)))
527 (setq rp nil)))
528 (not rp)))))
529 (calc-unread-command ?\C-a)
530 (setq decl (read-string (format "Declare: %s to be: " (calc-var-name var))
531 (and rp
532 (math-format-flat-expr (nth 2 (car dp)) 0))))
533 (setq decl (and (string-match "[^ \t]" decl)
534 (math-read-exprs decl)))
535 (if (eq (car-safe decl) 'error)
536 (error "Bad format in declaration: %s" (nth 2 decl)))
537 (if (cdr decl)
538 (setq decl (cons 'vec decl))
539 (setq decl (car decl)))
540 (and (eq (car-safe decl) 'vec)
541 (= (length decl) 2)
542 (setq decl (nth 1 decl)))
543 (calc-record (append '(vec) (list (math-build-var-name var))
544 (and decl (list decl)))
545 "decl")
546 (setq var-Decls (copy-sequence var-Decls))
547 (if (eq (car-safe row) 'vec)
548 (progn
549 (setcdr row (delq rp (cdr row)))
550 (or (cdr row)
551 (setq var-Decls (delq (car dp) var-Decls))))
552 (setq var-Decls (delq (car dp) var-Decls)))
553 (if decl
554 (progn
555 (setq dp (and (not (eq var 'var-All)) var-Decls))
556 (while (and (setq dp (cdr dp))
557 (or (not (eq (car-safe (car dp)) 'vec))
558 (/= (length (car dp)) 3)
559 (not (equal (nth 2 (car dp)) decl)))))
560 (if dp
561 (setcar (cdr (car dp))
562 (append (if (eq (car-safe (nth 1 (car dp))) 'vec)
563 (nth 1 (car dp))
564 (list 'vec (nth 1 (car dp))))
565 (list (math-build-var-name var))))
566 (setq var-Decls (append var-Decls
567 (list (list 'vec
568 (math-build-var-name var)
569 decl)))))))
570 (calc-refresh-evaltos 'var-Decls))))
572 (defvar calc-dont-insert-variables '(var-FitRules var-FactorRules
573 var-CommuteRules var-JumpRules
574 var-DistribRules var-MergeRules
575 var-NegateRules var-InvertRules
576 var-IntegAfterRules
577 var-TimeZone var-PlotRejects
578 var-PlotData1 var-PlotData2
579 var-PlotData3 var-PlotData4
580 var-PlotData5 var-PlotData6
581 var-DUMMY))
583 ;; The variable calc-pv-pos is local to calc-permanent-variable, but
584 ;; used by calc-insert-permanent-variable, which is called by
585 ;; calc-permanent-variable.
586 (defvar calc-pv-pos)
588 (defun calc-permanent-variable (&optional var)
589 (interactive)
590 (calc-wrapper
591 (or var (setq var (calc-read-var-name "Save variable (default all): ")))
592 (let (calc-pv-pos)
593 (and var (or (and (boundp var) (symbol-value var))
594 (error "No such variable")))
595 (set-buffer (find-file-noselect (substitute-in-file-name
596 calc-settings-file)))
597 (if var
598 (calc-insert-permanent-variable var)
599 (mapatoms (function
600 (lambda (x)
601 (and (string-match "\\`var-" (symbol-name x))
602 (not (memq x calc-dont-insert-variables))
603 (calc-var-value x)
604 (not (eq (car-safe (symbol-value x)) 'special-const))
605 (calc-insert-permanent-variable x))))))
606 (save-buffer))))
610 (defun calc-insert-permanent-variable (var)
611 (goto-char (point-min))
612 (if (let (case-fold-search)
613 (search-forward (concat "(setq " (symbol-name var) " '") nil t))
614 (progn
615 (setq calc-pv-pos (point-marker))
616 (forward-line -1)
617 (if (looking-at ";;; Variable .* stored by Calc on ")
618 (progn
619 (delete-region (match-end 0) (progn (end-of-line) (point)))
620 (insert (current-time-string))))
621 (goto-char (- calc-pv-pos 8 (length (symbol-name var))))
622 (forward-sexp 1)
623 (backward-char 1)
624 (delete-region calc-pv-pos (point)))
625 (goto-char (point-max))
626 (insert "\n;;; Variable \""
627 (symbol-name var)
628 "\" stored by Calc on "
629 (current-time-string)
630 "\n(setq "
631 (symbol-name var)
632 " ')\n")
633 (backward-char 2))
634 (insert (prin1-to-string (calc-var-value var)))
635 (forward-line 1))
637 (defun calc-insert-variables (buf)
638 (interactive "bBuffer in which to save variable values: ")
639 (with-current-buffer buf
640 (mapatoms (function
641 (lambda (x)
642 (and (string-match "\\`var-" (symbol-name x))
643 (not (memq x calc-dont-insert-variables))
644 (calc-var-value x)
645 (not (eq (car-safe (symbol-value x)) 'special-const))
646 (or (not (eq x 'var-Decls))
647 (not (equal var-Decls '(vec))))
648 (or (not (eq x 'var-Holidays))
649 (not (equal var-Holidays '(vec (var sat var-sat)
650 (var sun var-sun)))))
651 (insert "(setq "
652 (symbol-name x)
654 (prin1-to-string
655 (let ((calc-language
656 (if (memq calc-language '(nil big))
657 'flat
658 calc-language)))
659 (math-format-value (symbol-value x) 100000)))
660 ")\n")))))))
662 (defun calc-assign (arg)
663 (interactive "P")
664 (calc-slow-wrapper
665 (calc-binary-op ":=" 'calcFunc-assign arg)))
667 (defun calc-evalto (arg)
668 (interactive "P")
669 (calc-slow-wrapper
670 (calc-unary-op "=>" 'calcFunc-evalto arg)))
672 (defun calc-subscript (arg)
673 (interactive "P")
674 (calc-slow-wrapper
675 (calc-binary-op "sub" 'calcFunc-subscr arg)))
677 (provide 'calc-store)
679 ;;; calc-store.el ends here