Wrap a function

0 views
Skip to first unread message

Joan Miller

unread,
Jan 27, 2010, 11:53:19 AM1/27/10
to metapython
I've to call to many functions with the format:

>>> run("cmd")

Would be possible to use a macro to substitute the next one by the
above command? i.e.: $ cmd

$ cmd => run("cmd")

Rick Copeland

unread,
Jan 27, 2010, 1:58:45 PM1/27/10
to metap...@googlegroups.com
This could work with the following syntax, I believe:

defcode cmd():
run("cmd")

$cmd

-Rick

> --
> You received this message because you are subscribed to the Google
> Groups "metapython" group.
> To post to this group, send email to metap...@googlegroups.com.
> To unsubscribe from this group, send email to metapython+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/metapython?hl=en
> .
>
>

Joan Miller

unread,
Jan 27, 2010, 2:17:15 PM1/27/10
to metapython
But 'cmd' would be the shell command passed, i.e.:

run("pwd") or run("ls /home")

Richard Copeland

unread,
Jan 29, 2010, 4:16:02 PM1/29/10
to metap...@googlegroups.com
I can't think of a way to make it work the way you want.  Sorry about that.
Reply all
Reply to author
Forward
0 new messages