Mercurial > emacs
comparison lisp/calc/calc-map.el @ 112392:70d7e5c6e611
calc/calc-prog.el
calc/calc-graph.el
calc/calc-map.el: Change `arglist' to `math-arglist' throughout.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Thu, 20 Jan 2011 21:48:26 -0600 |
parents | ef719132ddfa |
children |
comparison
equal
deleted
inserted
replaced
112391:93209af5dc0b | 112392:70d7e5c6e611 |
---|---|
570 ((and (>= key ?0) (<= key ?9) (null prefix)) | 570 ((and (>= key ?0) (<= key ?9) (null prefix)) |
571 (setq forcenargs (if (eq forcenargs (- key ?0)) nil (- key ?0))) | 571 (setq forcenargs (if (eq forcenargs (- key ?0)) nil (- key ?0))) |
572 (and nargs forcenargs (/= nargs forcenargs) (>= nargs 0) | 572 (and nargs forcenargs (/= nargs forcenargs) (>= nargs 0) |
573 (error "Must be a %d-argument operator" nargs))) | 573 (error "Must be a %d-argument operator" nargs))) |
574 ((memq key '(?\$ ?\')) | 574 ((memq key '(?\$ ?\')) |
575 (let* ((arglist nil) | 575 (let* ((math-arglist nil) |
576 (has-args nil) | 576 (has-args nil) |
577 (record-entry nil) | 577 (record-entry nil) |
578 (expr (if (eq key ?\$) | 578 (expr (if (eq key ?\$) |
579 (progn | 579 (progn |
580 (setq calc-dollar-used 1) | 580 (setq calc-dollar-used 1) |
590 (or (= (length func) 1) | 590 (or (= (length func) 1) |
591 (error "Bad format")) | 591 (error "Bad format")) |
592 (if (> calc-dollar-used 0) | 592 (if (> calc-dollar-used 0) |
593 (progn | 593 (progn |
594 (setq has-args calc-dollar-used | 594 (setq has-args calc-dollar-used |
595 arglist (calc-invent-args has-args)) | 595 math-arglist (calc-invent-args has-args)) |
596 (math-multi-subst (car func) | 596 (math-multi-subst (car func) |
597 (reverse arglist) | 597 (reverse math-arglist) |
598 arglist)) | 598 math-arglist)) |
599 (if (> calc-hashes-used 0) | 599 (if (> calc-hashes-used 0) |
600 (setq has-args calc-hashes-used | 600 (setq has-args calc-hashes-used |
601 arglist (calc-invent-args has-args))) | 601 math-arglist (calc-invent-args has-args))) |
602 (car func)))))) | 602 (car func)))))) |
603 (if (eq (car-safe expr) 'calcFunc-lambda) | 603 (if (eq (car-safe expr) 'calcFunc-lambda) |
604 (setq oper (list "$" (- (length expr) 2) expr) | 604 (setq oper (list "$" (- (length expr) 2) expr) |
605 done t) | 605 done t) |
606 (or has-args | 606 (or has-args |
607 (progn | 607 (progn |
608 (calc-default-formula-arglist expr) | 608 (calc-default-formula-arglist expr) |
609 (setq record-entry t | 609 (setq record-entry t |
610 arglist (sort arglist 'string-lessp)) | 610 math-arglist (sort math-arglist 'string-lessp)) |
611 (if calc-verify-arglist | 611 (if calc-verify-arglist |
612 (setq arglist (read-from-minibuffer | 612 (setq math-arglist (read-from-minibuffer |
613 "Function argument list: " | 613 "Function argument list: " |
614 (if arglist | 614 (if math-arglist |
615 (prin1-to-string arglist) | 615 (prin1-to-string math-arglist) |
616 "()") | 616 "()") |
617 minibuffer-local-map | 617 minibuffer-local-map |
618 t))) | 618 t))) |
619 (setq arglist (mapcar (function | 619 (setq math-arglist (mapcar (function |
620 (lambda (x) | 620 (lambda (x) |
621 (list 'var | 621 (list 'var |
622 x | 622 x |
623 (intern | 623 (intern |
624 (concat | 624 (concat |
625 "var-" | 625 "var-" |
626 (symbol-name x)))))) | 626 (symbol-name x)))))) |
627 arglist)))) | 627 math-arglist)))) |
628 (setq oper (list "$" | 628 (setq oper (list "$" |
629 (length arglist) | 629 (length math-arglist) |
630 (append '(calcFunc-lambda) arglist | 630 (append '(calcFunc-lambda) math-arglist |
631 (list expr))) | 631 (list expr))) |
632 done t)) | 632 done t)) |
633 (if record-entry | 633 (if record-entry |
634 (calc-record (nth 2 oper) "oper")))) | 634 (calc-record (nth 2 oper) "oper")))) |
635 ((setq oper (assq key (nth (if inv (if hyp 3 1) (if hyp 2 0)) | 635 ((setq oper (assq key (nth (if inv (if hyp 3 1) (if hyp 2 0)) |