ianagbip1oti / ProC

Hawt new programming language
MIT License
4 stars 0 forks source link

Functions #27

Open ianagbip1oti opened 6 years ago

ianagbip1oti commented 6 years ago
fun int myAwesomeFunction(int p1, str p2) {
  // statements

  return 37;
}
ianagbip1oti commented 6 years ago

28 should be done first

initializesahib commented 6 years ago

see #40

ianagbip1oti commented 6 years ago

I have been toying with the idea of keeping all keywords to 3 characters, hence the abbreviations (int, str, bln, whl).

fnc is maybe an option for functions? rtn for return?

Or I just can abandon the 3 character keyword idea.

int a = 3;
int b = 2;
str answerIs = "The answer is: "

fnc int add(int x, int y) {
  rtn x + y;
}

prt(answerIs ++ add(a, b));
ianagbip1oti commented 6 years ago

Have a look through #25, #26, #34, #35, #36 at the examples I have on there. If the 3 character thing isn't working, let me know what works for you 👍

initializesahib commented 6 years ago

it actually seems pretty nice, 👍