It's UWAweek 42 (2nd semester, week 12)

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 738 articles.
Currently 55 other people reading this forum.


 UWA week 36 (2nd semester, mid-semester break) ↓
SVG not supported

Login to reply

👍?
helpful
3:57pm Wed 4th Sep, ANONYMOUS

Hello!

I'm currently working on functions and have two questions:

  • Should attempting to print a function with no return yield a 0 or an error
  • Does a function with no inputs use empty brackets when called

For example, take the ML code:

x <- 1
y <- 2

function printadd
	print x + y

print printadd ()

In this example, will the output be:

3
0

Or will it be an error? And since there are no parameters for printadd, do I need to include the brackets after printadd as shown?

Thank you!

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