9-Mar-00 23:51 you wrote:
- TViews contains only two short assembler procedures. Firstthat and ForEach. I checked both, and think I can make pascal versions, except for one thing. Before calling the procedures that are parameters of these two (firstthat and foreach), the asm routine pushes the (%ebp) (which is afaik the ebp of the caller, to access the callers variables????). I don't know how to do that in pascal, but it is only one or two assembler statements)
GPC can handle this in Pascal. This is a feature of ISO 7185 Standard Pascal which Borland left out.
Just pass a local procedure as a parameter to `ForEach', and call it from there. GPC will ensure that the local procedure can access its parent's local variables.
Won't this cause typing violation?
What to you mean ? Of course types will be checked. Look on attached program. It's CORRECT pascal's (standard pascal, not even "pascal with GPC extensions") program. If you'll change x:integer to x:real in first line it'll be not correct pascal parogram and GPC will complain. In GPC you can use not just declaration in procedure's header but also pointers to procedures/functions and such and will work just fine with embedded functions (just like in GCC).