아래 코드는 단지 프로토 타입의 일종입니다. 내가 알고 싶은 것은 그것이 왜 컴파일되지 않는지입니다.ML 코드의 오류 이유
fun test(list) =
let
fun inner(list) =
let
val from = #1(hd(list))
in
if null(tl(list)) = false then innerinner(tl(list),from)
else false
end
fun innerinner(list,from) =
if #2(hd(list)) = from then true
else if null(list) = false then innerinner(tl(list),from)
else false
in
inner(list)
end;
오류 메시지는 다음과 같습니다
test.txt:7.34-7.44 Error: unbound variable or constructor: innerinner
test.txt:3.2-9.6 Error: unresolved flex record
(can't tell what fields there are besides #1)
test.txt:10.2-13.13 Error: unresolved flex record
(can't tell what fields there are besides #2)
uncaught exception Error
raised at: ../compiler/Toplevel/interact/evalloop.sml:66.19-66.27
....
나는 ML 프로그래밍의 종류 초보자입니다. 아무도 저에게 잘못된 것을 가르쳐 줄 수 있습니까?
또는 (에서 XS) OrElse라는 innerinner에서 아마도'X1 =') 원인 –
을하지만, 훨씬에 엉망하지 않으려 고 노력 원래 함수 및 내 포인트를 느슨하게 위험 :) –