0
let, in, end를 사용하여 카레 함수를 정의하는 데 문제가 있습니다. 나는 다음과 같은 코드를 가지고 :언 바운드 변수 또는 생성자
filter_many listOfFunc listOfElements =
let
fun allPredicate(element,[]) = true
| allPredicate(element,(a,b)::xs) = a(element) andalso (allPredicate(element,xs))
fun isPredicateAux(element) = allPredicate(element,listOfFunc)
in
List.filter isPredicateAux listOfElements
end;
아이디어는 요소 '의 목록과 튜플의리스트를 (A, B) A는 술어 기능 동안 걸릴 것입니다. (fn 'a => bool). 이 함수는 listOfFunction의 모든 조건 자에 true를 반환하는 listOfElement의 모든 요소를 반환합니다. ListOfFunctions의 각 튜플의 두 번째 변수를 확인하지 말고, 나중에 사용하기 위해.
나는 다음과 같은 오류가이 코드의 peice를 실행하는 동안
stdIn:123.54-123.64 Error: unbound variable or constructor: listOfFunc
stdIn:125.30-125.44 Error: unbound variable or constructor: listOfElements
stdIn:1.1-106.11 Error: unbound variable or constructor: filter_many
stdIn:106.12-106.22 Error: unbound variable or constructor: listOfFunc
stdIn:106.23-106.37 Error: unbound variable or constructor: listOfElements
나는이 문제의 원인을 이해 할 수없는 것. 모든 기능과 변수는 그것들을 사용하는 사람들에게 보여야한다. 내가 여기서 무엇을 놓치고 있니?
감사합니다.
잘 그게 akward, 감사합니다 Logged –