Forum > General

Does Freepascal has everything "must have" functional features as C does

<< < (10/10)

y.ivanov:

--- Quote from: SymbolicFrank on August 16, 2022, 04:06:12 pm ---
--- Quote from: y.ivanov on August 16, 2022, 01:54:03 pm ---This is something not achievable with the Pascal case statement. It's just different.

--- End quote ---

Which is a good thing! Broken code shouldn't compile.

--- End quote ---
And why do you call it broken? Apart from the unpretty macro definitions, which can reside in a separate include file, the code looks very decent.

As a matter of fact, I'm using it on a daily basis in production code, it is simple, predictable, not clogged by synchronization primitives, etc. The big drawback is that the locals gets lost on each call and if you want to reuse a function, you must pass to it a frame pointer to the locals data (much like self).

But if you have a flat main loop with a few (co-)routines it just works.

PascalDragon:

--- Quote from: MarkMLl on August 17, 2022, 09:52:05 am ---
--- Quote from: PascalDragon on August 17, 2022, 09:22:35 am ---For the assignment operator (and maybe also other operator overloads returning a custom type) the compiler does take the left side into account, after all it wouldn't be able to pick the correct one otherwise:

--- End quote ---

Thanks for that. Are you saying that, in effect, they have started taking more notice of the left side type comparatively recently?
--- End quote ---

That should be the case since forever (aka since assignment operator overloads exist), cause otherwise assignment operators overloads make no sense and are useless.

Navigation

[0] Message Index

[*] Previous page

Go to full version