when I use load procedure to load an existing file,
(load "coins.rkt")
the Racket pop up an error:
coins.rkt:1:0: #%top-interaction: unbound identifier;
also, no #%app syntax transformer is bound in: #%top-interaction
I'm not sure what's wrong.
My Racket version is 6.2.1 on MacOS 10.10.3.
Related
I'm currently working on extending racklog, which is a library I installed by running raco pkg install in the repo directory.
I'm trying to provide a new function, namely a struct constructor. Currently, I'm defining the struct as follows in racklog.rkt. I then provide it from that file.
; racklog.rkt
(struct my-struct (value))
(provide my-struct)
The main file of the library just provides everything from this file:
; main.rkt
(require "racklog.rkt")
(provide (all-from-out "racklog.rkt"))
However, when I try to use the provided constructor (which should be named my-struct) in a file requiring this module, it says that the id isn't found. In particular, I'm trying:
; test.rkt
(require racklog)
my-struct
This also happens even with non-struct things such as defined variables, functions, etc. All the other provided forms seem to be working fine. What's the way I can fix this so I can use the provided constructor? Thanks!
This is an unfortunate stale compiled file issue. Try raco setup --pkgs racklog to compile racklog and run your program again. It should now work. Alternatively, you can manually delete the compiled directories.
I am working with the book Certified Programming with Dependent Types but each time I'm finding a different error. It seems to me that the error comes from a mismatch between the compilation process from Proof General and through the makefile of the sources of the book.
If I compile the sources with make and try to run for instance Subset.v in Proof-General I get:
Error: File /home/usuario/Desktop/Coq/cpdt/src/CpdtTactics.vo has
bad magic number 81100 (expected 8600). It is corrupted or was
compiled with another version of Coq.
If I clean the makefile compiled files with make clean and try to proceed with the option Coq -> Auto Compilation -> Compile before require then it is the line:
Require Extraction.
that fails. Originally it failed with the error:
Error: Unable to locate library Extraction.
but with the above option enables it gives something like:
echo "Require Extraction." > /tmp/ProofGeneral-coqQPJTf0.v coqdep -Q /home/usuario/Desktop/Coq/cpdt/src/ -R /home/usuario/Desktop/Coq/cpdt/src Cpdt /tmp/ProofGeneral-coqQPJTf0.v
* Warning: in file /tmp/ProofGeneral-coqQPJTf0.v, library Extraction is required and has not been found in the loadpath!
* Warning: in file /tmp/ProofGeneral-coqQPJTf0.v, library Extraction is required and has not been found in the loadpath!
/tmp/ProofGeneral-coqQPJTf0.vo /tmp/ProofGeneral-coqQPJTf0.glob /tmp/ProofGeneral-coqQPJTf0.v.beautified: /tmp/ProofGeneral-coqQPJTf0.v
/tmp/ProofGeneral-coqQPJTf0.vio: /tmp/ProofGeneral-coqQPJTf0.v
How can I solve this?
Side-questions: which OS are you using? do you rely on opam?
Regarding the first error you get, it certainly comes from the following fact:
outside proofgeneral, the coqc binary corresponds to Coq 8.11, while in ProofGeneral, the coqtop binary correspond to Coq 8.6. Maybe because the PATH variable is not the same in the two contexts.
To figure out which binary is found, you can do in the terminal which coqtop, and within Emacs, M-! which coqtop RET and you should thus get different paths.
Sometimes, opening emacs directly from the terminal (emacs &) can help for this kind of issue.
But if you want to change the coqtop binary that is used in ProofGeneral, you can set the coq-prog-name option, by using one of the following steps:
Interactively, type C-u C-c C-x (to kill Coq), M-: (setq coq-prog-name "…/coqtop"), and C-c C-n
Or create a .dir-locals.el file (Emacs' standard conf-file) in the project root containing:
((coq-mode . ((coq-prog-name . "…/coqtop"))))
and close/reopen the ….v file at stake (or just do M-x normal-mode RET or C-x C-v RET in the already-opened ….v buffer)
Regarding the second error you get, I'm a bit puzzled that Require Extraction triggers this error, as this library does exist in Coq 8.6 and 8.11.
At first sight, I'd suggest to re-test the auto-compilation with Coq 8.11, asserting From Coq Require Extraction. (instead of just Require Extraction.)
But maybe there is a bug in PG's Auto Compilation -> Compile before require feature; anyway feel free to open a related issue in the PG tracker if need be, bug reports and feature requests are very welcome: https://github.com/ProofGeneral/PG/issues
I have installed Kieran Healy's emacs social sciences starter kit. I have changed the name of the file kjhealy.org to ljs.org (as per his instructions). The starter kit settings seem to load, but I get the following error.
Warning (initialization): An error occurred while loading
‘/Users/ljs/.emacs.d/init.el’:
File error: Cannot open load file, No such file or directory, ob-shell
When I open emacs with the --debug-init files, I get the following:
Debugger entered--Lisp error: (void-function package-initialize)
(package-initialize)
eval-buffer(#<buffer *load*> nil "/Users/ljs/.emacs.d/init.el" nil t)
; Reading at buffer position 403
load-with-code-conversion("/Users/ljs/.emacs.d/init.el"
"/Users/ljs/.emacs.d/init.el" t t)
load("/Users/ljs/.emacs.d/init" t t)
#[nil "^H\205\276^# \306=\203^Q^#\307^H\310Q\202A^#
\311=\2033^#\312\307\313\314#\203#^#\315\202A^#\312\307\313\$
command-line()
normal-top-level()
Any help with this greatly appreciated.
The underlying reason for this problem is that the file ob-sh.el was renamed to ob-shell.el and the corresponding babel language became shell. That happened in version 8.2.5 (more precisely, it's commit 583e7ab17:
$ git describe 583e7ab17
release_8.2.4-332-g583e7ab17
so 332 commits after 8.2.4).
So if your version of emacs is 8.2.4 or earlier, you have to use sh as the babel language and load the file ob-sh.el. For 8.2.5 and later (including the current version that is distributed with emacs), you have to use shell as the babel language and load the file ob-shell.el.
Hope that clarifies.
The long and short of it is that I am getting this error message from Emacs when I attempt to use gforth.el and open a .fs file:
Error: Don't know how to compile nil
My .emacs file simply has the following lines.
(autoload 'forth-mode "gforth.el")
(autoload 'forth-block-mode "gforth.el")
(add-to-list 'auto-mode-alist '("\\.fs$" . forth-mode))
The directory gforth.el is contained within is in the load path.
Emacs version: 24.3.1
Attempts to byte compile the file yeild the errors/warnings:
In toplevel form:
gforth.el:734:18:Error: Don't know how to compile nil
gforth.el:734:18:Error: Don't know how to compile nil
gforth.el:734:18:Error: Don't know how to compile nil
gforth.el:734:18:Error: Don't know how to compile nil
gforth.el:734:18:Error: Don't know how to compile nil
In forth-update-show-screen:
gforth.el:1059:36:Warning: `goto-line' used from Lisp code
That command is designed for interactive use only
gforth.el:1061:15:Warning: `goto-line' used from Lisp code
That command is designed for interactive use only
In end of data:
gforth.el:1697:1:Warning: the function `forth-emacs-older' might not be
defined at runtime.
When I try load Lift package through emacs-slime.
(load "/home/user/lib/lift")
I catch the next error
; compiling (LOAD "/home/user/lib/lift");; swank:close-connection: encoding error on stream
#<SB-SYS:FD-STREAM
for "socket 127.0.0.1:36328, peer: 127.0.0.1:59724"
{1003D9F5E1}>
(:EXTERNAL-FORMAT :LATIN-1):
the character with code 1069 cannot be encoded.
What wrong and how I can load this package?
From the CL spec, LOAD is used for loading Common Lisp source or compiled files. I'm guessing that /home/user/lib/lift is a directory on your system, and that's why LOAD isn't working.
You'll probably have the most luck if you install LIFT using Quicklisp, then load the library like it says in the LIFT User's Guide:
(in-package #:common-lisp-user)
(use-package :lift)