'inline' keyword in toker.cxs

PixelPaladin

New member
CX Code Contributor
3rd Party Module Dev
Joined
Aug 27, 2017
Messages
110
I am not sure if this can be called a bug but there is a keyword in toker.cxs which is called 'inline'. I think it should be removed since it has no functionality.
 

Martin

Active member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Joined
Jun 19, 2017
Messages
334
Nice find, will check it!
 

Gerry Quinn

Active member
Tutorial Author
Joined
Jun 24, 2017
Messages
153
I think it should be left in, in case inline is implemented.

Honestly, the absence of even a simple preprocessor-based inline in Monkey/Cerberus annoys me.

Say you want to use a 1D C-style array for speed in your 2D game (I do this a lot). With an inline option, GetSquare( x, y ) is transparently converted to squares[ x + y * ROWDELTA ]
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
855
Does nobody check the docs?
You will find that there are two reserved words: MODULE and INLINE.

They should be left in until something can be figured out how to implement them.
 

PixelPaladin

New member
CX Code Contributor
3rd Party Module Dev
Joined
Aug 27, 2017
Messages
110
Does nobody check the docs?
I had checked the index page, but there was no entry.
So is inline code still planned? If yes, we should keep it in.

@Gerry Quinn: For speed it is possible to use C/C++ macros and access them as extern functions. You can create extremely fast code this way. It is even possible to create Labels, Gotos and even jump tables. Of course it works only for the C++ based targets.
 
Top Bottom