粘土编程语言的控制台输出

发布于 2024-10-15 05:54:44 字数 124 浏览 7 评论 0原文

我想玩一下 clay 一点,但我不知道如何让输出显示在安慰。有没有我可以使用的库函数?与这个问题相关:我在哪里可以找到一些文档?

I want to play around with clay a little but I did not figure out how to get the output to display on the console. Is there any library function I could use? And related to this question: where can i find some documentation?

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

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

发布评论

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

评论(1

流星番茄 2024-10-22 05:54:44

看来 println 函数应该做你想做的事。它是从标准库隐式导入的。

println("Hello, World!");

文档似乎很少,但有一个 wiki

这看起来很有趣的语言。谢谢你指出来。

编辑:
这是我为控制台输入编写的一个小例子。

main() {
    println("What is your name: ");
    var name = readLine(stdin);
    println("Hello, ", name);
}

看起来最好的信息来源是捆绑库的源代码。在这种情况下,我查看了 io/streams/streams.clay

It looks as though the println function should do what you want. It is implicitly imported from a standard library.

println("Hello, World!");

Documentation seems sparse, but there is a wiki.

This looks like and interesting language. Thank you for pointing it out.

Edit:
Here is a little example I whipped up for console input.

main() {
    println("What is your name: ");
    var name = readLine(stdin);
    println("Hello, ", name);
}

It looks like the best source of information is the source code of the bundled libraries. In this case, I looked at io/streams/streams.clay

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