Re: Store Includes
- Posted by Al Getz <Xaxo at aol.com> Jul 22, 2005
- 540 views
Hi there Quark, Yes sometimes the angle brackets are a little confusing, but i guess there has to be some way to organize the replies and return replies etc. I actually havent thought about that too much :) Yes WinClass has lots of namespace prefixed references which should be a very good test for a program that could mash a program correctly. If the program runs after the mash then i guess everything got redone correctly, and i'd really like to see this happen. I like to write programs using that library but i have a feeling most people dont like to use namespace prefixes (yet). I have a feeling WinClass mashes will result in much smaller files than 1 or 2 megs, but i guess if someone includes lots of classes it can grow larger and larger. As far as the mechanics or dealing with namespaces, cant you connect the namespace prefix to the target varname with an underscore or two? MyClass:MyFunc() becomes: MyClass__MyFunc() But i guess that only works if the user uses the same prefix in every file.. Well, i guess there's the filename possibility... include MyIncFile.ew as MyClass val=MyClass:GetValue() becomes: val=MyIncFile_MyClass_GetValue() but then that kind of muddies up the clarity of using a namespace. What about if you insist that the user ALWAYS uses the same namespace prefix with the same file (good practice anyway), which allows the above to become: val=MyClass_GetValue() which retains all the the simplicity and clarity of the original source. Ah, maybe a switch to turn this 'feature' on or off ? I find that the 'wordier' the names are the more easily the file can be read and understood, especially several months later, but i guess there's a limit to this. val=MyIncFile_MyClass_GetValue() would be stretching it a bit :) Problem is, if you leave out "MyIncFile" then you've got to insist on a correlation between filename and prefix name, and if you leave out "MyClass" you might loose some of the author's original intent...unless they happened to always do: include MyClass.ew as MyClass which i think will end up being rare. I've found that short names work out good for prefixes, such as include MyClass.ew as MC That way when you go to use the 'object' like... MC1=MC:Create() vals=MC:GetValues(MC1) the lines are shorter and the reading isnt that bad, unless you really want super clarity: include MyClass.ew as MyClass MyClass1=MyClass:Create() MyClass1Vals=MyClass:GetValues(MyClass1) Now i guess there can be a problem if in one file the user declares: include MyClass.ew as MC and in another file the user declares: include MyClass.ew as MyClass In one file the user would type: val=MC:GetValue() and in the other: val=MyClass:GetValue() This makes it look like you'd have to insist that all the files were included using the same namespace prefix (per filename). That is, the dev'r would have to decide if they wanted to use "MC" or "MyClass". Perhaps a message box to allow them to choose during run time? Just some thoughts... Take care, Al And, good luck with your Euphoria programming! My bumper sticker: "I brake for LED's"