Bonjour, je reçois des erreurs de compilation dans le code SML suivant, quelqu'un peut-il m'aider?Erreur dans le code SML
Error: operator and operand don't agree [UBOUND match]
operator domain: 'Z list
operand: ''list
in expression:
null mylist
stdIn:4.15-4.24 Error: operator and operand don't agree [UBOUND match]
operator domain: 'Z list
operand: ''list
in expression:
hd mylist
stdIn:6.19-6.36 Error: operator and operand don't agree [UBOUND match]
operator domain: 'Z list
operand: ''list
in expression:
tl mylist
stdIn:6.10-7.21 Error: operator is not a function [circularity]
operator: 'Z
dans l'expression: (exists_in (point, tl mylist)) exists_in
Code:
fun exists_in (item: ''int, mylist:''list) =
if null mylist
then false
else if (hd mylist) = item
then true
else exists_in(item, tl mylist)
exists_in(1,[1,2,3]);
Je pense que vous vouliez dire 'int' et' int list' ou ''' a' et' '' une liste', pas '' 'int' et ''' list'. – molbdnilo