gpt4 book ai didi

scripting - 为什么 Golfscript 示例在开始时使用弹出并丢弃?

转载 作者:行者123 更新时间:2023-12-02 11:29:56 24 4
gpt4 key购买 nike

;'2706 410'
~{.@\%.}do;

来自 GCD 示例。看起来开始时的 pop 和丢弃不会执行任何操作,那么为什么会出现这种情况呢?

最佳答案

程序从堆栈顶部的标准输入内容开始。弹出窗口会丢弃这些未使用的输入,以便在程序退出时不会打印它。

来自tutorial :

There is no explicit input command in GolfScript, instead when your script is executed, all input from stdin is read first and placed as a string onto the stack.

和:

When your script reaches the end. The contents of the stack are printed automatically.

关于scripting - 为什么 Golfscript 示例在开始时使用弹出并丢弃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5283823/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com