Path: utzoo!attcan!uunet!lll-winken!ames!purdue!tut.cis.ohio-state.edu!ucbvax!agate!violet.berkeley.edu!ephram From: ephram@violet.berkeley.edu Newsgroups: comp.sys.ibm.pc Subject: Turbo Pascal bug? or feature? Message-ID: <24349@agate.BERKELEY.EDU> Date: 12 May 89 13:33:56 GMT Sender: usenet@agate.BERKELEY.EDU Reply-To: ephram@violet.berkeley.edu () Organization: University of California, Berkeley Lines: 75 Here is what I consider a minor bug with turbo pascal (V.5.0 maybe 4 others untested). It has to do with comments. The basic problem is with nesting comments of the same "type", ie { or (*. The code that follows illustrates some of my gripe. This is legal in TP5 begin {{ } end. This is illegal in TP5 begin {{ }} end. This is legal in TP5 begin { (* } end. This is illegal in TP5 begin { (* } *) } end. And, Finally this is illegal in TP5 begin { }} end. My point is that there is a lot of inconsistancy in levels of parenthesization (sp?). It crops up in code every once in a while and can be hard as h*ll to find. if you forget to close your comment then whole sections of code can be commented out (usually easy to find :-). Worse yet if you have succesive lines with comments one line can be commented out and not be easy to notice at all. begin writeln ('this program inc''s I and prints it out'); { emit stupid message} while false do begin {loop forever inc (i); {do the increment} writeln (i); {and print it out} end; end. This will print whatever "i" was forever. If that "inc i" step was a Procedure that called other Procedures etc. You would wonder "what is wrong with my procedure's?" and be off on a wild goose chase. My basic point is that I think that TP should check parenthetical levels at least for the illegal case of {{ }. I suppose that the structure of the parenthesis would then cause the { char to never be use inside of a comment but the } char can never be used as such anyway. What do other people think? is this a bg or a feature to be able to block out multiple sections of code with only changing some of the {'s? { procedure_1; { prodecure_2; {Procedure_3; } is afterall a legal construct. We must prevent those commies from compromising the integrity of our precious bodily fluids. -Gen. Jack D. Ripper Ephram Cohen ephram@violet.berkeley.edu 466 44th St. #1 3210 Tolman Hall Oakland, CA 94609 Berkeley, CA 94720