;;; Code:
;; This file is autoloaded from calc.el.
-(require 'calc)
+(require 'calc)
(require 'calc-macs)
-(eval-when-compile '(require calc-macs))
(defun calc-Need-calc-aent () nil)
(entry (calc-do-alg-entry "" "Quick calc: " t))
(alg-exp (mapcar (function
(lambda (x)
- (if (and (not calc-extensions-loaded)
+ (if (and (not (featurep 'calc-ext))
calc-previous-alg-entry
(string-match
"\\`[-0-9._+*/^() ]+\\'"
calc-previous-alg-entry))
(calc-normalize x)
- (calc-extensions)
+ (require 'calc-ext)
(math-evaluate-expr x))))
entry)))
(when (and (= (length alg-exp) 1)
(eq (car-safe (car alg-exp)) 'calcFunc-assign)
(= (length (car alg-exp)) 3)
(eq (car-safe (nth 1 (car alg-exp))) 'var))
- (calc-extensions)
+ (require 'calc-ext)
(set (nth 2 (nth 1 (car alg-exp))) (nth 2 (car alg-exp)))
(calc-refresh-evaltos (nth 2 (nth 1 (car alg-exp))))
(setq alg-exp (list (nth 2 (car alg-exp)))))
"")
")")))
(if (and (< (length buf) (frame-width)) (= (length entry) 1)
- calc-extensions-loaded)
+ (featurep 'calc-ext))
(let ((long (concat (math-format-value (car entry) 1000)
" => " buf)))
(if (<= (length long) (- (frame-width) 8))
((eq separator 'eval)
(eval str))
((eq separator 'macro)
- (calc-extensions)
+ (require 'calc-ext)
(let* ((calc-buffer (current-buffer))
(calc-window (get-buffer-window calc-buffer))
(save-window (selected-window)))
(and (memq 'clear-message calc-command-flags)
(message ""))
(cond ((eq separator 'pred)
- (calc-extensions)
+ (require 'calc-ext)
(if (= (length res) 1)
(math-is-true (car res))
(calc-eval-error '(0 "Single value expected"))))
(alg-exp (calc-do-alg-entry initial prompt t)))
(if (stringp alg-exp)
(progn
- (calc-extensions)
+ (require 'calc-ext)
(calc-alg-edit alg-exp))
(let* ((calc-simplify-mode (if (eq last-command-char ?\C-j)
'none
calc-simplify-mode))
(nvals (mapcar 'calc-normalize alg-exp)))
(while alg-exp
- (calc-record (if calc-extensions-loaded (car alg-exp) (car nvals))
+ (calc-record (if (featurep 'calc-ext) (car alg-exp) (car nvals))
"alg'")
(calc-pop-push-record-list calc-dollar-used
(and (not (equal (car alg-exp)
(car nvals)))
- calc-extensions-loaded
+ (featurep 'calc-ext)
"")
(list (car nvals)))
(setq alg-exp (cdr alg-exp)
(if (not (equal (car op) "2x"))
(math-read-token))
(and (memq (nth 1 op) '(sdev mod))
- (calc-extensions))
+ (require 'calc-ext))
(setq x (cond ((consp (nth 1 op))
(funcall (car (nth 1 op)) x op))
((eq (nth 3 op) -1)
((and (not first)
(memq (nth 1 op) math-alg-inequalities)
(memq (car-safe x) math-alg-inequalities))
- (calc-extensions)
+ (require 'calc-ext)
(math-composite-inequalities x op))
(t (list (nth 1 op)
x
(or (not (listp
(setq matches (calc-match-user-syntax rule))))
(let ((args (progn
- (calc-extensions)
+ (require 'calc-ext)
calc-arg-values))
(conds nil)
temp)
conds)
match (nth 1 match)))
(while (and conds match)
- (calc-extensions)
+ (require 'calc-ext)
(cond ((eq (car-safe (car conds))
'calcFunc-let)
(setq temp (car conds))
(throw 'syntax "Expected `)'"))
(math-read-token)
(if (and (eq calc-language 'fortran) args
- (calc-extensions)
+ (require 'calc-ext)
(let ((calc-matrix-mode 'scalar))
(math-known-matrixp
(list 'var sym
((eq math-exp-token 'hash)
(or calc-hashes-used
(throw 'syntax "#'s not allowed in this context"))
- (calc-extensions)
+ (require 'calc-ext)
(if (<= math-expr-data (length calc-arg-values))
(let ((num math-expr-data))
(math-read-token)
(setq exp (if (and exp2 (Math-realp exp)
(Math-anglep exp2))
(math-normalize (list 'polar exp exp2))
- (calc-extensions)
+ (require 'calc-ext)
(list '* exp
(list 'calcFunc-exp
(list '*
(math-read-token)
exp))
((eq math-exp-token 'string)
- (calc-extensions)
+ (require 'calc-ext)
(math-read-string))
((equal math-expr-data "[")
- (calc-extensions)
+ (require 'calc-ext)
(math-read-brackets t "]"))
((equal math-expr-data "{")
- (calc-extensions)
+ (require 'calc-ext)
(math-read-brackets nil "}"))
((equal math-expr-data "<")
- (calc-extensions)
+ (require 'calc-ext)
(math-read-angle-brackets))
(t (throw 'syntax "Expected a number")))))