1 |
;; Calculator for GNU Emacs, part II [calc-alg.el] |
;;; calc-alg.el --- algebraic functions for Calc |
2 |
|
|
3 |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
4 |
;; Written by Dave Gillespie, daveg@synaptics.com. |
|
5 |
|
;; Author: David Gillespie <daveg@synaptics.com> |
6 |
|
;; Maintainer: Colin Walters <walters@debian.org> |
7 |
|
|
8 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
9 |
|
|
22 |
;; file named COPYING. Among other things, the copyright notice |
;; file named COPYING. Among other things, the copyright notice |
23 |
;; and this notice must be preserved on all copies. |
;; and this notice must be preserved on all copies. |
24 |
|
|
25 |
|
;;; Commentary: |
26 |
|
|
27 |
|
;;; Code: |
28 |
|
|
29 |
;; This file is autoloaded from calc-ext.el. |
;; This file is autoloaded from calc-ext.el. |
30 |
(require 'calc-ext) |
(require 'calc-ext) |
33 |
|
|
34 |
(defun calc-Need-calc-alg () nil) |
(defun calc-Need-calc-alg () nil) |
35 |
|
|
|
|
|
36 |
;;; Algebra commands. |
;;; Algebra commands. |
37 |
|
|
38 |
(defun calc-alg-evaluate (arg) |
(defun calc-alg-evaluate (arg) |
173 |
(if (eq (car-safe old) 'error) |
(if (eq (car-safe old) 'error) |
174 |
(error "Bad format in expression: %s" (nth 1 old))) |
(error "Bad format in expression: %s" (nth 1 old))) |
175 |
(or (math-expr-contains expr old) |
(or (math-expr-contains expr old) |
176 |
(error "No occurrences found."))) |
(error "No occurrences found"))) |
177 |
(calc-enter-result num "sbst" (math-expr-subst expr old new))))) |
(calc-enter-result num "sbst" (math-expr-subst expr old new))))) |
178 |
|
|
179 |
|
|