我是SML的新手,並且通過它做家庭作業。 「編寫一個函數number_in_month,它包含日期和月份列表(即int),並返回列表中給定月份中的多少個日期。」SML中的遞歸
這就是我的工作,看不出有什麼問題。請幫忙。
`
fun number_in_month (dates: (int*int*int) list,month:int) =
if ((#2 (hd dates)) = month)
then val flag=1 flag+number_in_month(tl dates, month)
else number_in_month((tl dates),month)`
REPL告訴:與EQUALOP替換VAL。