New syntax

Started by UpperKEES, February 07, 2013, 10:15:44 AM

Previous topic - Next topic

UpperKEES

I know the the old scripts are 100% compatible with the new (optional) syntax, but I assume the code examples will be published for the main audience using parenthesis for better readability and understanding?

I guess Grauniad will have something to convert.... (just kidding; inside joke! ;D)
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

knucracker

Yeah, most of the more complex examples should probably use warp syntax in a clean way.  That said, I think that at least the early examples in the primer should still be in pure RPL so as to teach the concept of the stack.

I'm well aware that a novice who looks only at warp syntax will conclude that everything looks like a function call and everything in the parentheses are arguments to those functions. That's a fine way to think about it, but the primer still needs to cover the fundamentals of RPL, the stack, and that use of parentheses are totally optional.  Without this foundational understanding a novice won't understand why if they get the number of arguments 'wrong' to a function there is no compiler error.

For instance:

This is correct and compiles:
GetCreeper(CurrentX CurrentY)

This is incorrect and compiles:
GetCreeper(CurrentX)

So is this:
GetCreeper(14 CurrentX CurrentY)

This is correct, compiles, but isn't in good form:
CurrentX GetCreeper(CurrentY)


So, I think it will be important for the examples to use good style in the use of the warp operator... that's paramount.  But it is also important that the primer and some early examples make it very clear this is a RPL stack based language inside and out... and the compiler isn't going to do function signature validation.

As for the conversion of the more verbose examples... I can do it.  I won't push that on anyone :)


UpperKEES

Quote from: virgilw on February 07, 2013, 10:36:22 AM
As for the conversion of the more verbose examples... I can do it.  I won't push that on anyone :)

Please don't. I'm sure some enthusiasts will do this voluntarily. I may do some of it later, but I'm not making promises. You better focus on the game itself; there's enough to be added/improved.
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

Grauniad

Quote from: virgilw on February 07, 2013, 10:36:22 AM

As for the conversion of the more verbose examples... I can do it.  I won't push that on anyone :)


Since the examples are there already, perhaps  just add the same example in Postfix notation? Would aid in comparing and understanding.

I'll try my hand at one or two... But not today.
A goodnight to all and to all a good night - Goodnight Moon