0

I've been reading the GNU Emacs Calculator manual in search of directions for how to programmatically call the existing functions in a lisp program.

I've examined the section called 'Programming', but it seems to be more related to extending the calculator, rather than programming using the calculator. There is a section called 'Calling Calc from your Lisp Programs' which talks about a calc-eval function available to programmers, but so far, I have not been able to call that function in SBCL.

It seems that it is possible to call the calculator functions programmatically from Emacs Lisp, but I'd be curious to know if there is similar functionality in SBCL too.

Drew
  • 29,895
  • 7
  • 74
  • 104
myselfesteem
  • 733
  • 1
  • 6
  • 23

1 Answers1

8

GNU Emacs Calculator is an Emacs Lisp program.

SBCL is a Common Lisp implementation.

ELisp and CL are different languages (from the same Lisp family).

This means that you cannot run the Emacs Calculator from SBCL directly.

However, I wrote an ELisp compatibility layer which allowed me to run Emacs Calendar from CLISP (also a Common Lisp implementation). It should allow you to load Emacs Calculator in SBCL and run its code.

sds
  • 58,617
  • 29
  • 161
  • 278
  • Alright, I will check it out! I've gotta head out for an event, but as soon as I get back, I'll check this out and let you know how it went. Thanks! – myselfesteem Dec 27 '18 at 20:14
  • I'm not sure how to run this code. It doesn't load properly in sbcl. It says that clocc:src;cllib;base does not exist, and that cllib does not designate any package, and that the package el does not exist. – myselfesteem Dec 28 '18 at 03:03
  • I realized my mistake from above, and downloaded the whole project and tried to install it. Unfortunately, I get a compile error when trying to compile port-ext in cllib. I will report the bug – myselfesteem Dec 28 '18 at 17:14
  • I've installed the CLLIB from the CLOCC project. I still am struggling, however, to get access to the calculator application. Any idea on how to do this? Even when I do (el::require 'calc-ext), the system doesn't know where to find the calculator package. I looked in my /usr/share/emacs/24.5/lisp/ directory but the system won't load any of the .elc's there. – myselfesteem Dec 30 '18 at 20:22
  • 1
    You cannot load `.elc` - they are ELisp compiled files. You should figure out how SBCL `load` work - where it finds the lisp files to load. At the very least you should be able to load the files with a full path. – sds Dec 31 '18 at 02:04
  • I tried to el::load calculator.elc at /usr/share/emacs/24.5/lisp/, but i got an error that the \*closio-method\* is nil. I also tried sbcl's load, then got I'm missing a definition for dispatch function #\[. When I tried to el::load calc-ext (and for many other files) I got another dispatch function error. When I did the sbcl's load I get the same errors. Is this happening because there's some file I should be loading first that I don't know about? The only file I can load right now is calc-loaddefs.el at /usr/share/emacs/24.5/lisp/calc/, but I still get all the same errors. – myselfesteem Jan 02 '19 at 06:08
  • Forget `cl:load`. Not gonna work. You need to chase all the missing stuff and `el:load` the appropriate files. – sds Jan 02 '19 at 13:50