Rebol中虚拟运行环境的自动修改功能

发布于 2024-10-03 18:54:13 字数 975 浏览 3 评论 0原文

我想在函数执行完毕后自动修改它(上下文是在虚拟运行时环境中远程执行,该环境共享模拟函数堆栈的代码块(因为这个堆栈是共享的,我想每次为下一个命令重置所有内容)调用)请参阅 http://askblogautomation.com/developers-guide/),例如(完整上下文请参阅http://askblogautomation.com/install-wordpress/):

install-wordpress
set 'install-wordpress func[][do read http://askblogautomation.com/install-wordpress/]

我想通用化上面的行与

execute 'install-wordpress

执行位置如下

execute: func[lit-word-command [lit-word!]][
  do get lit-word-command
  block-command: []
  append block-command [do read]
  append block-command to-url rejoin [http://askblogautomation.com/ lit-word-command]
  set lit-word-command func[] block-command
]

但是当我尝试它时,它给出了错误:

** 脚本错误:执行预期的 lit-word-command 参数类型: 亮词

如何解决这个问题?

I want to auto-modify a function once it has executed itself (context is remote execution in a virtual runtime environment that shares a code-block which simulate stack of functions (because this stack is shared I want to reset everything each time for next command call) see http://askblogautomation.com/developers-guide/) like this for example ( for full context see http://askblogautomation.com/install-wordpress/):

install-wordpress
set 'install-wordpress func[][do read http://askblogautomation.com/install-wordpress/]

I want to genericize the above lines with

execute 'install-wordpress

Where execute is as below

execute: func[lit-word-command [lit-word!]][
  do get lit-word-command
  block-command: []
  append block-command [do read]
  append block-command to-url rejoin [http://askblogautomation.com/ lit-word-command]
  set lit-word-command func[] block-command
]

But when I tried it, it gives error:

** Script Error: execute expected lit-word-command argument of type:
lit-word

How to fix this ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝海似她心 2024-10-10 18:54:13

要么更改调用行:

 execute to-lit-word 'install-wordpress

要么更改函数规范:

execute: func[lit-word-command [word!]][

但不能两者都更改!

Either change the invoking line:

 execute to-lit-word 'install-wordpress

Or change the function spec:

execute: func[lit-word-command [word!]][

But not both!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文