我有两个长度为n和m的序列.每个都是形式(x,y)的一系列点,并表示图像中的曲线.我需要找到不同(或类似)这些序列给出的事实
这些序列可能是相反的方向(即序列1从左到右,而序列2从右到左)
我研究了Levenshtein之类的一些差异估计以及蛋白质折叠的结构相似性匹配中的编辑距离,但它们似乎都没有.我可以编写自己的暴力方法,但我想知道是否有更好的方法.
谢谢.
当我尝试在方法中设置全局参数时,我会遇到一些奇怪的行为.
(defparameter *global-var-1* nil)
(defun method1 ()
(setf *global-var-1* '())
(format t "~a~%" *global-var-1*)
...
(loop
...
(setf *global-var-1* '(a))
(format t "~a~%" *global-var-1*)
(nconc *global-var-1* (list '(b c))))
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,当我调用method1时,第一个格式语句总是nil
按预期打印.第二个格式语句打印(A)
第一次调用method1,但第二次打印(A (B C))
.第三次(A (B C) (B C))
等等.setf似乎将其设置为先前的已知值,而不是设置*global-var-1*
为(A)
.我究竟做错了什么?顺便说一下,我正在设置*global-var-1
,(A)
因为nconc
无法使用空列表.我(A)
在退出method1之前删除.
我正在运行Aquamacs + Slime,当我启动Aquamacs时,我可以自动启动Slime.但是,当我尝试加载lisp文件后,我会不断收到各种错误,具体取决于我是如何尝试加载文件的.这是我的偏好.el
(setq inferior-lisp-program "~/ccl/dx86cl64"
slime-startup-animation nil)
(require 'slime)
(split-window-horizontally)
(other-window 1)
(slime)
(eval-after-load "slime"
'(progn
(slime-compile-and-load-file "/Users/xxxxx/xxxxx/load-seq.lisp")
))
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
error: Buffer *inferior-lisp* is not associated with a file.
Run Code Online (Sandbox Code Playgroud)
我尝试了其他功能,包括load
compile-and-load
和slime-load-file
分别得到以下错误......
Invalid read syntax: #
Symbol's function definition is void: compile-and-load
error: Not connected.
Run Code Online (Sandbox Code Playgroud)
当我(load "/Users/xxxxx/xxxxx/load-seq.lisp")
使用粘液REPL 时,lisp文件加载(并编译)很好.看起来当我把它放在Preferences.el中时,即使我正在使用它也不会等待粘液加载eval-after-load
.