本文介绍了IO语言“应用参数"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Io编程语言中,有什么等同于lisp的apply函数.

In the Io programming language, is there an equivalent to lisp's apply function.

例如,我有一个包装writeln的方法:

So for example I have a method to wrap writeln :

mymeth := method(
              //do some extra stuff

             writeln(call message arguments))
)

此刻,它仅打印列表,并且不评估其内容,就好像它们是自己的参数一样.

At the moment this just prints the list, and doesn't evaluate it's contents as if they were it's own args.

推荐答案

感谢建议evalArgs的人(不确定您的评论去了哪里).

Thanks to that person who suggested evalArgs (not sure where your comment went).

无论如何,我的情况还是可以解决的,尽管不幸的是我想一般情况下都不会.

Anyway that has resolved for my situation, although unfortunately not in general I guess.

您可以通过执行以下操作来实现我所描述的内容:

You can achieve what I describe by doing :

writeln(call evalArgs join)

writeln(call evalArgs join)

这将评估所有参数,然后将结果合并为单个字符串.

This evaluates all arguments, and then joins the results into a single string.

这篇关于IO语言“应用参数"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 08:50