Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Summit, VFP, Disclosure, Musings
Message
From
05/12/2001 01:15:33
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00588784
Message ID:
00589660
Views:
26
>Hi Doug..
>
>I stopped to make a cup of tea while contemplating a response to your post...
>
>The lack of macro substitution is oft viewed as the achilles heel of .Net as far as a VFP developer is concerned. .Net does not have macro substitution. This is a fact that I cannot quibble with. Notwithstanding that fact, I will press on..
>
>Macro expansion (ME) has always held a peculiar place. On one hand, folks have wanted Fox to be compiled. On the other hand, folks have come to rely on ME. Of course, the two represent mutually exclusive ideals. As for myself, I rarely use the & operator. In my experience, the most oft scenario macro exp. is used is in the construction of dynamic sql statements. The second most used scenario relates to xbase constructs like Replace, Select, etc... The third most relates to dynamic referencing of objects.

I have omitted the rest of the quote because I agree with it. I have two points here, which I think need more debate, regarding the macro expansion and eval().

One thing where we quite often use macro expansion is when we want to make something data driven. It can be a menu, a list of objects which should appear, or an object factory with the names of the classes to be instantiated stored in a table. You name it - many Foxers are using these things. The mere ability to make things data driven was a good way to get things more easily maintainable, apps more flexible, and life easier in general.

The other thing is the bunch of places where VFP uses eval() internally, i.e. not using a pointer to an object but using a string to store something. Two examples come to mind: all the DynamicThisOrThat properties of a column in a grid - these things are evaluated - and the RemoveObject method, which doesn't use an object reference, it uses the name.

Having left the compiled world long before OOP came about, I really can't figure how these things are done in a compiled language, or in a language which doesn't have an eval() function. I figure that it must use some table of published names (as COM does, specially DCOM - otherwise no scripts could instantiate objects and call their methods, not having pointers to them), but it probably has its limitations. I really have very faint ideas of how it could be done, and none whatsoever of how it is done. If it is done.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform