每日一博 | 手写编程语言 - 递归函数是如何实现的?
前言 本篇文章主要是记录一下在 GScript 中实现递归调用时所遇到的坑,类似的问题在中文互联网上我几乎没有找到相关的内容,所以还是很有必要记录一下。 在开始之前还是简单介绍下本次更新的 GScript v0.0.9 所包含的内容: 支持可变参数 优化 append 函数语义 优化编译错误信息 最后一个就是支持递归调用 先看第一个可变参数: //formats according to a format specifier and writes to standard output. printf(string format, any ...a){} //formats according to a format specifier and returns the resulting string. string sprintf(string format, any ...a){} 以上是随着本次更新新增的两个标准函数,均支持可变参数,其中使用 ... 表示可变参数,调用时如下: printf("hello %s ","123"); printf("hello-%s-%s ","12...