gpt4 book ai didi

syntax-error - 程序结尾的语法错误

转载 作者:行者123 更新时间:2023-12-03 08:14:09 25 4
gpt4 key购买 nike

我正在尝试编译此代码,并且它在最后一行中返回语法错误:(,有一个想法为什么

let nth_index str c n = 
let i = 0 in
let rec loop n i=
let j = String.index_from str i c in
if n>1 then loop (n-1) j
else
j

最佳答案

您最外面的let不需要匹配的in。它是一个顶级定义。

但是,其他三个let确实需要匹配的in。而且您只有两个in

关于syntax-error - 程序结尾的语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49292004/

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