首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Kadena不能在命名空间错误之外定义密钥集。

Kadena不能在命名空间错误之外定义密钥集。
EN

Stack Overflow用户
提问于 2022-09-05 18:53:27
回答 1查看 133关注 0票数 2

我正在学习Kadena,并在https://docs.kadena.io/learn-pact/beginner/hello-world学习教程。

我复制粘贴了代码

代码语言:javascript
复制
(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时出错

EN

回答 1

Stack Overflow用户

发布于 2022-09-07 06:38:24

我把它加上去了

代码语言:javascript
复制
(define-namespace 'mynamespace (read-keyset 'user-ks) (read-keyset 'admin-ks))
(namespace "mynamespace")
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73613646

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档