Re: copying global stuff to one file
- Posted by Tone Škoda <tskoda at email.si> Nov 08, 2004
- 481 views
Patrick Barnes wrote: > > Well, there's a problem with that - say there's a global routine > setValue() in a library... You could write a program to find that your > program used setValue() without much trouble. Alright, so copy the > text of it out, paste it into your file, and remove the 'global'... > > Trouble is, the setValue function might call another function within > the library... or it might read or write to a global variable in the > library. Any function to do this would have to be recursive, for a > start. > > Second thing is, what about statements that a library executes? You'd > have to put them in too... I was aware of those things you mentioned. Ofcourse all the things that are needed would have to be copied, else code wouldn't even work anymore. > It's a nice idea, but very difficult to implement. You'd be better off > just copying the entire library into your code... stripping of > 'global' is not difficult. It looks it's really too difficult to bother. I was hoping there was some easy way to do it, using some existing preprocessor or something. Maybe I will copy it by hand or simply leave it as it is. > > i want to release a cool library i made which profiles code. here's an > > example output: > > Okay, are you planning to do this using the profile_time function > within registered Euphoria? No. I have already written this profile library. It simply measures how much time was spent in a block of code and how many times it was run. Ofcourse I have to put two procedures around the block of code I want to profile, a little more work than using with profile, but there are some other advantages (besides i made me a macro in msdev which automatically puts this code in, so it's not much trouble): start_profiler ("profiler name") <code> <code> <code> end_profiler ("profiler name")