Consider the following:
(directory (make-pathname :directory '(:absolute "Users" "gazonk" "foo" "*")
:name :wild))
This breaks because one of the directories contains the character ";".
If the "*" above is removed, the code returns a directory listing where ";" is escaped.
It seems I cannot make it go further down because some directories contain a ";"
Is there a fix for this?
Any and all commends appreciated. Thank you.
Confirmed. I see the same behavior with ccl 1.9 (64-bit or 32-bit) on Mac OS X 10.8.
I created an empty subdirectory using mkdir 'a;b' and I see:
(make-pathname :directory '(:absolute "Users" "gazonk" "foo" "*") :name :wild))
> Error: Illegal directory string "/Users/gazonk/foo/a;b/"
> While executing: CCL::%DIRECTORY-STRING-LIST, in process listener(1).
Update:
Based on Rainer's comment, it sounds like this is likely a ccl bug.
Recommend asking on the #ccl irc channel or submitting a bug report here (requires registration).
Related
I'm currently working on Software Foundations – Logical Foundation.
In short, I got error Error: Cannot find a physical path bound to logical path matching suffix <> and prefix LF.
I have Coq brew installed.
I have the following files located at ~/Documents/Notes/PL/SF/LF/
_CoqProject contains single line: -Q . LF
Basics.v contains code for the first chapter
Makefile generated by command coq_makefile -f _CoqProject *.v -o Makefile
Then I make Basics.vo by make Basics.vo
Now I open coqtop, and try to run the command From LF Require Export Basics. and here is what it looks like
╭─~/Documents/Notes/PL/SF/LF
╰─$ coqtop
Welcome to Coq 8.11.0 (January 2020)
Coq < From LF Require Export Basics.
Toplevel input, characters 23-29:
> From LF Require Export Basics.
> ^^^^^^
Error: Cannot find a physical path bound to logical path matching suffix
<> and prefix LF
Here is the output of Print LoadPath.. The last line of the output clearly shows <> /Users/myname/Documents/Notes/PL/SF/LF, for which I don't know what does it mean.
Coq <
Coq < Print LoadPath.
Logical Path / Physical path:
<> /usr/local/Cellar/coq/8.11.0/share/coq
latex /usr/local/Cellar/coq/8.11.0/share/coq/latex
<> /usr/local/Cellar/coq/8.11.0/lib/coq/user-contrib
Ltac2 /usr/local/Cellar/coq/8.11.0/lib/coq/user-contrib/Ltac2
Coq /usr/local/Cellar/coq/8.11.0/lib/coq/plugins
Coq.firstorder /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/firstorder
Coq.ltac /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/ltac
Coq.extraction /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/extraction
Coq.btauto /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/btauto
Coq.syntax /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/syntax
Coq.nsatz /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/nsatz
Coq.omega /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/omega
Coq.cc /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/cc
Coq.derive /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/derive
Coq.ssr /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/ssr
Coq.rtauto /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/rtauto
Coq.micromega /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/micromega
Coq.funind /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/funind
Coq.setoid_ring /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/setoid_ring
Coq.ssrmatching /usr/local/Cellar/coq/8.11.0/lib/coq/plugins/ssrmatching
Coq /usr/local/Cellar/coq/8.11.0/lib/coq/theories
Coq.PArith /usr/local/Cellar/coq/8.11.0/lib/coq/theories/PArith
Coq.MSets /usr/local/Cellar/coq/8.11.0/lib/coq/theories/MSets
Coq.QArith /usr/local/Cellar/coq/8.11.0/lib/coq/theories/QArith
Coq.Sorting /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Sorting
Coq.Program /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Program
Coq.ZArith /usr/local/Cellar/coq/8.11.0/lib/coq/theories/ZArith
Coq.Bool /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Bool
Coq.Sets /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Sets
Coq.NArith /usr/local/Cellar/coq/8.11.0/lib/coq/theories/NArith
Coq.Wellfounded /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Wellfounded
Coq.Arith /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Arith
Coq.Vectors /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Vectors
Coq.Reals /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Reals
Coq.Logic /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Logic
Coq.Floats /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Floats
Coq.Classes /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Classes
Coq.Lists /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Lists
Coq.Relations /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Relations
Coq.Unicode /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Unicode
Coq.Structures /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Structures
Coq.Setoids /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Setoids
Coq.Numbers.Integer.Binary
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Integer/Binary
Coq.Numbers.Integer.NatPairs
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Integer/NatPairs
Coq.Numbers.Integer.Abstract
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Integer/Abstract
Coq.Numbers.Integer
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Integer
Coq.Numbers.NatInt
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/NatInt
Coq.Numbers.Natural.Binary
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Natural/Binary
Coq.Numbers.Natural.Peano
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Natural/Peano
Coq.Numbers.Natural.Abstract
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Natural/Abstract
Coq.Numbers.Natural
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Natural
Coq.Numbers.Cyclic.Int63
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Cyclic/Int63
Coq.Numbers.Cyclic.Int31
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Cyclic/Int31
Coq.Numbers.Cyclic.ZModulo
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Cyclic/ZModulo
Coq.Numbers.Cyclic.Abstract
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Cyclic/Abstract
Coq.Numbers.Cyclic
/usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers/Cyclic
Coq.Numbers /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Numbers
Coq.Compat /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Compat
Coq.Strings /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Strings
Coq.Init /usr/local/Cellar/coq/8.11.0/lib/coq/theories/Init
Coq.FSets /usr/local/Cellar/coq/8.11.0/lib/coq/theories/FSets
<> /Users/myname/Documents/Notes/PL/SF/LF
Can anyone help me figure out what happened?
You need to associate the current directory (.../LF) to the LF prefix:
(* In coqtop *)
Add LoadPath "." as LF.
(* So that... *)
Print LoadPath.
(* shows:
...
LF /Users/.../LF
*)
I also heard that directly using coqtop is strongly discouraged, and instead it is recommended to use a proper editor (VSCode, Emacs + Proof General, CoqIDE).
I use vscode and vscoq and also face with this problem. It should be mentioned that, if your workspace folder is not directly the lf/ folder downloaded from the webset, you'd better load full path instead of . as LF. (In this situation, it seems that the coqtop cannot see the _Coqproject too.)
A convenient solution is to load full path in the current .v file.
Add LoadPath "D:\path\to\lf\" as LF.
I’ve been using org-mode for my GTD system for a little while and now that I’m happy with it I decided to set it up on all my computers. My main machine for the last year or so has been on Archlinux and that’s where I did my setup originally now I’ve added a windows computer and a Pixelbook running Emacs in crostini. I’m syncing my org files with Dropbox and that works fine. I’ve copied my .emacs file to each computer and changed some file paths for my windows machine. Almost everything seems to be working fine except for something strange with my Capture Templates.
On the Pixelbook the Templates using file+olp+datetree throws an invalid capture target specification ie:
("m" "Meeting Note" entry
(file+olp+datetree "~/Dropbox/org/Journal.org" "Meetings")
"* Description: %^{Description|Meeting} %T
- Participants: %^{Participants}
- Location: %^{Location}
** Notes:
- %?
** Next Steps: :ReFile:
- [ ] ")
On the windows computer my Inbox ToDo capture throws the same error in the minibuffer:
("t" "New TODO to Inbox" entry
(file "C:/Users/jgallo/Dropbox/org/GTD.org" "Inbox")
"* TODO %?" :prepend :time-prompt t)
Anyone have any ideas what I might be missing?
The file+olp+datetree target expects just one argument, the filename. The same is true of the file target in your Windows configuration. If you want to use a headline for the target, you can use file+headline.
The details of these can be seen in the Org manual at Org capture template elements
I cannot make emacs to jump to next-error, previous-error, first-error in vhdl-mode.
I am using FSF Emacs 23.3.1 with recent vhdl-mode 3.33.28 under ubuntu.
I can compile with Modelsim and I get compiler error list:
-- Loading package standard
-- ...
-- Compiling entity foo
** Error: path/foo.vhd(22): (vcom-1136) Unknown identifier "std_olgic".
I tried to adapt error regexp (in compiler-setup) to the simplest one:
\*\* Error: \([a-zA-Z\/_.]*\)(\([0-9]*\)).*
When I use it this way I can see that it parses errors correctly:
sed "s/\*\* Error: \([a-zA-Z\/_.]*\)(\([0-9]*\)).*/\1 \2/" ...
path/foo.vhd 22
I changed "File subexp index" and "Line subexp index" respectively to 1 and 2 but still I cannot jump around errors.
The following config resolves this bug for me
'(vhdl-compile-use-local-error-regexp t)
(add-to-list 'compilation-error-regexp-alist '("** Error: \\(.+\\)(\\([0-9]*\\)):" 1 2))
In Emacs regexps, you need to double-escape parens in a string (explanation). Try something like this: \*\* Error: \\([a-zA-Z0-9/_.]+\\)(\\([0-9]+\\)).*
Sorry to bump an old topic but I just ran into this issue and got things to work out for me.
Here are the settings I used to get it to work:
Regexp:
\(ERROR\|WARNING\|\*\* Error\|\*\* Warning\)[^:]*:\( *[[0-9]+]\)? \(.+\)(\([0-9]+\)):
File subexp index: 3
Line subexp index: 4
Vhdl Compile Use Local Error Regexp (under Vhdl Compile group): Off
And here's my story about it:
http://www.velocityreviews.com/forums/t957495-emacs-vhdl-mode-next-error-previous-error-and-first-error-are-not-working.html
:P
Hope this helps!
What I'm looking for is this kind of command line interaction at the Windows command line:
C:\temp1>clj some_script.clj
C:\temp2>
Where some_script.clj contains something like:
(cd "c:\\temp2")
So the question is - how do I implement the function cd? Have experimented with clojure.java.shell, but it does not look like the lib I need. This might be a simple question, the problem might be that I'm not fluent in Java?!
You can't do this in Java, so you can't do it in Clojure. See Changing the current working directory in Java?
clojure can do this.
You only need to change a dynamic global variable called *sh-dir*. run the following code in your repl:
(use '[clojure.java.sh])
(sh "ls")
=> {:exit 0, :out "LICENSE\nREADME.md\nauto_deploy.iml\ndoc\nproject.clj\nresources\nsrc\ntarget\ntest\n", :err ""}
(binding [*sh-dir* "c:/"] (sh "ls"))
{:exit 0,
:out "$360Section
$GetCurrent
$Recycle.Bin
Boot
Documents and Settings
ImbaMallLog.txt
Intel
MSOCache
OEMSY
PerfLogs
Program Files
Program Files (x86)
ProgramData
Python27
Recovery
System Volume Information
Users
Windows
apache-ant-1.9.3
bootmgr
hiberfil.sys
inetpub
pagefile.sys
",
:err ""}
see the doc for more info. you can use (alter-var-root #'clojure.java.shell/*sh-dir* (constantly "the-cd-path")) to change it constantly. Thanks for isaac telling me about this.
Hope this helps.
In common lisp I can do this:
src-> (defmacro macro-hello ()
`"hello")
(eval '(macro-hello))
no problem.
In clojure:
(defmacro macro-hello []
`"hello")
(eval '(macro-hello))
gives me an error. Have I done something wrong?
Clojure Error:
Exception in thread "main" java.lang.Exception: Unable to resolve symbol: macro-hello in this context (NO_SOURCE_FILE:12)
at clojure.lang.Compiler.analyze(Compiler.java:4340)
at clojure.lang.Compiler.analyze(Compiler.java:4286)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:2767)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:4498)
at clojure.lang.Compiler.analyze(Compiler.java:4325)
at clojure.lang.Compiler.analyze(Compiler.java:4286)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:3862)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:3697)
at clojure.lang.Compiler$FnMethod.access$1100(Compiler.java:3574)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:2963)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:4494)
at clojure.lang.Compiler.analyze(Compiler.java:4325)
at clojure.lang.Compiler.eval(Compiler.java:4530)
at clojure.core$eval__3990.invoke(core.clj:1728)
at com.yourcompany.defpackage$_main__4.invoke(defpackage.clj:12)
at clojure.lang.AFn.applyToHelper(AFn.java:171)
at clojure.lang.AFn.applyTo(AFn.java:164)
at com.yourcompany.defpackage.main(Unknown Source)
Caused by: java.lang.Exception: Unable to resolve symbol: macro-hello in this context
at clojure.lang.Compiler.resolveIn(Compiler.java:4682)
at clojure.lang.Compiler.resolve(Compiler.java:4628)
at clojure.lang.Compiler.analyzeSymbol(Compiler.java:4605)
at clojure.lang.Compiler.analyze(Compiler.java:4307)
... 17 more
Java Result: 1
[Edited]: added ending double quote
Your code works for me.
user> (defmacro macro-hello [] `"hello")
#'user/macro-hello
user> (eval '(macro-hello))
"hello"
This is via bleeding-edge Clojure. "Unable to resolve symbol" means it can't find the macro called macro-hello in the current namespace. Are you running this from the REPL or in a source file? I typed your statements at a REPL literally.
Not sure if this is a cause of problems for you, but please note the difference between ` and ' in Clojure. ` does namespace resolution and ' doesn't.
user> `macro-hello
user/macro-hello
user> 'macro-hello
macro-hello
This is different from Common Lisp's behavior. Backtick-quoting a String like `"hello" doesn't make much sense, since Strings don't belong to namespaces, but it also doesn't hurt anything.
(I'm assuming you made a typo in your Clojure code, with the missing double-quote.)
I like to work out of /opt on Mac and Linux boxes. To get the Clojure source. (% is Unix prompt)
% cd /opt
% git clone git://github.com/richhickey/clojure.git; #From Unix command line, you'll have an /opt/clojure dir
% cd /opt/clojure
% /opt/netbeans-6.7.1/java2/ant/bin/ant; # Run ant. It ships with Netbeans.
% cd /opt; # mkdir /opt if it's not there.
% git clone git://github.com/richhickey/clojure-contrib.git; # Get contrib
% /opt/netbeans-6.7.1/java2/ant/bin/ant -Dclojure.jar=../clojure/clojure.jar ; # Tell ant where clojure.jar is located
I rename jars to clojure.jar and clojure-contrib.jar
Copy these jars to your Netbean's project lib directory.