Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Clojure 无法在此上下文中解析符号:defrel_Clojure_Clojure Core.logic - Fatal编程技术网

Clojure 无法在此上下文中解析符号:defrel

Clojure 无法在此上下文中解析符号:defrel,clojure,clojure-core.logic,Clojure,Clojure Core.logic,我无法让clojure从core.logic库中识别defrel。因此,在使用lein(和compojure)设置了一个项目并让core.logic运行*后,我尝试了一个使用defrel的简单示例。下面是生成的标题,包括:use clojure.core.logic和失败的行(请参阅我想要运行的完整示例) lein 2.0生成的project.clj文件如下: (defproject hw2 "0.1.0-SNAPSHOT" :description "FIXME: writ

我无法让clojure从core.logic库中识别defrel。因此,在使用lein(和compojure)设置了一个项目并让core.logic运行*后,我尝试了一个使用defrel的简单示例。下面是生成的标题,包括:use clojure.core.logic和失败的行(请参阅我想要运行的完整示例)

lein 2.0生成的project.clj文件如下:

    (defproject hw2 "0.1.0-SNAPSHOT"
      :description "FIXME: write description"
      :url "http://example.com/FIXME"
      :dependencies [[org.clojure/clojure "1.5.1"]
                     [compojure "1.1.6"]
                     [org.clojure/core.logic "0.8.5"]
                    ]
      :plugins [[lein-ring "0.8.10"]]
      :ring {:handler hw2.handler/app}
      :profiles
      {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
                            [ring-mock "0.1.5"]]}})
如果我运行lein ring server,我会得到:

    ian@U11-VirtualBox:~/cljtest/test1/hw2$ lein ring server
    Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: defrel in this context, compiling:(hw2/handler.clj:21:1)
根据lein的说法,所有内容都是最新的,即:lein deps相应地下载所有内容,等等。O/S是Ubuntu 13

从命令行:

    ian@U11-VirtualBox:~/cljtest/test1/hw2$ lein repl
    nREPL se rver started on port 47146 on host 127.0.0.1
    REPL-y 0.3.0
    Clojure 1.5.1
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
        Exit: Control+D or (exit) or (quit)
     Results: Stored in vars *1, *2, *3, an exception in *e

    user=> (use 'clojure.core.logic)
    WARNING: == already refers to: #'clojure.core/== in namespace: user, being replaced by: #'clojure.core.logic/==
    nil
    user=> (defrel father Father Child)

    CompilerException java.lang.RuntimeException: Unable to resolve symbol: defrel in this context, compiling:(/tmp/form-init6854269717866939932.clj:1:1) 
再次运行*工作正常

我已经试过了,但找不到任何有效的方法。

:

:

:

:


此功能也已从中消失。我不知道它现在是什么/如果是。似乎它现在是
(pldb/db rel man p)
(pldb/db[man'Bob][man'John])
这个函数也从数据库中消失了。我不知道它现在是什么/如果是。似乎它现在是
(pldb/db rel man p)
(pldb/db[man'Bob][man'John])
这个函数也从数据库中消失了。我不知道它现在是什么/如果是。似乎它现在是
(pldb/db rel man p)
(pldb/db[man'Bob][man'John])
这个函数也从数据库中消失了。我不知道它现在是什么/如果是。似乎它现在是
(pldb/db rel man p)
(pldb/db[man'Bob][man'John])
    ian@U11-VirtualBox:~/cljtest/test1/hw2$ lein repl
    nREPL se rver started on port 47146 on host 127.0.0.1
    REPL-y 0.3.0
    Clojure 1.5.1
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
        Exit: Control+D or (exit) or (quit)
     Results: Stored in vars *1, *2, *3, an exception in *e

    user=> (use 'clojure.core.logic)
    WARNING: == already refers to: #'clojure.core/== in namespace: user, being replaced by: #'clojure.core.logic/==
    nil
    user=> (defrel father Father Child)

    CompilerException java.lang.RuntimeException: Unable to resolve symbol: defrel in this context, compiling:(/tmp/form-init6854269717866939932.clj:1:1) 
From 0.8.4 to 0.8.5
====

Changes
----
* old defrel functionality now replaced by pldb