![]() |
![]() |
|
home—info—lects—labs—exams—hws
—D2L—breeze (snow day)—tutor/PIs
“Syntax” is the grammatical rules that define what is a legal program. We've been writing function-calls and variable-assignments for a while, but it's also useful to see/state the general rule.
In words: “To call a function: functionName-openParen-arguments.”
Examples:
Examples:
Note that assigning to a variable does not return a value;
this means you can't use it as part of a bigger expression:
I suggest pronouncing
Note that calling a function is very different than writing a function!
1Technically, the syntax shown doesn't allow for multiple arguments.
A better definition would be:
namefunction
home—info—lects—labs—exams—hws
—D2L—breeze (snow day)—tutor/PIs
©2014, Ian Barland, Radford University Last modified 2014.Feb.17 (Mon) |
Please mail any suggestions (incl. typos, broken links) to ibarland ![]() |
![]() |