And thanks for your help. I'm currently working on an assigment, and I've been stuck with a faulty recursive call. I have a simple CAML-Light function which is supposed to take a list and a size (number), and return a list with a chunk of that list, of that size, and a list with the rest. Really simple actually, it's a translation from a past PLT-Scheme project.
However, I'm having trouble with the recursive call. I simply don't know why it's not working. The function goes like this:
let rec cortar texto longitud resultado = match texto, longitud with
| _::t,0 -> resultado::(t::[])
| c::t,x-> cortar t (longitud-1) (consderecha resultado c);;
Longitud is the integer which defines the size. I'm afraid I'm doing something terribly wrong, as it appears to loop infinitely because "longitud" never reaches 0. I'm (as you may guess) new to ML and it's dialects, so any help would be really appreciated.
Thanks!
EDIT: Solved it, actually not really... Turns out I was calling the function with commas on the list, rather than semicolons. Yep. So thanks!!