It's UWAweek 47

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying selected article
Showing 1 of 828 articles.
Currently 87 other people reading this forum.


 UWA week 37 (2nd semester, week 7) ↓
SVG not supported

Login to reply

👍?
helpful
8:49pm Fri 13th Sep, Chenjun H.

By passing a function as a parameter to another function, I mean

function exec a
    return a()
#
function seven
    return 7
#
print exec(seven)

Here we pass the function seven to the function exec as its a parameter, and the ``exec``` function executes it, ultimately resulting in 7 being printed.

Is this behavior allowed in ml? If it is, how do we get around c's function type checking? I believe that to pass a function to a function, its necessary to create a function pointer like so void func ( void (*f)(int) );.

Also with respect to functions with the same name, should we assume it never happens or check it?

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy