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 288 tagged articles
Showing 288 of 828 articles.
Currently 127 other people reading this forum.


 UWA week 43 (2nd semester, study break) ↓
SVG not supported 10:16pm Tue 22nd Oct, Joshua N.

I'm sorry to hear that, it's likely a mistake. As Anon said, email Amitava ASAP.


SVG not supported 4:53pm Tue 22nd Oct, ANONYMOUS

ANONYMOUS wrote Email Amitava "ami a a d t a u a e u a " d m i m t v S P But most likely because it hasn't been fully out. Most likely you'll get it tmr like he mentioned in his email.


SVG not supported 4:49pm Tue 22nd Oct, ANONYMOUS

This happened to me and my project partner too. Who do we email?


SVG not supported 4:38pm Tue 22nd Oct, ANONYMOUS

It is the case only one needs to submit, please tell your partner to contact the email ASAP.


SVG not supported 4:36pm Tue 22nd Oct, Juliana SF.

hello there just wondering if this is happening to anyone else but the project marks seem to be incorrect for our partners? i have the actual mark while my partner has 0 40 is there any way to check this? I was under the impression that we only neede...


SVG not supported 3:12pm Mon 21st Oct, Amitava D.

ANONYMOUS wrote I am trying to release the marks, some marking is still left.


 UWA week 42 (2nd semester, week 12) ↓
SVG not supported 9:16pm Mon 14th Oct, Joshua N.

ANONYMOUS wrote Last I heard marking is, unfortunately, going very slowly. Hopefully it will be done before the exam.


SVG not supported 2:10pm Mon 14th Oct, ANONYMOUS

Are there any updates on the marks for the first project? I know someone had said it would hopefully be before exams, but just checking if there has been any progress since then given it s the biggest non-exam assessment in the unit. Thanks


 UWA week 40 (2nd semester, week 10) ↓
SVG not supported 11:38am Wed 2nd Oct, Joshua N.

ANONYMOUS wrote It's going to take a while. Hopefully before the exam.


SVG not supported 10:21am Wed 2nd Oct, ANONYMOUS

just wondering when project one marks are likely to be released?


 UWA week 39 (2nd semester, week 9) ↓
SVG not supported 1:52pm Mon 23rd Sep, Joshua N.

ANONYMOUS wrote I would say so but to be 100 sure I recommend checking with Amitava.


SVG not supported 1:51pm Mon 23rd Sep, Joshua N.

ANONYMOUS wrote There are no stupid questions. Only stupid answers. I think either will be accepted since it wasn't specified if ml print statement will print a newline at the end or not. I think logically it would make more sense if ml did print a n...


SVG not supported 9:08am Mon 23rd Sep, ANONYMOUS

https ipoint.uwa.edu.au app answers detail a id 2712 So it is OK to make my code public after this week? Assignments will not be accepted more than 7 days after the due date.


 UWA week 38 (2nd semester, week 8) ↓
SVG not supported 11:42pm Sun 22nd Sep, ANONYMOUS

Hello, This is probably a stupid question but since the results are compared using automated marking I want to clarify something. The only 'true' output produced by your translated and compiled program (when running) is the result of executing ml's pr...


SVG not supported 10:56pm Sat 21st Sep, Joshua N.

ANONYMOUS wrote Do not make your code public until all the late submissions are in. Some people will have extensions and so they will still be doing their project.


SVG not supported 7:04pm Sat 21st Sep, ANONYMOUS

My project code is hosted on the github, and my teammate and I worked on it as the 'private project', so it is not visible to the public. Since most students have submitted their work, is it acceptable to make my code public now? Thanks a lot.


SVG not supported 9:43pm Fri 20th Sep, Joshua N.

ANONYMOUS wrote I don't think Amitava can modify the website. Only Chris can because it is his website. I'm guessing Amitava will place updated on LMS as needed.


SVG not supported 9:42pm Fri 20th Sep, Joshua N.

ANONYMOUS wrote Doing your own research is fine so long as you use the approved c11 libraries (e.g. methods from string.h). I think a good rule of thumb is to only use the c libraries covered in labs and lectures.


SVG not supported 9:09pm Fri 20th Sep, ANONYMOUS

Hi, I was wondering if we just have to only know content from Weeks 1-6 or can we go online and look at other methods that can be used in our project? Thanks


SVG not supported 12:18pm Fri 20th Sep, Joshua N.

I can't be 100 sure. If I had to guess it would have something to do with the compiler you are using. E.g. mac vs linux. gcc is more particular wants things done a certain why. I think clang is more lenient. Or in other words I think you are using d...


SVG not supported 10:33am Fri 20th Sep, Prem P.

I have made a function which combines it, and it works but when I add it to the actual code, it is giving an error with one of the files. Another question is, I won't use the old way to compile but I don't understand why I wasnt working when I made t...


SVG not supported 9:53am Fri 20th Sep, Joshua N.

I don't think you completely understand how argument passing works in ml. Have you read these posts? https secure.csse.uwa.edu.au run help2002?p np opt U441 hl arg0 https secure.csse.uwa.edu.au run help2002?p np opt U344 hl arg0


SVG not supported 9:23am Fri 20th Sep, Jinseok K.

I wonder after converting a argv 1 to a double ex argv 1 123.ml Is this 123 assigned to the variable like "x - 123.0" ? thank you


SVG not supported 7:26am Fri 20th Sep, Joshua N.

Firstly, remember that you need to submit 1 c source file. So, you need to merge these files together. The error you are getting usually mean you are trying to compile an object file. In other words a file with the ".o" extension. Object files are us...


SVG not supported 10:26pm Thu 19th Sep, Joshua N.

Just make sure to convert argv 1 to a double.


SVG not supported 10:24pm Thu 19th Sep, Joshua N.

Yes. That is the only thing you need to check. If you see a variable, you don't recognize you must replace it with 0.


SVG not supported 10:22pm Thu 19th Sep, Joshua N.

Yea Amitava said you can do it anyway you want. So long as runml.c is compiled with -Wall, -Werror, etc.


SVG not supported 10:20pm Thu 19th Sep, Joshua N.

You would have to ask Chris since he wrote the project, usually it is fine. However, you definitely can't share the solution to the project until all late submission are in.


SVG not supported 10:15pm Thu 19th Sep, Joshua N.

This is a reasonable assumption. Make sure to put it in your assumption doc.


SVG not supported 10:14pm Thu 19th Sep, Joshua N.

Amitava said you can do either. For unused variable multiply the variable by 1 and the error goes away.


SVG not supported 10:12pm Thu 19th Sep, Joshua N.

ANONYMOUS wrote Usually, it's just one person. Amitava would have to clarify.


SVG not supported 5:25pm Thu 19th Sep, Allan W.

So the answer to this seems obvious but anyhow It would be reasonable to assume we won't be tested on identifier names which are reserved keywords in C, right? E.g. we would never get an identifier called "int" or "return" or "struct"... Putting reser...


SVG not supported 4:52pm Thu 19th Sep, Seoyoung P.

Hi, Are we supposed to compile and run generated c file from .ml file with -Wall -Werror flags? For example, cc -std c11 -Wall -Werror -o sample sample.c Or is it acceptable to compile without the flags, like this? cc -std c11 -o sample sample.c ...


SVG not supported 3:44pm Thu 19th Sep, Jinseok K.

Thank you


SVG not supported 1:49pm Thu 19th Sep, ANONYMOUS

yeah just got an idea, thanks


SVG not supported 1:34pm Thu 19th Sep, Liam vdM.

Not necessarily, there is a way to do it very cleanly


SVG not supported 1:13pm Thu 19th Sep, Xiaoqin F.

I asked other student, we guess they should be a reference of parameter for generated C translation files, you can define like this char arg0 argv 1 in your c file, and the generated c file can use arg0 directly


SVG not supported 11:43am Thu 19th Sep, ANONYMOUS

I would rather not if I don't have to because that would mean passing all file paths to every single function with exit failures


SVG not supported 9:14am Thu 19th Sep, Jinseok K.

i know the what is the mean arg0, arg1... but i couldn't get it "provide access to the program's command-line arguments which provide real-valued numbers' means." here.


SVG not supported 9:55pm Wed 18th Sep, Samay G.

What is the expression is x - y 2 But y is not declared so we have to check and declare it, is not that expected?


SVG not supported 9:37pm Wed 18th Sep, Jinseok K.

I don't really understand what 'the variables arg0, arg1, and so on, provide access to the program's command-line arguments which provide real-valued numbers' means. I would appreciate it if someone could explain what this means. Thank you


SVG not supported 9:06pm Wed 18th Sep, ANONYMOUS

you can add the -std c11 flag while compiling to enforce the c11 standard, I believe unistd.h and sys wait.h are allowed


SVG not supported 8:30pm Wed 18th Sep, Liam vdM.

I understood we can compile the translated c file however we want, it's just runml.c that has to be compiled in a certain way


SVG not supported 8:23pm Wed 18th Sep, ANONYMOUS

Is this list exhaustive? Requirement 3 specifies OS and POSIX functions as well - which functions are allowed? I am using unistd.h for execv and sys wait.h for wait as these were covered in lecture 9. Should I use system in stdlib.h inste...


SVG not supported 5:35pm Wed 18th Sep, Joshua N.

ANONYMOUS wrote This is not what Chris means. He means to not submit header files (e.g. you can't submit a header file you wrote). You still have to import header files or compilation will fail. Your code won't compile if you do this. This is what ...


SVG not supported 5:30pm Wed 18th Sep, Joshua N.

ANONYMOUS wrote You can make assumptions about any of the project requirements that are unclear. In the doc you are stating what you believe you are meant to do or what you believe the requirements are telling you to do. E.g. one assumption could be ...


SVG not supported 5:27pm Wed 18th Sep, Joshua N.

ANONYMOUS wrote No, I don't think so, since they represent the command line arguments. However, since it hasn't been clarified you can put whatever you assume in the doc.


SVG not supported 5:24pm Wed 18th Sep, Joshua N.

ANONYMOUS wrote Possibly, but it is a bit ambiguous you could probably have an assumption in your assumption doc about it. This definitely has to be true. I believe the point 9 is stating that in the ml file the function definition has to come before t...


SVG not supported 4:11pm Wed 18th Sep, ANONYMOUS

No,regex.h is not permitted. regex.h may be a part of the system-provided POSIX library but you are only allowed to use the C11 standard library functions. Refer this link to know the headers that you'll be allowed to use https en.cppreference.com w...


SVG not supported 4:06pm Wed 18th Sep, ANONYMOUS

G'day all, Just a query regarding submission of our final runml.c code into cssubmit. There is a liner under the Project 1 page, "Submission requirements", point number 2 'Submit only a single C11 source-code file named runml.c Do not submit any header...


SVG not supported 3:42pm Wed 18th Sep, ANONYMOUS

Hi all, we're so confused about the requirement in the lecturer email 16 09 24 "Please make any assumptions you may deem appropriate and base your implementation on those assumptions. Please submit the assumptions in a text or pdf document along wit...


SVG not supported 2:27pm Wed 18th Sep, ANONYMOUS

sorry, wrong tag


SVG not supported 11:49am Wed 18th Sep, ANONYMOUS

9. a function must have been defined before it is called in an expression Is this saying that if we call a function like printsum(x,y) that the printsum function is defined before it is called Or is the dotpoint saying that if you call printsum there ...


SVG not supported 11:16am Wed 18th Sep, Joshua N.

ANONYMOUS wrote Amitava said to use 'cc -std c11 -Wall -o output output.c'.


SVG not supported 11:04am Wed 18th Sep, ANONYMOUS

Just for clarification, can we compile the translated C file with the command 'cc -std c11 -o output output.c' or it needs to be 'cc -std c11 -Wall -o output output.c'


SVG not supported 9:51am Wed 18th Sep, Joshua N.

ANONYMOUS wrote Don't need to validate y 2 since it is an expression, but you do need to validate the assignment.


SVG not supported 9:43am Wed 18th Sep, ANONYMOUS

Hello, Just to confirm. Do we not have to validate any expressions which are assigned to a variable. E.g. x - y 2. Do we need to validate 'y 2', or do we only validate identifiers used in an expression? Thanks


SVG not supported 8:31pm Tue 17th Sep, Joshua N.

ANONYMOUS wrote I believe Chris intended students to actually parse the strings themselves. If you want confirmation, you will have to ask Amitava. Honestly, I don't think regex.h will make your life easier.


SVG not supported 7:53pm Tue 17th Sep, ANONYMOUS

Just making sure, is regex.h permitted? We have used some regex for string parsing. As far as I know, it is considered a system-provided (POSIX) library.


SVG not supported 5:01pm Tue 17th Sep, Joshua N.

ANONYMOUS wrote WSL stands for "Windows Subsystem for Linux". So Linux.


SVG not supported 4:08pm Tue 17th Sep, ANONYMOUS

CITS2002 Project 1 2024 Student1 STUDENT-NUMBER1 NAME-1 Student2 STUDENT-NUMBER2 NAME-2 Platform Linux (or Apple) Hi, if I have been using windows but have been writing my code in VSC with WSL, should I indicate windows or L...


SVG not supported 3:34pm Tue 17th Sep, Joshua N.

Maybe my answer to this question will answer your question https secure.csse.uwa.edu.au run help2002?p np opt U344 hl arg0 Let me know.


SVG not supported 3:30pm Tue 17th Sep, Joshua N.

ANONYMOUS wrote I mean a lot of the advice given on the forum is based off the project requirements and clarifications Chris made, so it really depends on which advice you are talking about. A rule of thumb for assumptions is If you make an assumpti...


SVG not supported 3:19pm Tue 17th Sep, Joshua N.

ANONYMOUS wrote Seems good so far. Just make sure to delete the output.c file and the executable when you are done.


SVG not supported 2:01pm Tue 17th Sep, ANONYMOUS

Is it correct that the syntax assumptions in the report do not have to align with the advice given on this help forum? Such as if global variables, variable reassignment and parameter checking have already been implemented, they can be listed as assum...


SVG not supported 1:26pm Tue 17th Sep, Sean G.

I have a question regarding the project, specifically point 8 within the assignment brief The variables arg0, arg1, and so on, provide access to the program's command-line arguments which provide real-valued number...


SVG not supported 6:44am Tue 17th Sep, ANONYMOUS

Hello, I just wanted to check if I'm on the right track The runml.c program 1) reads the .ml text file 2) translates the .ml text into valid C syntax 3) writes the translated C syntax into an output.c file 4) then complies and runs the output.c file this ...


SVG not supported 5:35am Tue 17th Sep, Joshua N.

ANONYMOUS wrote Answered here https secure.csse.uwa.edu.au run help2002?p np opt U278 hl website


SVG not supported 5:35am Tue 17th Sep, Joshua N.

ANONYMOUS wrote This is a statement, so yes. pqr will be zero so it won't matter. sas will cause the error, since there are two identifiers followed after each other in a statement, which is invalid syntax.


SVG not supported 3:45am Tue 17th Sep, ANONYMOUS

In an assignment expression, will I be tested on intricate cases like sas abc - 2.4 pqr Error ?


SVG not supported 1:23pm Mon 16th Sep, ANONYMOUS

Hi, will we be getting a way to test whether our program is valid?


SVG not supported 5:32am Mon 16th Sep, Joshua N.

This is invalid syntax. program A program is made up of zero or more program items. program-item A program item is either a statement or a function, a function can have zero or more identifiers. statement A statement is either an assignment or a pri...


SVG not supported 5:23am Mon 16th Sep, Joshua N.

ANONYMOUS wrote The file is temporary and will be deleted by your program. So, you can name it whatever you want (but make 110 sure the name doesn't and will not collide with other file names when run on other people's computers). However, the reaso...


 UWA week 37 (2nd semester, week 7) ↓
SVG not supported 11:14pm Sun 15th Sep, ANONYMOUS

Hello, i would like to ask regarding the output file (the c file where we translate the ml file to). Do we have to make the output file with the PID included like in the example?


SVG not supported 10:45pm Sat 14th Sep, Joshua N.

ANONYMOUS wrote Amitava needs to answer this one. From project specification "Your submission will be examined, compiled, and run on a contemporary Ubuntu Linux or macOS platform. Your project only needs to execute successfully on one of these platfo...


SVG not supported 10:43pm Sat 14th Sep, Joshua N.

ANONYMOUS wrote Hi, in both cases, the variables would be considered global since they are not located inside of a function.


SVG not supported 10:40pm Sat 14th Sep, Joshua N.

Hi Yuxuan You are allowed to make assumptions and submit them with your code submission. I believe the original intension was that all expressions will be valid, so you don't need to check them. Statements in a function should be 1 tab and everything ...


SVG not supported 10:16pm Sat 14th Sep, Joshua N.

ANONYMOUS wrote Yea that's fine as long as you delete all the files you create. The only thing that needs to be a single file is the runml program itself.


SVG not supported 9:53pm Sat 14th Sep, ANONYMOUS

So I was thinking that my project would be cleaner if I have separate temp files for function definitions, glabal variables and the main function. At the end I would merge these files, compile and run the final c file and then delete all of them. Jus...


SVG not supported 6:26pm Sat 14th Sep, ANONYMOUS

I'm not OP but I don't think it's unreasonable to ask for clarification given that cssubmit still says it's due yesterday. I submitted mine just now and it says it's late with a minus 5 penalty - I assume I won't actually lose 5 , but it's still a b...


SVG not supported 6:05pm Sat 14th Sep, ANONYMOUS

In the code provided in sample02.ml, are the variables x and y considered local variables, or can they also be considered global variables? An assignment statement, 2.500000 is printed x - 2.5 y - 5 print x print y Or are variables only considered glob...


SVG not supported 5:08pm Sat 14th Sep, Yuxuan Z.

1. "All syntax errors detected in invalid ml programs must be reported via stderr on a line commencing with the ' ' character. Your runml program must be able to detect all invalid ml programs - EXCEPT that your program will not be tested with any in...


SVG not supported 1:53pm Sat 14th Sep, ANONYMOUS

Dear Prof. Amitava Thank you for your reply. I tested 8 samples successfully, but I still have two questions 1. I have passed 8 test cases and printed correctly. The former lecturer mentioned that he would post a web link specifically for testing, ...


SVG not supported 7:20am Sat 14th Sep, Joshua N.

https teaching.csse.uwa.edu.au units CITS2002 projects project1-syntax.php


SVG not supported 7:13am Sat 14th Sep, Joshua N.

No ml doesn't allow passing a function to a function. It is too complex for this project, and I don't believe it will be covered in the unit.


SVG not supported 7:10am Sat 14th Sep, Joshua N.

ANONYMOUS wrote Yes, the ml syntax allows it.


SVG not supported 7:09am Sat 14th Sep, Joshua N.

ANONYMOUS wrote Yes, otherwise if you have already done it Amitava said you can state the assumptions you made in a file. So, you can do either, just state what assumption you made.


SVG not supported 12:33am Sat 14th Sep, ANONYMOUS

This is a repost of a previous question https secure.csse.uwa.edu.au run help2002?p np opt U224 , is the following code permitted? function add a b return a b function two return 2 print add(1, two())


SVG not supported 10:43pm Fri 13th Sep, ANONYMOUS

https secure.csse.uwa.edu.au run help2002?p np opt B388 year 2024 do we instead follow this and not allow any duplicate names of variable reassignment now??


SVG not supported 10:38pm Fri 13th Sep, ANONYMOUS

This assumption was based off '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.' from https secure.csse.uwa.edu.au run help2002?p np ...


SVG not supported 8:49pm Fri 13th Sep, Chenjun H.

By passing a function as a parameter to another function, I mean function exec a return a() function seven return 7 print exec(seven) Here we pass the function seven to the function exec as its a parameter, and the exec ...


SVG not supported 3:42pm Fri 13th Sep, Amitava D.

ANONYMOUS wrote multiple declaration of the same variable (name) is an error, you can assume that. We are not overthinking here, make simplifying assumptions, state those assumptions in a file, and you will be fine.


SVG not supported 3:42pm Fri 13th Sep, Liam vdM.

It's a link on the project description page


SVG not supported 3:41pm Fri 13th Sep, Amitava D.

Where did you get this ml syntax from? I haven't seen this.


SVG not supported 3:39pm Fri 13th Sep, Amitava D.

ANONYMOUS wrote You can add a print statement in the ml file if you want something to be printed. Submit that modified ml file mentioning that you have added a print statement.


SVG not supported 3:37pm Fri 13th Sep, Amitava D.

ANONYMOUS wrote I don't understand the source of this confusion. I have sent an email (and you can clearly quote that in case of any dispute) aand what I wrote there is correct. I cannot go on sending emails recursively and validate ad infinitum.


SVG not supported 3:36pm Fri 13th Sep, Amitava D.

ANONYMOUS wrote I didn't have much time to look at the project carefully. However, main() is also valid in C, without any parameters like argc and argv


SVG not supported 8:21am Fri 13th Sep, Joshua N.

ANONYMOUS wrote Best to ask Amitava.


SVG not supported 8:21am Fri 13th Sep, Joshua N.

ANONYMOUS wrote Yes


SVG not supported 8:21am Fri 13th Sep, Joshua N.

ANONYMOUS wrote No, because we are assuming expressions are valid and don't need to be checked.


SVG not supported 7:20am Fri 13th Sep, Joshua N.

ANONYMOUS wrote Best to ask Amitava.


SVG not supported 7:14am Fri 13th Sep, Joshua N.

If you want to be 100 sure you can ask Amitava. You can always do something with var to remove the warning. Literally just do var var 1 and the warning will go away.


SVG not supported 10:43pm Thu 12th Sep, Joshua N.

ANONYMOUS wrote Tabs are a form of white space. More detail given here https secure.csse.uwa.edu.au run help2002?p np opt U351


SVG not supported 10:39pm Thu 12th Sep, Joshua N.

Best to ask Amitava for clarification.


SVG not supported 10:33pm Thu 12th Sep, Joshua N.

ANONYMOUS wrote Technically they're not considered "identifiers" just "variables". So, in other words, they're an exception to the rule. As stated in the project description "8.the variables arg0, arg1, and so on, provide access to the program's comm...


SVG not supported 10:09pm Thu 12th Sep, ANONYMOUS

okay, so I can assume that the arguments will be accessed under the alias arg0, arg1, .... and not under any other name correct? but wouldn't this contradict the statement where identifier names can only include lowercase alphabetic order?


SVG not supported 9:20pm Thu 12th Sep, Joshua N.

ANONYMOUS wrote You are missing something. You replace the identifiers (in the ml file) arg0, arg1, arg2, etc. By the command line arguments that are passed to run ml. e.g. . runml somefile.ml 1 2 3 means that in the ml file the parameters will be initi...


SVG not supported 9:17pm Thu 12th Sep, Joshua N.

ANONYMOUS wrote If print appear outside a function in ml, then you put the print statements in main otherwise you'll get an error.


SVG not supported 9:16pm Thu 12th Sep, Joshua N.

I believe so, they would be two separate identifiers, but they would count towards "unique" identifiers since they have the same name.


SVG not supported 9:13pm Thu 12th Sep, Joshua N.

ANONYMOUS wrote Why can't the same identifier name be reused? After the function ends the program would believe it is seeing the identifier for the first time and so would initialize it to 0.


SVG not supported 9:11pm Thu 12th Sep, Joshua N.

ANONYMOUS wrote Yes. Otherwise, there would be no way to differentiate between a normal variable and a command line argument.


SVG not supported 9:10pm Thu 12th Sep, Joshua N.

ANONYMOUS wrote Just add return 0.0 to the end of your functions if they don't have a return statement.


SVG not supported 9:09pm Thu 12th Sep, Joshua N.

ANONYMOUS wrote I believe Chris said either in the forum or the project sheet that all statements must start at the lefthand most side of the file unless it is a statement in a function. Not sure where a comment could appear (because technically comme...


SVG not supported 9:04pm Thu 12th Sep, Joshua N.

It would. Or you can write an if statement in the c version of the ml file to change what is printed, then let c do the hard work. That would make the most logical sense. Since warnings can be errors and do something unintended. No guarantees about the...


SVG not supported 8:59pm Thu 12th Sep, Joshua N.

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 5:26pm Thu 12th Sep, ANONYMOUS

1st project tag


SVG not supported 5:20pm Thu 12th Sep, ANONYMOUS

adding 1st project tag


SVG not supported 4:14pm Thu 12th Sep, ANONYMOUS

Since the same identifier name can't be reused its a local variable being called outside of its scope shouldn't this cause an error?


SVG not supported 4:01pm Thu 12th Sep, ANONYMOUS

right, I understand that the temporary C files can just be encapsulated like so (correct me if i'm wrong) c int main(int argc, char argv ) converted c code here but that doesn't really explain how the program can access the arguments, a...


SVG not supported 1:29pm Thu 12th Sep, ANONYMOUS

The ml doesn't need a main because it's not being compiled. It's the temporary C file being compiled which will need a main like every C program.


SVG not supported 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 1:10pm Thu 12th Sep, Samay G.

Q1) I saw the thread that you shared but it means that we will have to store the expression, evaluate it and then handle the value. something like - double temp entire expression ; if (temp int(temp)) .... Q2) So if i understand correctly, the expe...


SVG not supported 10:51am Thu 12th Sep, ANONYMOUS

is it okay to not allow defining identifier names of the form "arg number " at all?


SVG not supported 12:08am Thu 12th Sep, ANONYMOUS

once we finished transcribing the ml language into C code in a separate file, I assume we need to call the system function to run shell commands to run the C file right? the problem with this is that we require a main function for it before it compile...


SVG not supported 11:27pm Wed 11th Sep, ANONYMOUS

Hi, currently I have all the functions double in the translated c file and it works fine even if the function doesn't have a return statement. I read that the return value is undefined for such functions in c so I just wanted to confirm that the retur...


SVG not supported 10:58pm Wed 11th Sep, ANONYMOUS

Hi, Thanks for replying I have another question, if comment is inside a function definition does it have to start with a tab character? My question was more about if I can completely rely on the tab character to mark the end of function definitions.


SVG not supported 8:50pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote Hey guys, ml accepts whole numbers, there is no example in the ml file where there is a decimal point after a whole number, e.g. 2.0 would just appear as 2 in the ml file. I'm assuming as more decimal places are required they will be ...


SVG not supported 8:46pm Wed 11th Sep, Joshua N.

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 8:45pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote Best to ask Amitava.


SVG not supported 8:45pm Wed 11th Sep, Joshua N.

Best to ask Amitava.


SVG not supported 8:43pm Wed 11th Sep, Joshua N.

Note there are no empty lines in ml, "empty lines" start with a .


SVG not supported 8:42pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote It would be illegal. The syntax of ml doesn't allow the printing of statements.


SVG not supported 8:40pm Wed 11th Sep, Joshua N.

You wouldn't need to check mismatched brackets as Chris said expression checking isn't necessary. Yes, if 24.00, print as 24. if 24.5, print as 24.500000 Not sure but better to be safe than sorry and assume it can be as deep as it is in C.


SVG not supported 8:38pm Wed 11th Sep, Joshua N.

I would say it works as it does in c, and would return 0, so the outer print would return 1.


SVG not supported 8:37pm Wed 11th Sep, Joshua N.

Hi Trisha, Sorry for the delay. If no clarification is given, better to be safe than sorry and assume it is possible. This functionality is allowed within the ml syntax.


SVG not supported 8:36pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote Hi unfortunately because Chris is now on leave, I'm not sure if the website will be released.


SVG not supported 8:35pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote If no clarification is given, better to be safe than sorry and check the number of parameters.


SVG not supported 8:35pm Wed 11th Sep, Joshua N.

Identifiers and functions shouldn't have the same name. Syntax of ml allows this. You should be able to just copy the function call into c and it would work.


SVG not supported 8:30pm Wed 11th Sep, Joshua N.

You need to change the format string of printf so that you print the double without any decimal places. Answered here https secure.csse.uwa.edu.au run help2002?p np opt U245 hl integer I would say so. Some warning in C are straight up errors and res...


SVG not supported 8:27pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote Yes, that seems correct.


SVG not supported 8:24pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote Hi I don't believe empty lines are allowed in ml, all the sample files have no empty lines and instead use a comment to create an "empty" line.


SVG not supported 8:21pm Wed 11th Sep, Joshua N.

I believe it is fine to return zero if a function doesn't have a return value. Amitava please respond to the second question.


SVG not supported 8:19pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote I think either is fine, but returning 0.0 is probably easier.


SVG not supported 8:19pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote Depends on whether the function returns a value or not. You could just always have the function return a double and just add return 0.0 to the end of the function if there is no return value.


SVG not supported 8:17pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote From your attachment your runml isn't correct. As many of the samples print, yet there is no output in your terminal.


SVG not supported 8:16pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote If the ml file prints then the correct output should appear in the terminal. The ml file should throw an error if there a syntax error in the ml file. Likewise the ml file should correctly run and not throw an error if there are no er...


SVG not supported 8:12pm Wed 11th Sep, Joshua N.

Hi Anon, Amitava said the deadline is next week Friday.


SVG not supported 6:49pm Wed 11th Sep, ANONYMOUS

While the project will revert to its 20 contribution to our final grade, will the deadline be changed to the 20th as stated in the email, or will it maintain its original deadline on the 13th as well?


SVG not supported 6:45pm Wed 11th Sep, ANONYMOUS

I apologise for repeatedly asking, but I still need a more specific clarification regarding this case. The line 'Whitespace can only appear at the beginning of a line if it is a tab under a function definition' is said to be true but whitespace and t...


SVG not supported 11:37am Wed 11th Sep, ANONYMOUS

Hi, Could you please guide me on to define the tests whether successful? Just output like the picture shows or should they print the number as each sample writes? Which one is standard? Hope for clarification


SVG not supported 11:53pm Tue 10th Sep, ANONYMOUS

If the line in the mlfile reads function abc Should it be returning 0.0? Or is the return type void? Meaning I would be writing void abc() to the temp file?


SVG not supported 10:52pm Tue 10th Sep, ANONYMOUS

If they don't have a return value, is their default return value 0.0, or should it be a void function instead?


SVG not supported 3:43pm Tue 10th Sep, Harrison L.

Hello, I've just posted another article, but thought I should separate these for clarity. First of all, similar questions have already been asked in my article (https secure.csse.uwa.edu.au run help2002?p np opt B275 year 2024) as well as this art...


SVG not supported 3:35pm Tue 10th Sep, Harrison L.

Hello I have a few questions about expressions- best set up with a few excerpts from the project document. In section 4 of project requirements the following is said "your program will not be tested with any invalid expressions, so you do not ne...


SVG not supported 10:54am Tue 10th Sep, ANONYMOUS

Hi, I was wondering if empty lines are allowed in ml and if they are, will the empty lines inside a function definition start with a tab?


SVG not supported 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 ...


SVG not supported 5:05pm Mon 9th Sep, Harrison L.

Hello, This makes sense, but what if the variable is used again outside of the scope of the function? function func a problem - 3 return a problem problem - 5 print func(problem) The above example would work with a result of 8, with problem bein...


SVG not supported 2:54pm Mon 9th Sep, ANONYMOUS

Hi, 1. What is the expected behaviour when someone declares 2 functions of the same name, should the program report an error or replaces the function? 2. What if it has 2 different parameters but same name? Example 1 function increment value return va...


 UWA week 36 (2nd semester, mid-semester break) ↓
SVG not supported 10:04pm Fri 6th Sep, ANONYMOUS

Hi, am I correct in assuming that the variables arg0, arg1, and so on can only appear in expressions? In other words, this is ok x - arg0 2 but this is not ok arg0 - 2 function process arg1 do something Thank you


SVG not supported 5:27pm Fri 6th Sep, Joshua N.

You can do that if you want but I think the easiest way is to replace a with 0.0 if it doesn't match any identifier stored.


SVG not supported 5:25pm Fri 6th Sep, Joshua N.

Hi Zexu, "7.variables do not need to be defined before being used in an expression, and are automatically initialised to the (real) value 0.0" "12. a function's parameters and any other identifiers used in a function body are local to that function, an...


SVG not supported 5:16pm Fri 6th Sep, Zexu D.

Also, should i initalise automatically a new identifier when it appears in an expression? ml a doesn't appear before (add(1, 2) call(1, a))


SVG not supported 5:12pm Fri 6th Sep, Zexu D.

Hello, How am I supposed to treat new identifiers? As mentioned, a new identifier doesn't need to be initialised explicitly, however, at the same time, the variable will be invisible out of the function area. So should I treat a as a new variabl...


SVG not supported 4:45pm Fri 6th Sep, Joshua N.

ANONYMOUS wrote "4.only a single datatype is supported - real numbers, such as 2.71828" All parameters will be real numbers (doubles) as that is the only datatype supported.


SVG not supported 2:24pm Fri 6th Sep, Joshua N.

functions


SVG not supported 1:16pm Fri 6th Sep, ANONYMOUS

If an expression that is not a print is not inside a function's scope, would it be in the global scope? And if the print is outside of a function's scope, would it be located in the main function? For example, the ml file 9 is printed one - 1.555 on...


SVG not supported 11:01am Fri 6th Sep, Chenjun H.

Hi, Just a few questions about functions What should happen if a top level variable shares the same name as a function? Is this disallowed by ml like it is in C? Also, is it possible to pass a function as a parameter to a function, if it is, how would ...


SVG not supported 9:36pm Thu 5th Sep, ANONYMOUS

Hello, Section 4 of the project requirements (https teaching.csse.uwa.edu.au units CITS2002 projects project1.php) says that Which makes sense- but how far does not being tested with "invalid expressions" go? Can we assume that all functions that a...


SVG not supported 9:22pm Thu 5th Sep, Joshua N.

ANONYMOUS wrote Hi question is answered here https secure.csse.uwa.edu.au run help2002?p np opt U145


SVG not supported 9:15pm Thu 5th Sep, Daniel J.

Theoretically the language description limits it to 49; there's a maximum of 50 unique identifiers per file, and so if you had a single function there would be 1 identifier for the function name and a maximum of 49 for the function parameters. Althoug...


SVG not supported 7:06pm Thu 5th Sep, Joshua N.

np. It is this bit "Otherwise, whitespace can (but doesn't need to) appear anywhere else" In other words, both ways of calling the function as you have shown above are correct. A function call can have white space but doesn't need to have white sp...


SVG not supported 5:53pm Thu 5th Sep, ANONYMOUS

When it means checking the syntax, do we have to check for all cases, eg if we have a comment in the middle of a print call print incre ment(3) increment(4) TIA.


SVG not supported 5:41pm Thu 5th Sep, Harrison L.

Thank you very much This is useful information- though I still am a bit stuck until the first question is answered... I would also appreciate further clarification on the link in your answer (https secure.csse.uwa.edu.au run help2002?p np opt U14...


SVG not supported 5:20pm Thu 5th Sep, Joshua N.

ANONYMOUS wrote I feel you are reading too deeply into that section of that paragraph. If you continue reading "The strategy is to first translate programs written in other languages, such as our ml, to C, to compile that translated C code using a st...


SVG not supported 5:02pm Thu 5th Sep, ANONYMOUS

I have seen this sentence in the project sheet "Writing a compiler for any programming language is an enormous task, clearly not one suited for this project. However, what many have recognised, is that C is an excellent language to support other lan...


SVG not supported 4:53pm Thu 5th Sep, ANONYMOUS

Hi, Chris mentioned there will be a webpage where you can put the code in and you can see whether it matches with the sample solution. Just wondering when will it be released.


SVG not supported 4:29pm Thu 5th Sep, Joshua N.

Hi Harrison Sorry for the delay, unfortunately, there's been sudden changes to the teaching staff, so I have to wait for the new unit coordinator to clarify these questions. Answered here https secure.csse.uwa.edu.au run help2002?p np opt U201 perr...


SVG not supported 4:18pm Thu 5th Sep, ANONYMOUS

was wondering the same for your second point


SVG not supported 3:49pm Thu 5th Sep, Harrison L.

Hello, My first question is one which is halting me and has already been posted about a few times ( here (https secure.csse.uwa.edu.au run help2002?p np opt B243 year 2024) and here (https secure.csse.uwa.edu.au run help2002?p np opt B240 year 20...


SVG not supported 3:42pm Thu 5th Sep, Kimberley L.

1. What is the maximum number of parameters a function can take in? I do not see it anywhere in the project page. 2. Is it safe to assume that functions with no parameters will automatically be void functions?


SVG not supported 3:27pm Thu 5th Sep, Joshua N.

ANONYMOUS wrote Honestly it would be very hard to tell if a statement is meant to be in a function but it isn't. Since ml syntax allows statements to be inside or outside a function, there's no way of telling if they belong to a function if they aren...


SVG not supported 2:28pm Thu 5th Sep, ANONYMOUS

each statement in a function's body (one-per-line) is indented with a tab character So for this, we don't need to check if its indented and return a syntax error, we just say that if the line isn't indented then we aren't in a function anymore.


SVG not supported 12:36pm Thu 5th Sep, Songwen Y.

Consider the following ml code one - 1 two one 1 function add val print two val The variable two declared by assigning the result of an expression to it, and is accessed in function add , it should be a global variable to allow the ac...


SVG not supported 7:59am Thu 5th Sep, Joshua N.

ANONYMOUS wrote There are no guarantees what the last statement in a function will be, it could return, it could print, or it could be another statement (the syntax of ml allows this). So, relying on seeing a particular statement to know if the funct...


SVG not supported 7:48am Thu 5th Sep, Joshua N.

ANONYMOUS wrote You do not need to display the comments in the c file. Since the c file gets deleted anyway. So, when you come across a comment in ml you can just ignore it.


SVG not supported 1:49am Thu 5th Sep, ANONYMOUS

Adding to this, should we accept a number formatted as 1. or should we only accept 1 (no decimal if it is a whole number) or 1.0, 1.00, etc


SVG not supported 1:37am Thu 5th Sep, ANONYMOUS

How can we determine when a function body should end if not every function requires a return statement? The sample code with no return in the function body happens to end with a print statement, is this the only alternative to a return statement for ...


SVG not supported 1:22am Thu 5th Sep, ANONYMOUS

Hi, Does this mean whitespace is only significant when it is at the beginning of a line but still insignificant anywhere else (except when 1 whitespace minimum is necessary)? Therefore, any line beginning with a whitespace would cause an error (inclu...


SVG not supported 11:42pm Wed 4th Sep, ANONYMOUS

so, i saw that in the steps to run and execute ml files, we basically turn the ml file into a c file, compile it, and execute the program. However, it also says to delete the c file and executables after running a program, so does it even matter if i ...


SVG not supported 11:24pm Wed 4th Sep, ANONYMOUS

Okay, thanks for clarifying


SVG not supported 10:08pm Wed 4th Sep, Joshua N.

Ok let me try writing this out again, since half of my response got deleted. When you run your program like so . runml sample.ml runml (your project) will read the ml file given as the first parameter (in this case sample.ml), it will validate th...


SVG not supported 10:04pm Wed 4th Sep, Joshua N.

For some reason it isn't appearing. The code is ". runml sample.ml"


SVG not supported 10:04pm Wed 4th Sep, Joshua N.

The content in the code block is . runml sample.ml


SVG not supported 10:03pm Wed 4th Sep, Joshua N.

ANONYMOUS wrote Hi anon, I'm not 100 sure what you are asking but when you run your program like so . runml sample.ml runml (your project) will read the ml file given as the first parameter (in this case sample.ml), it will validate the m...


SVG not supported 9:24pm Wed 4th Sep, ANONYMOUS

For compiling The program should validate the syntax Generate the code in a .c file Do you then run . runml sample08.ml and then it should automatically delete the .c file and the compiled file as well?


SVG not supported 7:36pm Wed 4th Sep, Joshua N.

Hi Both of those messages are fine, but in general the more descriptive the error message, the better.


SVG not supported 7:28pm Wed 4th Sep, Joshua N.

Hi Josiah, The ml language only supports real numbers. So, an ml file wouldn't contain a string literal.


SVG not supported 7:21pm Wed 4th Sep, Joshua N.

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


SVG not supported 7:14pm Wed 4th Sep, Joshua N.

ANONYMOUS wrote Hi anon, I believe your question in answered in these two posts https secure.csse.uwa.edu.au run help2002?p np opt U145 https secure.csse.uwa.edu.au run help2002?opt U132


SVG not supported 7:12pm Wed 4th Sep, Joshua N.

Yes, that would break my cool idea. However, we can still fix it, just keep track of the quotes too. If we saw a quote ignore everything until we see another quote. Unfortunately, ml only supports real numbers, which makes me sad as this circumstance ...


SVG not supported 6:58pm Wed 4th Sep, ANONYMOUS

Oops Directly after posting I saw this article (https secure.csse.uwa.edu.au run help2002?p np opt B240 year 2024) which is very similar... So now I'm only really looking for an answer to the empty braces question


SVG not supported 6:45pm Wed 4th Sep, Mark LN.

what happens when the function takes a string as a parameter and the string contains bracket and commas? e.g. call function("This will break, your idea (maybe?)")


SVG not supported 5:26pm Wed 4th Sep, Josiah V.

Hi, For the ml sample files given are used as comments (unless I'm mistaken). If this is the case, then will our code be tested against files that contain strings that can also include hashtags or are our files strictly tested against ml files that ...


SVG not supported 4:05pm Wed 4th Sep, Mohammad Q.

Hi just wondering how specific the error messages should be should they return the full reason for error like "Function name is too long" or can the be as generic like "Function name invalid".


SVG not supported 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...


SVG not supported 2:27pm Wed 4th Sep, ANONYMOUS

He did specified 300 lines of important code, as in not including whitespaces, braces, includes, etc, so make sure you aren't counting those in your own line count. I highly doubt there will be penalties for too many lines though. The rubric certain...


SVG not supported 2:06pm Wed 4th Sep, Liam vdM.

My partner and I are basically done but we have almost hit 500 lines and can't find anything to remove that isn't necessary. Chris mentioned that anywhere close to 300 lines is over the top so 500 is a bit of a worry. 1) has anyone managed to keep it ...


SVG not supported 1:54pm Wed 4th Sep, Daniel J.

The description of ML allows for functions to have no return statements. If I have a function like function noreturn a b print a b print 1 noreturn(1, 2) Obviously the inner print will print 3, but what about the outer print? Is it expecte...


SVG not supported 11:50am Wed 4th Sep, ANONYMOUS

Hi, Would it be an issue if we consider all whitespaces in the ml program to be insignificant other than the statements within functions?


SVG not supported 8:34am Wed 4th Sep, Joshua N.

Hi Guys, Sorry about the delays replying. Some questions about project requirements are really good so I need further clarification (from teaching staff) before I can respond (I don't want to make the project too hard). So, for now if you are unsure o...


SVG not supported 8:10am Wed 4th Sep, Joshua N.

I should also mention you'd likely need to recursively "check" functions, e.g. If you're checking the parameters and encounter another function, start checking the new function. But like I said I'm not sure if it is necessary.


SVG not supported 8:02am Wed 4th Sep, Joshua N.

I'm not sure if it is necessary but it does sound like fun (if you're me anyway). You could check the number of arguments by counting the number of commas and the number of open brackets without a closing bracket. If number of open brackets is 1, then...


SVG not supported 10:24pm Tue 3rd Sep, Zexu D.

Do I need to consider the possible mismatched brackets? Like text func((1 2, foo) Am I supposed to use d or f according to the different return values of the expression? And what is the maximum recursive depth of the expression? t...


SVG not supported 8:38pm Tue 3rd Sep, Mark LN.

Yup sure - now you got me thinking about adding that as well Shouldn't be too hard I guess...


SVG not supported 1:51pm Tue 3rd Sep, Daniel J.

Thanks, I understand that is an option, but I do want to know whether the language actually permits passing references to functions, because the syntax guide suggests it does, and the language description doesn't seem to forbid it.


SVG not supported 12:56pm Tue 3rd Sep, Mark LN.

Instead of passing a function to another function, the first function can just be evaluated in the parameter expression like this function add a b return a b function two return 2 print add(1, two())


SVG not supported 12:50pm Tue 3rd Sep, ANONYMOUS

Hello, I was wondering if the following print x - 7 Would be legal syntax in ml. Or must this be written as x - 7 print x Thankyou


SVG not supported 10:04am Tue 3rd Sep, ANONYMOUS

Hi, I have the following questions about the project 1. Can we assume that a function must always have at least one statement in its body so if a function has no body (i.e. no indented statements) we should report this as an error? 2. If there are mor...


SVG not supported 9:16am Tue 3rd Sep, Trisha S.

Hi, wanted to know if variable reassignment is a possibility we have to look for in the assignment. E.g. x - 12 x - 5 print x Thank you. This is a repost of a previously untagged question.


SVG not supported 8:51am Tue 3rd Sep, Daniel J.

For clarification, it should be print add(1, two) I should read things more carefully.


SVG not supported 8:48am Tue 3rd Sep, Daniel J.

If we pass a function into another function as an argument, is it expected that we can call it, or should it be treated as an un-declared variable, ie 0? function add a b return a b() function two return 2 print add 1 two Should this produc...


SVG not supported 9:29pm Mon 2nd Sep, Joshua N.

Hi Functions don't always have a return statement (see sample05.ml). Your other question in this post https secure.csse.uwa.edu.au run help2002?p np opt U145


SVG not supported 9:21pm Mon 2nd Sep, Joshua N.

Hello, I think your question is answered by this post https secure.csse.uwa.edu.au run help2002?p np opt U145


SVG not supported 9:19pm Mon 2nd Sep, Joshua N.

Hey Guys, sadly I am not the prof, but I believe your questions are answered by the following posts 1. https secure.csse.uwa.edu.au run help2002?p np opt U145 2.https secure.csse.uwa.edu.au run help2002?opt U132


SVG not supported 8:53pm Mon 2nd Sep, Mark LN.

That would be hard to do without building a full-blown syntax parser, how would you figure out how many parameters are in this function call function name((x 1)-2, function2((a-1),b))


SVG not supported 8:44pm Mon 2nd Sep, Mark LN.

Ok wow - the markdown is a bit different to what I am used to using. Lets try that again because there doesn't seem to be a way to edit my post Working code 2 is printed 3 is printed afterwards value - 1 function increment value - value 1 ...


SVG not supported 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 na...


SVG not supported 4:10pm Mon 2nd Sep, ANONYMOUS

Should there be an explicit condition check where the number of arguments passed in a function call matches the number of formal parameters in the function definition?


SVG not supported 1:58pm Mon 2nd Sep, Joshua N.

Hi, your question is answered here https secure.csse.uwa.edu.au run help2002?p np opt U145


SVG not supported 1:54pm Mon 2nd Sep, Joshua N.

Hi, your question is answered here https secure.csse.uwa.edu.au run help2002?p np opt U151


SVG not supported 1:51pm Mon 2nd Sep, Yanchen Y.

I think they are definitely legal statements. Maybe the only illegal ones are function - 1 or print - 1 Because both print and function are reserved keywords, they are not supposed to be used as variable name.


SVG not supported 1:15pm Mon 2nd Sep, Zexu D.

Do we need to support a syntax like this? text x -x 2 x --1 Or only with legal in space-between text x - x 2 x - -1


SVG not supported 11:16am Mon 2nd Sep, ANONYMOUS

Can there be a variable name with the same name as a function defined?


 UWA week 35 (2nd semester, week 6) ↓
SVG not supported 7:04pm Sun 1st Sep, Wandi P.

Hello Thank you for explaining I still have a question. Does this mean that there shouldn't be any " " t t m n s i h f i i l s b i s o i c t i o o r o n d b g i g r i ' k y t u m t w t o t r m v n h e u g n t t m n s a o g...


SVG not supported 3:52pm Sun 1st Sep, ANONYMOUS

Is it correct to assume that return can only be used within a function and every function must have a return statement (so a return statement will always denote the end of a function body)?


SVG not supported 3:48pm Sun 1st Sep, ANONYMOUS

following on with this question 1. In the cases where 1 whitespace minimum is required (such as after function, return, print, between the function identifier and its parameters), can more whitespace be added without causing any error? 2. Can whitespa...


SVG not supported 12:08pm Sun 1st Sep, ANONYMOUS

Hi Prof., A quick question, just wanted to clarify if a - 5.4 b - a 8.2 c - a b is the same as a -5.4 b -a 8.2 c - a b


SVG not supported 6:43pm Sat 31st Aug, Daniel J.

Hey, I'm not Chris, but I believe that the description of function declarations found under the ml syntax guide allows this. These two lines specifically are relevant (...) means zero or more function identifier ( identifier )


SVG not supported 12:52pm Sat 31st Aug, ANONYMOUS

In the sample05.ml 18 is printed function printsum a b print a b printsum (12, 6) Are there any differences between printsum (12, 6) and printsum(12, 6)?


SVG not supported 11:14am Sat 31st Aug, Trisha S.

Hi, just wondering if empty functions, e.g function numbers print 1 print 2 print 3 numbers () is possible in .ml, or if functions require parameters to be passed through them, as shown in the rest of the sample.ml files.


SVG not supported 12:44pm Thu 29th Aug, ANONYMOUS

Can it be assumed that function parameters cannot share an identifier with variables outside the function either?


SVG not supported 12:07pm Thu 29th Aug, ANONYMOUS

Should it not be argv 2 , since argv 0 is . runml (for example) and argv 1 is program.ml ?


SVG not supported 5:31pm Wed 28th Aug, Junyu Z.

Could we make this more clear or simplified? If we accept any representations, the situation may be a little bit complicated 1. "1.5e4F" - Some characters like ".eF" must be grabbed when tokenizing a real number. 2. "- 4" - A space-separated minus m...


SVG not supported 5:22pm Wed 28th Aug, Christopher M.

ANONYMOUS wrote Thanks for highlighting this omission. It's now correctly stated on our Clarifications' page https teaching.csse.uwa.edu.au units CITS2002 projects project1-clarifications.php


SVG not supported 4:25pm Wed 28th Aug, ANONYMOUS

In one of the other help questions it was stated that HI am a little confused as to why it'll be arg0, arg1, ... as in the project "The goal of this project is to implement a C11 program, named runml, which accepts a single command-line argument provi...


SVG not supported 4:03pm Wed 28th Aug, Christopher M.

There's no need to do all this work yourself, as we have standard functions such atof and even strtof to help us.


SVG not supported 3:38pm Wed 28th Aug, Junyu Z.

Any clarifications about it, like a BNF? The syntax of float point value in C is more than numbers and a dot, as the link below shows. Thanks a lot. https learn.microsoft.com en-us cpp c-language c-floating-point-constants?view msvc-170


SVG not supported 3:26pm Wed 28th Aug, Christopher M.

I'm unsure of the acronym PEMDAS (suspecting it has the same meaning to the one I know, which is BOMDAS). As you do not have to check the validity of the expressions, you do not have to check or 'handle' the precedence of operators.


SVG not supported 3:24pm Wed 28th Aug, Christopher M.

ANONYMOUS wrote Syntactic errors in an ml program should be reported on a line beginning with a ' ', such as unrecognised statement They are different to any other debug statements that you wish to print out, such as n w i u c i n...


SVG not supported 3:17pm Wed 28th Aug, Trisha S.

Hi, my partner and I were wondering as all samples provided only involved basic mathematic notation Will we ever get .ml files with more complicated notation that requires the use of PEMDAS, for example 1 7 6 3, which should equal 15 with PEMDA...


SVG not supported 3:13pm Wed 28th Aug, Christopher M.

ANONYMOUS wrote Thanks for the question; I'll clarify the wording. When you find the first error (if there is one), print your error message and then terminate exit your runml program.


SVG not supported 2:53pm Wed 28th Aug, ANONYMOUS

The project requirements state that we need to catch usage errors and syntax errors. While it is stated that syntax errors must be reported to stderr beginning with a " ", I'm not sure what the following " " h r c e o e u r n i g i e e r n ...


SVG not supported 1:16pm Wed 28th Aug, Christopher M.

Hello Josiah, You appear to missed a significant amount of understanding about the project. Your program, runml , will transpile translate convert a small ml program into a C11 program (creating a new text file to hold that C11 program). That C11 p...


SVG not supported 12:40pm Wed 28th Aug, ANONYMOUS

The description says our program should check for "any" errors, and also that "all errors" should be reported through stderr stream. Does this mean even after finding one error in the file we should continue to search for more? Or just that all erro...


SVG not supported 11:40am Wed 28th Aug, Josiah V.

Reading the part in the Project 1 page that says ... "runml generates C11 code in a file named, for example, ml-12345.c (where 12345 could be a process-ID)", what C11 code is this referring to? Is it just some arbitrary code or something that we have...


SVG not supported 10:04am Wed 28th Aug, Christopher M.

ANONYMOUS wrote There shouldn't be any issues, in that there's no OS-specific features requirements in the project, and both Linux and macOS support all of the necessary POSIX functions.


SVG not supported 8:50am Wed 28th Aug, ANONYMOUS

My friend and I had decided to do the project 1 together. However, she uses Mac os while I use ubuntu. Will we still be able to do the project together without facing any issues?


SVG not supported 8:06am Wed 28th Aug, Christopher M.

ANONYMOUS wrote You do not need to validate expressions, thus you do not need to detect or report an error as in x - double 2 However, you will need to locate any identifiers within expressions, such as double above, - depending on y...


SVG not supported 8:01am Wed 28th Aug, Christopher M.

Believe me, it's not all it's cracked up to be.


SVG not supported 9:13pm Tue 27th Aug, Joshua N.

Hi unfortunately I am not Chris, but this forum post may answer your question post (https secure.csse.uwa.edu.au run help2002?p np opt U151)


SVG not supported 8:22pm Tue 27th Aug, ANONYMOUS

Thank you so much


SVG not supported 3:43pm Tue 27th Aug, ANONYMOUS

The project description states that All syntax errors detected in invalid ml programs must be reported via stderr on a line commencing with the ' ' character. Your runml program must be able to detect all invalid ml programs - EXCEPT that your progra...


SVG not supported 12:21pm Tue 27th Aug, ANONYMOUS

Hi Chris, I was wondering how we will be receiving command line arguments for our ml programs. The specs say that only the path will be passed to our runml program, but later it says that we may be passing command line arguments to our generated c pro...


SVG not supported 6:29am Tue 27th Aug, Christopher M.

ANONYMOUS wrote Your understanding is the wrong way around. An ml function must be defined before it can be called. The C code generated by your runml program should not have any C syntax errors, so the C compiler should not find or report any err...


SVG not supported 6:27am Tue 27th Aug, Christopher M.

ANONYMOUS wrote 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. Parameters are passed as they are in C. A copy of an actual param...


SVG not supported 5:55am Tue 27th Aug, Christopher M.

A good question (but, unfortunately, something I was hoping would be recognised as something that "should be done", rather than "must be done"). Yes. The ml variable arg0 'comes from' C's argv 1 , as the C program's name is unlikely to be a...


SVG not supported 10:20pm Mon 26th Aug, Chenjun H.

Thank you for the clarifications. My question about argument checking was poorly worded. It is clear to me that runml should perform argument checking, what I meant to ask was whether the ml scripts compiled by our program should perform argument chec...


SVG not supported 7:59pm Mon 26th Aug, ANONYMOUS

Hi, I was wondering if some of the syntax checking can be left for the c compiler to handle. For example, As I understand the requirements, we don't need to check if functions are defined before being called, since the c compiler will check and repor...


SVG not supported 6:26pm Mon 26th Aug, ANONYMOUS

Hi, my project partner and I have just had a discussion and came back with a few questions assumptions that we wanted to check about the syntax of ml. 1 .Is it possible to have cases where functions and variables in ml share the same identifier while ...


SVG not supported 4:54pm Mon 26th Aug, Christopher M.

Not quite sure of the context of this post. The intention is to not make any changes to the project description once it is finalised (as it was very early this morning, and announced in an announcement on this forum). Any necessary changes from now w...


SVG not supported 4:48pm Mon 26th Aug, Christopher M.

ANONYMOUS wrote Yes, all true, though the project won't be tested on these finer points of our tersely defined language. Yes.


SVG not supported 4:47pm Mon 26th Aug, Christopher M.

Hello, The focus of the project is not on designing and fully implementing a mini-language - it's 'only' about performing a quite mechanical syntactic translation from one language to another (C11), compiling, and then executing the program. The goal...


SVG not supported 3:58pm Mon 26th Aug, Junyu Z.

Do not know it is a proper way to let everyone know content changes of the project description. Update timestamps let everyone know whether the content has changed or not since the last time they checked out (if they still remember the date). Change lo...


SVG not supported 2:17pm Mon 26th Aug, ANONYMOUS

Regarding whitespace, can I assume the following? - Whitespace can only appear at the beginning of a line if it is a tab under a function definition - Whitespace must appear between words in print expression , return expression , and function identi...


SVG not supported 12:48pm Mon 26th Aug, Chenjun H.

Hi, Just had a few questions about the assignment. First, what should happen if divide by zero occurs, are we expected to do static analysis at compile time, throw an error at run time, or is it UB? Second, in example 5 a function call is done using ...


SVG not supported 11:31am Mon 26th Aug, Christopher M.

ANONYMOUS wrote There are now many simple examples on the project's main page.


SVG not supported 11:26am Mon 26th Aug, Christopher M.

There are now many simple examples on the project's main page.


SVG not supported 10:38am Mon 26th Aug, ANONYMOUS

Hi, I was wondering if any examples of programs written with the .ml format will be available later? This would aid in understanding and translating the language.


SVG not supported 4:49am Mon 26th Aug, Christopher M.

The 1st project description is now finalised. Please post requests for clarification about any aspect of the project to help2002 so that all students may remain equally informed. Significant clarifications and corrections will be also added to the proj...


SVG not supported 4:22am Mon 26th Aug, Christopher M.

Very sorry, but I'm going to reverse my decision on this point (to make it easier for all to implement) All statements and function prototypes (1st line) must begin at the left-hand-margin (column 1). The statements forming a function's body must ...


SVG not supported 4:13am Mon 26th Aug, Christopher M.

ANONYMOUS wrote Yes, BUFSIZ (8192 on Linux, 1024 on macOS) is a suitable choice for your maximum line length. You should write your own test programs, and not rely on a finite number of sample cases. There will be a webpage to which you can enter your ...


 UWA week 34 (2nd semester, week 5) ↓
SVG not supported 3:42pm Sun 25th Aug, ANONYMOUS

Hi, I was wondering roughly what size input we should expect to process in the text files; would it be appropriate to use BUFSIZ in fgets as shown below? (example from lecture 7) FILE dict; char line BUFSIZ ; dict fopen( ..... ); while...


SVG not supported 5:04am Sun 25th Aug, Christopher M.

Hello, The project specification is not quite finished, yet, but ... The language's syntax does not permit nested functions https teaching.csse.uwa.edu.au units CITS2002 projects project1-syntax.php Functions are introduced with the 'function' keywor...


SVG not supported 1:46am Sun 25th Aug, Yuxuan Y.

Hi, Professor. I have some questions about project 1. Should we consider about nested function and higher-order function? function create multiplier factor function multiplier x return x factor return multiplier double - create multiplier(2) print ...


SVG not supported 11:40am Fri 23rd Aug, Harsh C.

Thanks for that Will look have a look at it.


SVG not supported 8:13am Fri 23rd Aug, Christopher M.

Early details here https teaching.csse.uwa.edu.au units CITS2002 projects project1.php which I hope to complete today.


SVG not supported 4:40pm Thu 22nd Aug, Christopher M.

No, it has not been released yet. My current focus is tomorrow's mid-sem test. When it's released, it will be announced linked in all the usual, obvious, places.


SVG not supported 4:13pm Thu 22nd Aug, Harsh C.

Hello, Has the first project been released yet? If so, can someone please provide a link? I can't seem to find it. Cheers

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