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 101 other people reading this forum.


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

Login to reply

👍?
helpful
8:39pm Mon 2nd Sep, Mark LN.

Hey,

Thought we could share interesting and weird ml code to test our work. Here is one I came up with:

mlcode

2 is printed

3 is printed afterwards

value <- 1

function increment value <- value + 1

Function call with parens right against the name

increment() print value

Empty lines ignored:

Function call with parens separated by a space

increment () print value


You can change it to test your expression checker as follows (this should print an error saying value2 is not defined or something like that):

```mlcode```
# 2 is printed
# 3 is printed afterwards
#
value <- 1
#
function increment
	value <- value2 + 1

# Function call with parens right against the name
increment()
print value

# Empty lines ignored:

# Function call with parens separated by a space
increment ()
print value

cheers,

Mark

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