Re: symbol resolution (was:EuCOM : Attn Matt : String Return Value)
- Posted by Matt Lewis <matthewwalkerlewis at g?ail.com> Oct 15, 2007
- 844 views
Pete Lomax wrote: > > Matt Lewis wrote: > > > > CChris wrote: > > > I don't see that your solution helps much there > > > > Also, your solution seems to me to be overly complex > > While I find this topic fascinating, I think we can conclude that you two > disagree > It is time (imho) to focus on a (beta) release and move away from theoretical > bantering > to swapping actual code samples that show the advantages/shortfalls of the new > features, > before attempting to add any more, that is. Email me if you want any help, > proof reading, > etc. In fact, my code is posted. The trunk actually functions just as I've been describing, except that it doesn't emit the warnings. That's in my branch. You don't actually need svn installed to get the code. If you go to the sf project page, you can "Browse SVN" and download the files individually. It's actually easier to just install svn, but you still have that option. And I have test code posted on the sf project wiki. > BTW, I've still had zero entries to my data hiding challenge, nor has > anyone set a better one: > http://palacebuilders.pwp.blueyonder.co.uk/dhc.htm I think I never really looked at it. Looking at it now, I think I disagree with some of the premises. I briefly described to CChris what I thought was a reasonably simple way to encapsulate. The only change would be to change from "include" to "import." I'm aware that this keyword has been discussed before, though I'm not certain if it had the same intention as I've described. Importing would work just like including, except that files that included you couldn't see the files that you imported:
-- myapp.exw include myapp.ew -- myapp.ew import win32lib.ew main = create(...) -- error!
I'm wondering about the justification for this requirement: "z2 is visible in f2 and f5 but nowhere else" Other files include f2, but apparently only want to see certain symbols from f2 (the file where z2 is declared). While I think that your system is interesting, I'm not convinced that it's solving a real problem. If a library writer wants to limit what his library exposes, then all he needs to do is to either declare those symbols as locals, or, if they must be seen by other files in the library, then he just needs to import the appropriate files within the library. This way, the library user will never know about all of those other symbols. I guess we probably need to declare what problem we're solving. My idea is that we want to be able to use symbols across files, but to have a 'firewall' to limit their visibility to users of those files. One reason that I like this scheme is that it requires very little be done to get this effect, and it's done in a very straightforward way. > Regards, > Pete > PS I'm still not keen on installing TortoiseSVN or Watcom on this box - I > already > have enough things I waste time on when more important stuff waits.. I would recommend skipping TortoiseSVN and just using the command line. Matt