Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!hp4nl!cwi.nl!guido From: guido@cwi.nl (Guido van Rossum) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW and Think Message-ID: <3794@charon.cwi.nl> Date: 30 Jun 91 17:04:59 GMT References: <1991Jun23.014722.20288@gn.ecn.purdue.edu> <3764@charon.cwi.nl> <1991Jun25.161605.16017@ux1.cso.uiuc.edu> <14290@goofy.Apple.COM> Sender: news@cwi.nl Lines: 52 ksand@apple.com (Kent Sandvik) writes: >In article <1991Jun25.161605.16017@ux1.cso.uiuc.edu>, dorner@pequod.cso.uiuc.edu (Steve Dorner) writes: >> >> In article <3764@charon.cwi.nl> guido@cwi.nl (Guido van Rossum) writes: >> >then the messy hacks needed to add segmentation to the code :-( >> >> Messy hacks? I dunno what's messy about: >> >> #pragma segment MySegName >> >> In fact, MPW's segmentation scheme is one of the things that I really like >> about MPW compared to THINK, since it allows you to put functions from more >> than one segment in a single source file. I don't always WANT my functions >> grouped by segment; sometimes, even often, other arrangements make more sense. >> >> Perhaps this is one of the things that has changed since Guido bought his >> copy of MPW. > >Nih!, it has not changed. Actually clever segmentation tries to group functions/methods >calling each other into the same segment (in order to avoid segment loader table entries >and segment loading), so either one has to move code between files (as in Think C), >or then to just specify pragma statements (as in MPW C). Someone please correct me if >there's a neat hack in Think C in order to avoid file structure changes just for the sake of >segmentation. Actually it has changed since I last used MPW: I had to write something like #define __SEGMENT__ MySegName but I used "messy hacks" in relation to hat you have to do if you don't want to edit your source files: split the program in libraries containing one segment each and rename the segment name when combining the libraries. My complaint against the #pragma approach is that (again this may have changed) if I don't care about segmentation I still have to edit my source, or write an incredibly complicated Makefile. In Think C I can just drag around the files between segments until they fit. I probably should point out (and this is not an apology, just a clarification!) that my view of Mac programming is somewhat unusual for the Mac crowd inhabitating this newsgroup -- I like to write portable C code and be able to use it both on UNIX and on my Mac. Anything on the Mac that gets in my way gets a bad score, especially if it's something that the compiler could do for me just as easily. (My favorite gripe against Think C is that there still is no full equivalent of the UNIX -I and -D compiler options.) --Guido van Rossum, CWI, Amsterdam "It's a bit runny, sir"