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 the 3 articles in this topic
Showing 3 of 828 articles.
Currently 95 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!


SVG not supported

Login to reply

👍?
helpful
6:58pm Wed 4th Sep, ANONYMOUS

Oops! Directly after posting I saw this article which is very similar... So now I'm only really looking for an answer to the empty braces question!


SVG not supported

Login to reply

👍?
helpful
7:21pm Wed 4th Sep, Joshua N.

Hello anon,

Judging by the Syntax of ml, I would say parenthesis are required for function calls.

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