0

I’m trying to split a number stated in scientific notation (6.371e6) and write it as float (6371000) (I’m doing this to learn.)

This is the code I have so far

A = (car (mapcar #'string-to-number (split-string "6.371e6" "e")))
6.371


B = (nth 1 (mapcar #'string-to-number (split-string "6.371e6" "e")))
6

When I try

(* A B)

I get this error:

symbol’s function definition is void: make-closure

Why do I get this error?

I found this link, but I did not understand what I need to do. Do I need to upgrade my emacs? I have version 27.2

Also, why don't I get the *Backtrace* buffer? Instead, the errors show up in the mini buffer.

zeynel
  • 129
  • 8
  • 1
    Say `M-x toggle-debug-on-error` to get the backtrace. Use `setq` for the assignments (otherwise `A` and `B` are undefined. And clean up (some of) your `*.elc` files: if the link is correct, they have been compiled with a newer version of emacs. For a file `foo.elc`, you can find what version of the compiler compiled it by running `file foo.elc` at a shell prompt. – NickD Sep 08 '22 at 21:22
  • I am having trouble finding any `.elc` files. In fact, I'm having problems with `find-name-dired`. I'll ask another question. – zeynel Sep 09 '22 at 07:04
  • Ok, I restarted emacs and found the `.elc` files. Do I need to delete them? – zeynel Sep 09 '22 at 12:32
  • This page recommends deleting all `.elc` files https://blog.codeselfstudy.com/blog/how-to-remove-all-elc-files-emacs/ – zeynel Sep 09 '22 at 12:35
  • 1
    You will need to recompile them, which is a big job. That's why I suggested you check which ones are compiled with which compiler. There are two broad classes: ones in `/usr/share/emacs/27.2` which *should* be fine and should probably be left alone. And ones under `~/.emacs.d/elpa` or some similar place for packages you have downloaded and which are probably suspect. – NickD Sep 09 '22 at 15:08
  • Yes, it looks like v.23: `.emacs.d/elpa/epresent-20160411.201/epresent.elc: Emacs/XEmacs v23 byte-compiled Lisp data` – zeynel Sep 09 '22 at 17:12
  • I guess this is how recompile: https://emacs.stackexchange.com/questions/35923/how-do-you-recompile-an-el-source-file-and-make-it-active-in-my-current-session But afer restarting now I didn't have any problems. – zeynel Sep 09 '22 at 17:13
  • `v23` was the compiler version until Emacs 28 when it became `v28`, so `v23` files do not need to be recompiled for Emacs 27.2. At least, AFAIK... – NickD Sep 09 '22 at 17:23

1 Answers1

0

You need to recompile the .elc files.

(byte-recompile-directory package-user-dir nil 'force)

I had to restart and compile twice.

found here

Flinner
  • 11
  • 1