It's UWAweek 50

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 7 articles in this topic
Showing 7 of 834 articles.
Currently 2 other people reading this forum.


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

Login to reply

👍?
helpful
7:23pm Mon 9th Sep, Johar K.

As the ml syntax outlines here, a function can have a statement which can be a function call: program-item: statement | function identifier ( identifier )* ←–tab–→ statement1 ←–tab–→ statement2 .... statement: identifier "<-" expression | print expression | return expression | functioncall So does this mean recursion is allowed or is this referring to calling other functions only?


SVG not supported

Login to reply

👍?
helpful
8:46pm Wed 11th Sep, Joshua N.

"Johar Khan" <24*3*0*6@s*u*e*t*u*a*e*u*a*> wrote:
> As the ml syntax outlines here, a function can have a statement which can be a function call: > > program-item: > statement > | function identifier ( identifier )* > ←–tab–→ statement1 > ←–tab–→ statement2 > .... > > statement: > identifier "<-" expression > | print expression > | return expression > | functioncall > > So does this mean recursion is allowed or is this referring to calling other functions only?
The syntax of ml does seem to allow recursion, shouldn't be hard to implement (since you just copy the function call into C).


SVG not supported

Login to reply

👍?
helpful
1:22pm Thu 12th Sep, Liam vdM.

Surely this won't be tested though as it will always become an infinite loop since there's no base case


SVG not supported

Login to reply

👍?
helpful
8:59pm Thu 12th Sep, Joshua N.

"Liam van der Moezel" <23*0*9*2@s*u*e*t*u*a*e*u*a*> wrote:
> Surely this won't be tested though as it will always become an infinite loop since there's no base case
Yes, I forgot there are no "if" statements in ml, because there are no "if" statements, it would run forever. So, don't worry about recursion. Can't see the point in testing an infinite loop.


SVG not supported

Login to reply

👍?
helpful
3:41pm Fri 13th Sep, Amitava D.

"Johar Khan" <24*3*0*6@s*u*e*t*u*a*e*u*a*> wrote:
> As the ml syntax outlines here, a function can have a statement which can be a function call: > > program-item: > statement > | function identifier ( identifier )* > ←–tab–→ statement1 > ←–tab–→ statement2 > .... > > statement: > identifier "<-" expression > | print expression > | return expression > | functioncall > > So does this mean recursion is allowed or is this referring to calling other functions only?
Where did you get this ml syntax from? I haven't seen this.


SVG not supported

Login to reply

👍?
helpful
3:42pm Fri 13th Sep, Liam vdM.

It's a link on the project description page


SVG not supported

Login to reply

👍?
helpful
7:20am Sat 14th Sep, Joshua N.

"Amitava Datta" <am*t*v*.*a*t*@*w*.*d*.*u> wrote:
> "Johar Khan" <24*3*0*6@s*u*e*t*u*a*e*u*a*> wrote: > > > As the ml syntax outlines here, a function can have a statement which can be a function call: > > > > program-item: > > statement > > | function identifier ( identifier )* > > ←–tab–→ statement1 > > ←–tab–→ statement2 > > .... > > > > statement: > > identifier "<-" expression > > | print expression > > | return expression > > | functioncall > > > > So does this mean recursion is allowed or is this referring to calling other functions only? > > Where did you get this ml syntax from? I haven't seen this.
[CITS2002]

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