For example,

let procedure string-to-task "print ?"
(run procedure "hello")

There a couple reasons one would want to do this:

  1. Tasks don't need to be recompiled, whereas strings sometimes do (especially when using a lot of them).
  2. You can't pass in arguments when trying to run a string.
有帮助吗?

解决方案

You sure can! Using this one weird only-obvious-in-retrospect trick:

to-report string-to-task [s]
  report runresult (word "task [" s "]")
end

Note that this will return either a reporter task or a command task, depending on the contents of the input string.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top