Short functions into macro ?

Everything else that doesn't fall into one of the other PB categories.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Short functions into macro ?

Post by Polo »

Hi !
I'm just wondering, would it be better if Fred, instead of keeping functions like PeekF, Abs, ... would replace them by macros, so it would speed up the code ?
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

This already the case when it is possible.

For example if you write Chr(34) in your code it will be replaced by the compiler.

But if you write Chr(myVariable) it can't be interpreted at compile time.

There are many optimisations like this made by fred's compiler.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Flype wrote:This already the case when it is possible.
Really ? I didn't knew that !
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

It should be documented 8)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

No it's not done for Peek* even though that would be possible.
Post Reply