我正在学习Kadena,并在https://docs.kadena.io/learn-pact/beginner/hello-world学习教程。
我复制粘贴了代码
(define-keyset 'hello-admin (read-keyset 'hello-keyset))
(module hello 'hello-admin
"Pact hello-world with database example"
(defschema hello-schema
"VALUE stores greeting recipient"
value:string)
(deftable hellos:{hello-schema})
(defun hello (value)
"Store VALUE to say hello with."
(write hellos "hello" { 'value: value }))
(defun greet ()
"Say hello to stored value."
(with-read hellos "hello" { "value" := value }
(format "Hello, {}!" [value])))
)
(create-table hellos)
(hello "world") ;; store "hello"
(greet) ;; say hello!当我将它加载到REPL中时,使用<interactive>:2:0: Cannot define a keyset outside of a namespace时出错
发布于 2022-09-07 06:38:24
我把它加上去了
(define-namespace 'mynamespace (read-keyset 'user-ks) (read-keyset 'admin-ks))
(namespace "mynamespace")https://stackoverflow.com/questions/73613646
复制相似问题