what does “syntax error found at EOF” means and why am i getting it for this recursive function?

浪子不回头ぞ 提交于 2020-03-23 14:43:05

问题


I'm getting the error in SMLNJ:

Error: syntax error found at EOF

what does this means? The function that seems to be causing the error is the following.

fun number_in_month (dates : int*int*int list, month : int) = 
           if null dates
           then 0
           else if #2 (hd dates) = month
           then number_in_month(tl dates, month) + 1    

It is supposed to take a list of dates (int*int*int list) and a month (int) and returns how many dates in the list are in the given month. Thanks for your kind help.

来源:https://stackoverflow.com/questions/60449439/what-does-syntax-error-found-at-eof-means-and-why-am-i-getting-it-for-this-rec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!