It's UWAweek 45 (2nd semester, 2nd exam week)

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


 UWA week 35 (2nd semester, week 6) ↓
SVG not supported

Login to reply

👍?
helpful
6:27am Tue 27th Aug, Christopher M.

ANONYMOUS wrote:
> 1 .Is it possible to have cases where functions and variables in ml share the same identifier while still being separate entities? Or do they have to be wholly unique?
No - you cannot introduce a new function if its name is already used as a variable's name, or introduce a new variable if its name is already used as a function's name.
> 2. Do parameters behave like they do in C, rather than in Python where variables passed to a function via one of its parameters can be directly updated by said function? (ie a function has a variable x, that it passes to another function which then updates the value of x in the original function).
Parameters are passed as they are in C. A copy of an actual parameter's value is used to initialise a function's formal parameter. This is termed pass-by-value (and is the only parameter passing mechanism in C).
> 3. Each line is one statement, does this mean variable initialisations are limited to one per line, or can one line have multiple variable initialisations on it? If so, what does this look like (are they separated by commas?)
There are no 'variable initialisation' statements, only assignment statements, and each statement appears on its own line.
> and also, concerning the project brief page itself: > 4. What is meant by point 8 on the “Our ml language” section of the project page? Do arg0, arg1, etc. refer to arguments passed to the main() function of the c file/code we create by translating a given ml file?
When the compiled C program is executed, its runtime command-line arguments are available in ml's arg0, arg1, ... Hope this helps,

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