On Mon, 9 Feb 2004, Melvin Smith wrote: > At 02:00 PM 2/9/2004 -0500, Michal Wallace wrote: > >On Mon, 9 Feb 2004, Melvin Smith wrote: > > > My take on it is, since it is an intermediate language, we don't need > > > ability to have keywords as variables. Compilers can generate all > > > variables with names like $T01JHGJ_001 > > > >That can make it kind of nasty to debug > >compilers. I'm trying to move pirate towards > >generating names that match the actual > >variables (though I do still use _000 counters) > > Which can make it nasty, not having keywords as variables or > naming them weird things? I assume you meant the latter, I agree, > and my example was probably overexaggerated. You could simply > mangle the high-level symbol name so if your language allows you > to use 'if' as a variable, do $_if. Take your pick of the thousands > of possibilities.
Yes, I meant the latter. :) > I will at least commit a patch so IMCC will immediately flag the > declaration of an illegal symbol name rather than allowing it and > then getting confused later. Good idea. > >Would it be valuable if all variables had (or could have) > >a $ in front of them? The ones that match /\$[PINS]\d+/ > >would still have implicit types, and anything else > >would require a .local or .global for the type > >declaration. > > I know how I want to answer the question, but I'd be lying if > I said I had actually put a lot of thought in it. Any solution > can be made to work: I was just throwing that out there by the way. I haven't thought much about it either. :) I'm perfectly happy with things the way they are, but requiring the $ gets rid of the keyword problem. > Possibilities: > > 1) Mangling scheme - potential issues with various languages as well > as potential issues with importing external symbols unless we all agree > on the same scheme. You know this brings up another point for hierarchical namespaces. Python would freak out if it saw an expression like "perl.object.if". But it'll cope with getattr(perl.object, "if")... There probably ought to be a standard API for grabbing objects across namespaces that goes beyond just simple syntax. (Like parrot.find("perl::object::if") or something) > 2) Quoting symbol names - pretty much works in all cases but is a > little annoying for hand written code > > I'll think more on the issues before giving an opinion since I'm > sure there are some people that have already thought on it more than > me; Larry, for instance. :) Sincerely, Michal J Wallace Sabren Enterprises, Inc. ------------------------------------- contact: [EMAIL PROTECTED] hosting: http://www.cornerhost.com/ my site: http://www.withoutane.com/ -------------------------------------