0

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 ?

1 Answer 1

2

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!

1
  • Thanks, I'm too confused between word! and lit-word! :) Nov 22, 2010 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.