Unknownz
09-18-2003, 09:21 AM
Hello !
I am wondering how to return a function in a function. I want to do this to be able to return a operator.
The result I would like to achieve is something like this:
returnOperator::Char->(here i want to return a "pointer" to a operator)
returnOperator chr
| chr == '*' = (now I want to return the multiply operator)
chooseOperation::Int->Int->Char->Int
chooseOperation val1 val2 op = val1 (returnOperator op) val2
Would be very greatfull if someone could help me out or at least give me some clue on what to look for.
Thx!
I am wondering how to return a function in a function. I want to do this to be able to return a operator.
The result I would like to achieve is something like this:
returnOperator::Char->(here i want to return a "pointer" to a operator)
returnOperator chr
| chr == '*' = (now I want to return the multiply operator)
chooseOperation::Int->Int->Char->Int
chooseOperation val1 val2 op = val1 (returnOperator op) val2
Would be very greatfull if someone could help me out or at least give me some clue on what to look for.
Thx!