Received: from yale by MIT-MC.ARPA 20 Nov 85 06:53:40 EST Received: by Yale-Bulldog.YALE.ARPA; 19 Nov 85 23:47:19 EST (Tue) Date: 19 Nov 85 23:47:19 EST (Tue) From: Message-Id: <8511200447.AA14657@Yale-Bulldog.YALE.ARPA> Subject: PP'ing interpreted OBJECTs... To: t-discussion@YALE.ARPA PP does something strange with OBJECTs, as illustrated by the following transcript. Am I doing the right thing? How do I get a non-compiled OBJECT to PP correctly? > (define foo (object (lambda () 'value-of-foo) ((identification self) 'foo) ((print self stream) (format stream "#{FOO}")))) [Defining FOO] #{FOO} > (pp foo) ** Error: operation not handled (COMPILED-CODE-SOURCE ()) >> *** EOF *** ;; Adding a PRETTY-PRINT method doesn't help. ;; ------------------------------------------ > (define foo (object (lambda () 'value-of-foo) ((identification self) 'foo) ((print self stream) (format stream "#{FOO}")) ((pretty-print self stream) (format stream "#{FOO}")))) [Redefining FOO] #{FOO} > (pp foo) ** Error: operation not handled (COMPILED-CODE-SOURCE ()) >> (procedure? foo) T It seems to me that T thinks FOO is a procedure and so tries to do a WHERE-DEFINED on it when I try to PP it. Shouldn't PP first look for a PRETTY-PRINT method, or at least be smart enough not to look for the WHERE-DEFINED of a interpreted object? Or did I do something wrong? -- Ashwin. -------  Received: from CSNET-RELAY.ARPA by MIT-MC.ARPA 20 Nov 85 11:04:42 EST Received: from brown by csnet-relay.csnet id ab12205; 20 Nov 85 10:54 EST Received: from with MMDF via PhoneNet by Brown.CSnet; 19 Nov 85 22:51-EDT Message-Id: <8511200350.AA06351@mailhost.CS.Brown.CSNet> Date: 19 Nov 85 (Tue) 22:50:43 EST From: Keiji Kanazawa To: t-discussion@mit-mc.arpa Subject: suspend T What modifications do I need to make to T2.27 to enable it to suspend on sr9 (DOMAIN/IX) Apollos? Do I bother?  Received: from yale by MIT-MC.ARPA 20 Nov 85 12:19:20 EST Received: by Yale-Bulldog.YALE.ARPA; 20 Nov 85 10:50:28 EST (Wed) Date: 20 Nov 85 10:50:28 EST (Wed) From: Message-Id: <8511201550.AA02556@Yale-Bulldog.YALE.ARPA> Subject: re: PP'ing interpreted OBJECTs... To: ram@YALE.ARPA Cc: t-discussion@YALE.ARPA That looks like a bug to me, but there is something you can do if you are willing to sacrifice some of the functionality of OBJECTs. The problem seems to be coming from the fact that T thinks objects that are callable (ie that have a procedure associated with them) are procedures, not objects. If you make your objects uncallable, they pretty-print, so: > (define foo1 (object () ((pretty-print self str) (format str "#{Foo1}")))) #{Object 159} > (pp foo1) #{Foo1} > ;; Notice that uncallable objects print as #{Object x} and that callable ones print ;; as #{Procedure y} > (define foo2 (object (lambda () 'value-of-foo) ((pretty-print self str) (format str "#{Foo2}")))) #{Procedure 158} > (pp baz1) ** Error: operation not handled (COMPILED-CODE-SOURCE ()) >> *** EOF *** Unfortunately, operations also have the same pretty-printing problem. *sigh* Larry -------  Received: from yale by MIT-MC.ARPA 20 Nov 85 13:03:45 EST Received: by Yale-Bulldog.YALE.ARPA; 20 Nov 85 12:39:08 EST (Wed) Date: 20 Nov 85 12:39:08 EST (Wed) From: Message-Id: <8511201739.AA00562@Yale-Bulldog.YALE.ARPA> Subject: Re: #T, self-evaluation, and NULL-LIST =? FALSE. To: jar@mit-mc Cc: t-discussion@YALE.ARPA In-Reply-To: Jonathan A Rees , Tue, 19 Nov 85 14:59:54 EST In T, #T and #F are external syntax for true and false *objects*, not *expressions*. #T and #F are not themselves supposed to be evaluable expressions. Evaluable expressions which give true and false values are T and NIL, or, if you prefer, (TRUE) and (FALSE). However, note the following behavior: > (eq? (true) '#T) () What then is the purpose of #T (or equivalently the *TRUE-OBJECT*)? I realize the difference between #T and (TRUE), but I guess I was trying to say that I didn't see the need for #T, given that we have (TRUE) (or T, if you prefer). It just seemed like unnecessary syntax (shudder!) to me. In the long run I think the right thing to do is to somehow make the way that boolean and other objects evaluate (macroexpand) be a property of the syntax table... Again, why do we need syntax for booleans when we have T, NIL, (TRUE) and (FALSE)? ... (it's bad enough that numbers self-evaluate; where does one draw the line?)... I disagree. The value of 34 is 34, not ERROR. ... (It would have helped if we had distinguished #F from () back in 1981 when we had a chance.) We all use the fact that the null list and the false object are the same while programming. This isn't due to any theoretical confusion (any more than making use of (CAR '()) => () is); it just happens to be convenient sugar for something that occurs very often. The sugar helps in avoiding code clutter which would otherwise result from type checking all over the place. In addition, I think this also helps in defining the semantics of some functions, such as ASS. Now we can simply say that ASS returns a pair (which may be NIL if the key isn't in the A-list) without worrying about whether "not being in the A-list" means returning a NULL pair or the boolean FALSE. Of course, the user can always hand the result of ASS to (COND ((NULL? result) -not-found-) (ELSE -use-pair-)), but then this gets us back to the code clutter point. -- Ashwin. -------  Received: from yale by MIT-MC.ARPA 20 Nov 85 15:43:18 EST Received: by Yale-Bulldog.YALE.ARPA; 20 Nov 85 15:32:14 EST (Wed) Date: 20 Nov 85 15:32:14 EST (Wed) From: Message-Id: <8511202032.AA02418@Yale-Bulldog.YALE.ARPA> Subject: Re: #T, self-evaluation, and NULL-LIST =? FALSE. To: In-Reply-To: , 20 Nov 85 12:39:08 EST (Wed) Cc: T-discussion@YALE.ARPA In T, #T and #F are external syntax for true and false *objects*, not *expressions*. #T and #F are not themselves supposed to be evaluable expressions. Evaluable expressions which give true and false values are T and NIL, or, if you prefer, (TRUE) and (FALSE). However, note the following behavior: > (eq? (true) '#T) () What then is the purpose of #T (or equivalently the *TRUE-OBJECT*)? I realize the difference between #T and (TRUE), but I guess I was trying to say that I didn't see the need for #T, given that we have (TRUE) (or T, if you prefer). It just seemed like unnecessary syntax (shudder!) to me. The point is #T cannot be shadowed. Since TRUE is just an identifier it is not guaranteed to evaluate to the same thing in all environments. The manaul says that (TRUE) returns some true object not the cononical true object. In the long run I think the right thing to do is to somehow make the way that boolean and other objects evaluate (macroexpand) be a property of the syntax table... Again, why do we need syntax for booleans when we have T, NIL, (TRUE) and (FALSE)? No. T, NIL, TRUE, and FALSE are identifiers bound in the standard environment, and thus they can be shadowed. #T and #F are read syntax and are guaranteed to read as the canonical true and false objects in any environment using the standard read table. ... (it's bad enough that numbers self-evaluate; where does one draw the line?)... I disagree. The value of 34 is 34, not ERROR. No again. Your confusing the identifier represented by the character sequence "34" and the number 34. Maybe Jonathan can expand on this. ... (It would have helped if we had distinguished #F from () back in 1981 when we had a chance.) We all use the fact that the null list and the false object are the same while programming. ... The sugar helps in avoiding code clutter which would otherwise result from type checking all over the place. You shouldn't be. The null list and the false object are not semantically the same and for example the compiler could detect certain errors that it now can't if this difference were supported in the language. I don't see how making #F different from () causes code clutter, could you explain? - Jim  Date: Wed, 20 Nov 85 16:01:48 EST From: Jonathan A Rees Subject: #T, self-evaluation, and NULL-LIST =? FALSE. To: Ram@YALE.ARPA cc: T-DISCUSSION@MIT-MC.ARPA In-reply-to: Msg of 20 Nov 85 12:39:08 EST (Wed) from Message-ID: <[MIT-MC.ARPA].725680.851120.JAR> Date: 20 Nov 85 12:39:08 EST (Wed) From: However, note the following behavior: > (eq? (true) '#T) () This is consistent with the message I sent out; the value of T is only guaranteed to be true. It's not guaranteed to be any particular true object, and programs shouldn't ever depend on any aspect of its value, other than its trueness. It just happens in version 2.8, the variable T evaluates to the symbol T. In 2.9 it evaluates to something else. What then is the purpose of #T? I realize the difference between #T and (TRUE), but I guess I was trying to say that I didn't see the need for #T, given that we have (TRUE) (or T, if you prefer). It just seemed like unnecessary syntax (shudder!) to me. The purpose of the syntax #T is to give a way to write a true boolean value as a component of a composite literal datum. It's basically documentary: it gives a way to say that some part of a datum should be true, but it prevents someone reading the code from imagining that there's something important about the value used other than its trueness. E.g.: one might write (define (dark? color) (cond ((assq color '((brown . #t) (black . #t) (white . #f) (yellow . #f))) => cdr) (else (error "unknown color")))) If "t" is used instead of "#t", the code works the same, but using "#t" makes it just a little clearer what's going on. ... (it's bad enough that numbers self-evaluate; where does one draw the line?)... I disagree. The value of 34 is 34, not ERROR. Disagreement is fine. I agree that it's convenient to be able to write '34 instead of 34. I just wanted to point out that something strange is going on when things "self-evaluate," since it's not the case e.g. that (CONS X Y) evaluates to the list (CONS X Y). Applying Occam's razor here would dictate that the extra feature of self-evaluation for certain expressions is unnecessary, so the extra complication should be eliminated. Since T has this feature, the design of T is not consistent with Occam's razor. ... (It would have helped if we had distinguished #F from () back in 1981 when we had a chance.) We all use the fact that the null list and the false object are the same while programming. This isn't due to any theoretical confusion (any more than making use of (CAR '()) => () is); it just happens to be convenient sugar for something that occurs very often. ... It would also be convenient to define (1 V) to mean the same thing as (VREF V 1); that would avoid code clutter. There are some languages in which nearly all programs are correct. This makes for very concise code, and simplifies implementations since no error system or debugging facilities are needed. Having the domains boolean and list intersect is as theoretically confused as (CAR '()) => (), namely very. You have to go to great lengths in the documentation, implementation, and formal semantics to cause these things to happen. It certainly is well-defined (and you could therefore say it's not confused), but it's not elegant. I suppose it's a matter of taste. When you design a language you decide what the domains of various primitives should be, and what coercions are allowable when. In Snobol4 you can write "2" + "2" and get 4; in Algol68 you can write "2" + "2" and get "22". These are two of my favorite languages, and both have many excellent features which avoid code clutter. But these days I prefer disjoint domains, even if increased code clutter results. In particular, I think boolean, list, symbol, and number should all be disjoint domains. Simplifications like this make programs easier to understand and debug, and streamlines both the description and the implementation of the language.  Date: Wed, 20 Nov 85 16:09:13 EST From: Jonathan A Rees Subject: suspend T To: kgk%brown.csnet@CSNET-RELAY.ARPA cc: T-DISCUSSION@MIT-MC.ARPA In-reply-to: Msg of 19 Nov 85 (Tue) 22:50:43 EST from Keiji Kanazawa Message-ID: <[MIT-MC.ARPA].725684.851120.JAR> Date: 19 Nov 85 (Tue) 22:50:43 EST From: Keiji Kanazawa What modifications do I need to make to T2.27 to enable it to suspend on sr9 (DOMAIN/IX) Apollos? Do I bother? Sorry, no way. I think some kind of suspend for Aegis T may be in the works for a future release.  Date: Wed, 20 Nov 85 16:16:14 EST From: Jonathan A Rees Subject: PP'ing interpreted OBJECTs... To: Ram@YALE.ARPA cc: T-DISCUSSION@MIT-MC.ARPA In-reply-to: Msg of 19 Nov 85 23:47:19 EST (Tue) from Message-ID: <[MIT-MC.ARPA].725702.851120.JAR> Date: 19 Nov 85 23:47:19 EST (Tue) From: PP does something strange with OBJECTs, as illustrated by the following transcript. Am I doing the right thing? How do I get a non-compiled OBJECT to PP correctly? ** Error: operation not handled (COMPILED-CODE-SOURCE ()) >> *** EOF *** This is definitely a T bug, and ought to be fixed. Public service announcement: Remember, T development is a labor of love - I may be wrong about this, but I was under the impression that no one was getting paid to do it. Bugs like this are pretty easy track down (in this case, some piece of code is failing to check that for false before calling COMPILED-CODE-SOURCE, or something like that - use GREP or BACKTRACE to find the places where it's called, etc.), and the T sources are readily available, at Yale at least. Any help from users on actual bug fixes is appreciated, and leaves time for Jim & David & Richard to do more interesting things (like making suspend work on Aegis). If I remember your particular situation, you probably want to be handling the DISCLOSE operation anyhow, not PRINT or PRETTY-PRINT.  Received: from yale by MIT-MC.ARPA 21 Nov 85 10:51:47 EST Received: by Yale-Bulldog.YALE.ARPA; 21 Nov 85 10:06:04 EST (Thu) Date: 21 Nov 85 10:06:04 EST (Thu) From: Message-Id: <8511211506.AA14333@Yale-Bulldog.YALE.ARPA> Subject: Re: #T, self-evaluation, and NULL-LIST =? FALSE. To: t-discussion@YALE.ARPA In-Reply-To: Jonathan A Rees , Wed, 20 Nov 85 16:01:48 EST ... But these days I prefer disjoint domains, even if increased code clutter results. In particular, I think boolean, list, symbol, and number should all be disjoint domains. Simplifications like this make programs easier to understand and debug, and streamlines both the description and the implementation of the language. Whereas intersecting domains can lead to programs that are easier to write (the only item not on your list). APL hackers often use the fact that true and false are 1 and 0, respectively. For example, the APL 1-line prime-finder can count divisors just by summing the result of testing for zero remainders (summing-- not counting!). Code like this is indeed tricky to explain and defend, but it is also very easy to write and reconstruct. In the hacking days of my youth, I made use of any overlap in functionality I could find. (I even found some nice uses for the fact that UCI Lisp atoms were really lists with a special header!) These days, when most of the code I write is for tutorial or systems-type purposes, I too prefer the purer approach to language design, as exemplified by T. I'd like to think that I've seen the light, but it may just be a change in what I have to do. -------  Received: from yale by MIT-MC.ARPA 22 Nov 85 15:43:18 EST Received: by Yale-Bulldog.YALE.ARPA; 22 Nov 85 15:11:13 EST (Fri) Message-Id: <8511222011.AA01704@Yale-Bulldog.YALE.ARPA> Received: from YALE-RING by YALE-RES via CHAOS; Mon, 18 Nov 85 14:28:43 EST Subject: Bug in CHAR-NAME: A clue! Date: Mon, 18 Nov 85 14:28:45 EST From: Ashwin Ram To: T-Discussion@YALE.ARPA In-Reply-To: , 16 Nov 85 21:58:27 EST (Sat) CHAR-NAME RASSQ's down an internal table to look up a character's name. It turns out that if I reDEFINE RASS in *T-IMPLEMENTATION-ENV* with the exact code (from TSYS/LIST2.T) that it originally was anyway, CHAR-NAME now works fine. Curiouser and curiouser... Ashwin. -------  Received: from yale by MIT-MC.ARPA 6 Dec 85 15:29:22 EST Received: by Yale-Bulldog.YALE.ARPA; 6 Dec 85 15:13:04 EST (Fri) Date: 6 Dec 85 15:13:04 EST (Fri) From: Message-Id: <8512062013.AA06630@Yale-Bulldog.YALE.ARPA> Subject: REQUIRE and friends To: T-Discussion@YALE.ARPA [I realize that REQUIRE isn't released.] While trying to load T3 into ALFL, I got the following error message: ** Error: illegal to create new bindings in this environment (ENV-LOOKUP ... %LOOP:EXPAND-MACRO #t #t) This is apparently because I used REQUIRE within a BIND form - thus not at top level. Why can't I use REQUIRE at any other than top level??? Perhaps REQUIRE should take an optional environment parameter??? Should I just use *REQUIRE instead? Sigh. --- Jonathan -------  Date: Fri, 6 Dec 85 17:19:11 EST From: Jonathan A Rees Subject: REQUIRE and friends To: young@YALE.ARPA cc: T-DISCUSSION@MIT-MC.ARPA In-reply-to: Msg of 6 Dec 85 15:13:04 EST (Fri) from Message-ID: <[MIT-MC.ARPA].744766.851206.JAR> Date: 6 Dec 85 15:13:04 EST (Fri) From: [I realize that REQUIRE isn't released.] While trying to load T3 into ALFL, ... Wow! I want that version of ALFL. I got the following error message: ** Error: illegal to create new bindings in this environment (ENV-LOOKUP ... %LOOP:EXPAND-MACRO #t #t) This is apparently because I used REQUIRE within a BIND form - thus not at top level. Why can't I use REQUIRE at any other than top level? One day I was making some changes to the implementation of environments and felt like removing various random features like this. I think I justified this by saying I didn't want people trying to imagine that T's DEFINE worked like MIT Scheme's DEFINE, and in fact I wanted to leave open the option of changing this at some point, so I added some error checks to *DEFINE as a first step towards liberation. I think there were other considerations, but I can't recall now. This particular error can't possibly happen unless somehow you have your hands on one of T's "immutable environments," which you can't get unless you're running in a debugger B breakpoint or you're using undocumented things like REQUIRE and THE-ENVIRONMENT. Perhaps REQUIRE should take an optional environment parameter? REQUIRE isn't released because I never convinced myself it was a reasonable thing to have. It was inspired by the USING/ENVIRON feature of Cambridge Algol68, which has the semantics (although not the implementation) of textual inclusion. REQUIRE also happened to have the additional feature of demand loading of a named modules (this is what Common Lisp's REQUIRE was, later). Actually these are two (or three) different features which should have been implemented orthogonally; *REQUIRE sort of does the load-on-demand part. But I never got around to working on it. Part of it was that I could never figure out a good operating-system- and site-independent way to name modules. You would like to write modules which use and demand-load each other, but not have to change your source code when going from one machine to another. You would like each program to potentially have its own space of module names, to avoid collisions. (Common Lisp really lost on this count; the space of module (and package) names is flat.) *REQUIRE and LOAD maintain an environment-specific list of loaded modules, but I don't think that's quite the right thing. So eventually only the lower-level LOAD got put into the manual, and rather than document REQUIRE or *REQUIRE, we just waited hoping that once locales really worked, a good proposal for a module system would fall into our laps. It never did. John Lamping worked on one during summer of '84, but than I stopped doing T development, and I don't think anyone else has picked up on it. Should I just use *REQUIRE instead? Do whatever you want. *REQUIRE probably won't go away until there's a better way to deal with demand loading. Why don't you design & propose a module system for T? At the very least we could argue about the problem better if there was something solid to critique. All the basic mechanism is there: environment creation and access, loading files into mutable environments, tables, and so on, so there's plenty of opportunity for experimentation. You clearly don't want LOOP to be loaded into the same environment that your program is running in; but then somehow the system has to decide what environment LOOP should be loaded into, how to let it provide things for export, how to get the things it exports, and so on. There's a modest amount of engineering required. T's mutable environments are very general, and it's just a matter of deciding on a discipline for their use. Some protocol must be adopted as standard if we're going to have an environment where users can share software with each other.  Received: from yale by MIT-MC.ARPA 12 Dec 85 20:59:34 EST Received: by Yale-Bulldog.YALE.ARPA; 12 Dec 85 20:03:13 EST (Thu) From: Return-Path: Received: by sdcsvax.ARPA (5.31/4.41) id AA10181; Tue, 10 Dec 85 23:20:16 PST hops=0 Received: by vis.uucp (2.0/3.14) id AA18268; Tue, 10 Dec 85 21:46:18 pst Message-Id: <8512110546.AA18268@vis.uucp> To: t-discussion@YALE.ARPA Subject: Any T for Sun workstations? Date: 10 Dec 85 21:46:04 PST (Tue) Does anyone know of an implementation of T for a Sun workstation? Is anyone working on such an implementation? Does anyone want to work on such a thing? I'm willing to help if an implementation is in progress. Thanks for any info you have, _Greg Davidson Virtual Infinity Systems, San Diego greg@vis.uucp ucbvax--| telesoft--| davidson@sdcsvax.uucp decvax--+--sdcsvax--+--vis davidson@ucsd.arpa ihnp4--| noscvax--|  Received: from yale by MIT-MC.ARPA 13 Dec 85 23:22:19 EST Received: by Yale-Bulldog.YALE.ARPA; 13 Dec 85 23:11:27 EST (Fri) Message-Id: <8512140411.AA04269@Yale-Bulldog.YALE.ARPA> Return-Path: Date: 13 Dec 1985 23:14:24-EST From: Olin.Shivers@H.CS.CMU.EDU To: t-discussion@YALE.ARPA Subject: T on a Sun I believe some of the guys at the Centre Mondial Informatique et Resource Humaine in Paris were somewhat interested. There's a lot of interest in Scheme in France, it seems. -Olin  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 23 Dec 85 17:06:43 EST Received: by yale-cheops.YALE.ARPA; Mon, 23 Dec 85 17:00:51 est To: t-discussion@YALE.ARPA From: Jim Meehan Date: Mon, 23 Dec 85 16:45:06 EST Message-Id: <6600@csi-ring> Subject: Interaction between syntax-tables and environments There's been a lot of Common Lisp mail recently about the optional "environment" argument to MACROEXPAND and related functions, although environments are not very well explained in the Common Lisp manual. Of course, I think T's notion of syntax tables is much cleaner, and I was about to suggest that if they're going to make some changes, they might do well to consider something like syntax tables. But one nagging problem we've faced in T is that there *is* an interaction between macro-expanders and the environment, and it can cause trouble. Short, grotesque example: (DEFINE-SYNTAX (KAR X) `(CAR ,X)) (LET ((CAR CDR)) (KAR '(1 2 3))) => (2 3) The person who defined KAR probably wanted the expanded code to use the standard CAR, but because macros manipulate S-expressions and not values, there's nothing to prevent the environment from thwarting his intentions. Of course, you could write (DEFINE-SYNTAX (KAR X) `((*VALUE *STANDARD-ENV* 'CAR) ,X)) but then you lose in efficiency, open-compilability, etc. One way around this is to extend the rules for evaluation to permit the CAR of a form to be a procedure (as opposed to a symbol that is bound to a procedure). (A similar thing is currently implemented for special forms.) If this were implemented, we could write (DEFINE-SYNTAX (KAR X) `(,CAR ,X)) or, being very careful, (DEFINE-SYNTAX (KAR X) `(,(*VALUE *STANDARD-ENV* 'CAR) ,X)) and avoid the problem. This introduces other problems (e.g., external representation, compiler), but it might be workable. Comments? Other suggestions?  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 23 Dec 85 18:06:45 EST Received: by yale-cheops.YALE.ARPA; Mon, 23 Dec 85 17:59:43 est To: Jonathan A Rees From: Jim Meehan Date: Sun, 8 Dec 85 00:59:16 EST Message-Id: <6575@csi-ring> Subject: Re: REQUIRE and friends Cc: t-discussion@YALE.ARPA In-Reply-To: Your message of Fri, 6 Dec 85 17:19:11 EST ... So eventually only the lower-level LOAD got put into the manual, and rather than document REQUIRE or *REQUIRE, we just waited hoping that once locales really worked, a good proposal for a module system would fall into our laps. It never did. John Lamping worked on one during summer of '84, but than I stopped doing T development, and I don't think anyone else has picked up on it. Bill Ferguson and I designed and implemented a "module system" last year, and while it certainly doesn't solve all the world's problems, we're happy with the way it turned out. It has proved quite useful in preventing interference among various cooperating "subsystems" (e.g., graphics, Common Lisp interface, cross-compiler) that need separate read-tables, syntax-tables, and environments. In the process, we got rid of STREAM-READ-TABLE and ENV-SYNTAX-TABLE, and we introduced "workspaces" (triples consisting of a read-table, a syntax-table, and an environment). Workspaces are the coin of the realm for EVAL, LOAD, REQUIRE, HERALD, COMFILE, and various other sorts of transducers. I'd be happy to send the documentation to anyone interested.  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 23 Dec 85 18:21:09 EST Received: from yale (yale.arpa.ARPA) by yale-cheops.YALE.ARPA; Mon, 23 Dec 85 18:06:53 est Received: by Yale-Bulldog.YALE.ARPA; 23 Dec 85 17:52:33 EST (Mon) Return-Path: Date: Mon, 23 Dec 85 18:02:42 EST From: Jonathan A Rees Subject: Interaction between syntax-tables and environments To: csi!meehan@UUCP Cc: t-discussion@YALE.ARPA In-Reply-To: Msg of Mon 23 Dec 85 16:45:06 EST from Jim Meehan Message-Id: <[MC.LCS.MIT.EDU].765068.851223.JAR> Date: Mon, 23 Dec 85 16:45:06 EST From: Jim Meehan (DEFINE-SYNTAX (KAR X) `(CAR ,X)) (LET ((CAR CDR)) (KAR '(1 2 3))) => (2 3) The person who defined KAR probably wanted the expanded code to use the standard CAR, but because macros manipulate S-expressions and not values, there's nothing to prevent the environment from thwarting his intentions. Of course, you could write (DEFINE-SYNTAX (KAR X) `((*VALUE *STANDARD-ENV* 'CAR) ,X)) but then you lose in efficiency, open-compilability, etc. You don't lose if the compiler is reasonable. I think this is almost the right thing. I think future versions of the compiler will be able to compile this correctly. Of course, it just begs the question, since the user could have done (LET ((*VALUE LIST)) (KAR 3)), or bound *STANDARD-ENV*. Ultimately I think a new special form will have to be added to the language (absolute reference CAN be made to special forms); that's why *VALUE has a * in its name, just in case we decided to add a VALUE special form. (MIT Scheme has such a special form; it's called ACCESS, but takes its arguments in the opposite order.) One way around this is to extend the rules for evaluation to permit the CAR of a form to be a procedure (as opposed to a symbol that is bound to a procedure). (A similar thing is currently implemented for special forms.) If this were implemented, we could write (DEFINE-SYNTAX (KAR X) `(,CAR ,X)) You don't need to extend the syntax of combinations, you just need to extend the syntax of QUOTE: (DEFINE-SYNTAX (KAR X) `(',CAR ,X)) or, being very careful, (DEFINE-SYNTAX (KAR X) `(,(*VALUE *STANDARD-ENV* 'CAR) ,X)) There's no reason to do this; the macro expander knows perfectly what its own environment is (weel... on second thought... but let's not get into that); there's no problem with ITS binding of CAR. and avoid the problem. This introduces other problems (e.g., external representation, compiler), but it might be workable. This could be made to work for system-supplied procedures, but making it work for general user procedures would be very difficult; in the general case the system would have to invoke FTP or the international telephone or mail systems. One idea I'm considering is something resembling Internet "domain naming," which is basically a programming convention which allows one to name any object on any machine. If I can work the kinks out and if someone bothers to implement it, it may become part of some future release of T, and ultimately T may even be able to invoke FTP automatically. Your points are correct; I hope that this further illustrates to people just how intractible macros are. Don't use them if you can avoid it! The above is a terrible example; you could have written (define-integrable (kar x) (car x)) or (define-integrable kar car) without sacrificing a nanosecond of efficiency (this is one of the great features of T compilers). There are occasional cases where macros are desirable (I generally only use them for top-level forms), but this is not one.  Date: Sun, 29 Dec 85 21:02:27 EST From: Jonathan A Rees Subject: [csi!meehan%UUCP: syntax] To: T-DISCUSSION@MC.LCS.MIT.EDU Message-ID: <[MC.LCS.MIT.EDU].768311.851229.JAR> Date: Mon, 23 Dec 85 22:52:38 EST From: Jim Meehan To: Jonathan A Rees cc: csi!ferguson at UUCP Re: syntax Message-Id: <6603@csi-ring> In-Reply-To: Your message of Mon, 23 Dec 85 18:02:42 EST [Jonathan: If you think this would be interesting or appropriate for the T-DISCUSSION bboard, feel free to forward it there.] ========================================================================= ... (DEFINE-SYNTAX (KAR X) `(CAR ,X)) (LET ((CAR CDR)) (KAR '(1 2 3))) => (2 3) ... The above is a terrible example; you could have written (define-integrable (kar x) (car x)) Right. The example I should have used was this: (LET ((CAR CDR) (L '(1 2 3))) (POP L)) ========================================================================= ... I hope that this further illustrates to people just how intractible macros are. Don't use them if you can avoid it! ... There are occasional cases where macros are desirable (I generally only use them for top-level forms)... I'm puzzled. At the moment, in T 2.8, there are 13 special forms and 71 macros in the *STANDARD-SYNTAX-TABLE*. I'd put the 71 macros into 3 categories: I. Macros useful primarily at top level: DEFINE-CONSTANT DEFINE-PREDICATE DEFINE-STRUCTURE-TYPE DEFINE-SYNTAX DEFINE-INTEGRABLE DEFINE-SETTABLE-OPERATION DEFINE (also inside LET) DEFINE-OPERATION DEFINE-METHODS II. Macros useful (i.e., reasonably meaningful) anywhere: DESTRUCTURE WITH-OUTPUT-TO-STRING DESTRUCTURE* PUSH CASE XCOND WITH-OUTPUT-WIDTH-STREAM XSELECT BLOCK0 WITH-INPUT-FROM-STRING MODIFY DECREMENT MACRO-EXPANDER OR LET* SELECT COND DELAY WITH-OPEN-STREAMS INCREMENT SET ITERATE WITH-OUTPUT-TO-LIST EXCHANGE MODIFY-LOCATION BIND* POP XCASE LET* DO AND SWAP UNWIND-PROTECT III. Macros that might be [reasonably implemented as] special forms, but are useful anywhere, not just at top level: OPERATION OBJECT LOCATIVE LOCALE LET LABELS CATCH BIND IV. Other macros (mostly implementation stuff): DEFINE-INSTANCE-METHODS %DEFINE-SYNTAX IGNORE DEFINE-MACRO DECLARE-SETTER REFERENCE ^ DEFINE-STRUCTURE-SELECTOR COMMENT IGNORABLE OPERATION-DISPATCH UNTRACE **BACKQUOTE-MARKER** GC-DEFER HANDLER IMPORT SYNONYM IF-INTEGRATED REQUIRE HERALD TRACE PP While there's lots of room to argue about whether certain macros (e.g., the ones in Categories I and III) could or should be special forms, I don't know how you can avoid all 32 of the macros in Category II, and I doubt you'd recommend making them all special forms.  Date: Sun, 29 Dec 85 21:34:52 EST From: Jonathan A Rees Subject: syntax To: csi!meehan%UUCP@YALE.ARPA cc: T-DISCUSSION@MC.LCS.MIT.EDU In-reply-to: Msg of Mon 23 Dec 85 22:52:38 EST from Jim Meehan Message-ID: <[MC.LCS.MIT.EDU].768328.851229.JAR> Date: Mon, 23 Dec 85 22:52:38 EST From: Jim Meehan While there's lots of room to argue about whether certain macros (e.g., the ones in Categories I and III) could or should be special forms, I don't know how you can avoid all 32 of the macros in Category II, and I doubt you'd recommend making them all special forms. This is a good point; however, there's a very big difference between language-provided syntactic extensions like AND, OR, and LET, and the fact that user-supplied macros are desirable. Clearly the language should have a tiny set of primitive special forms (5 is about the right number, although I think a T kernel would end up having about 11), and syntactic sugar should be clearly marked as such in any reasonable manual. I'll go over your catalog anyhow, to see whether the existence of any of T's macros would argue for the desirability of user-written macros. I don't think they do. II. Macros useful (i.e., reasonably meaningful) anywhere: COND XCOND CASE XCASE SELECT XSELECT OR DELAY SET ITERATE DO AND I use these, but practically never want to invent new things like them, so I wouldn't consider it a terrible inconvenience to have the set of such things (mostly pretty fundamental control constructs) bound at language design time. MACRO-EXPANDER This is a very peculiar one which I don't understand quite what to do with. It's probably completely unnecessary. DESTRUCTURE DESTRUCTURE* BLOCK0 DECREMENT LET* INCREMENT BIND* POP PUSH I rarely use any of the above, and given my druthers would probably prefer to see them disappear from the manual & implementation. WITH-OUTPUT-WIDTH-STREAM WITH-INPUT-FROM-STRING WITH-OPEN-STREAMS WITH-OUTPUT-TO-LIST UNWIND-PROTECT WITH-OUTPUT-TO-STRING These have no right to be macros. They should be procedures which take procedure arguments, just as in MIT Scheme. MODIFY MODIFY-LOCATION EXCHANGE SWAP Locations have second-class status in T, and if things like this are to exist at all, locations should be made first-class. III. Macros that might be [reasonably implemented as] special forms, but are useful anywhere, not just at top level: OPERATION OBJECT LOCATIVE LOCALE LET LABELS CATCH BIND I don't quite understand the distinction between II and III, but again I don't see quite how users would want to extend this set. CATCH and BIND should be procedurized; OBJECT should be primitive; all the others are trivial syntactic sugar, but deal with semantically primitive concepts, not special members of an open-ended class of features. IV. Other macros (mostly implementation stuff): DEFINE-INSTANCE-METHODS %DEFINE-SYNTAX IGNORE DEFINE-MACRO DECLARE-SETTER REFERENCE ^ DEFINE-STRUCTURE-SELECTOR COMMENT IGNORABLE OPERATION-DISPATCH UNTRACE **BACKQUOTE-MARKER** GC-DEFER HANDLER IMPORT SYNONYM IF-INTEGRATED REQUIRE HERALD TRACE PP Many of these (like IF-INTEGRATED) are disappearing, and exist only due to design or implementation inadequacies; others are part of the user interface, not the language (like PP and TRACE), and should not be implemented by expressions; others are either primitive or trivial. Again, I don't see how I, or users generally, would want to write macros similar or analogous to these. If they do it probably implies a gross deficiency in the language, and has a better solution than the sledgehammer of a user macro facility. I'm not saying there shouldn't be a macro facility, or that the language shouldn't have a limited amount of syntactic sugar, but rather that I practically never see a legitimate use of a macro by anyone other than a language designer. It's good to be able to be a language designer, but it's a subtle and difficult art, and correct, orthogonal implementation is even harder than correct, orthogonal design. If people have good counterexamples to this argument, I would like to see them. Jonathan  Received: from SU-SUSHI.ARPA by MC.LCS.MIT.EDU 29 Dec 85 23:55:33 EST Date: Sun 29 Dec 85 20:49:24-PST From: Andy Freeman Subject: Re: syntax To: JAR@MIT-MC.ARPA cc: csi!meehan%UUCP@YALE.ARPA, T-DISCUSSION@MIT-MC.ARPA In-Reply-To: <[MC.LCS.MIT.EDU].768328.851229.JAR> Message-ID: <12171136460.12.ANDY@SU-SUSHI.ARPA> Jonathan Rees (JAR@MIT-MC) writes: ... I practically never see a legitimate use of a macro by anyone other than a language designer. I haven't decided how to cover macros in my Common Lisp class, but I recently abused macros. I'd like to hear about other tools that would have worked as well. I've been studying coroutine and generator implementation techniques. As part of this, I implemented Icon's control structures several ways. My source programs are READable (as in, they can be read using READ), unlike real Icon programs, but I'm lazy. I didn't want to write code to read them. (I did write code to translate from my pseudo-Icon syntax to real Icon syntax so that my test programs could be run by my implementation as well as Arizona's real Icon implementation.) I defined two macros to support this project. The first one defines procedures; its first argument is the procedure name, the second is the argument list, and the subsequent arguments are the body of the definition. The macro translated this form into a block containing several side effects to store the various translations I made. (At one time, I generated five different versions.) Compiling a source file containing procedure definitions saved the work of creating these translations. (Initially, these translations were very expensive, often taking several cpu minutes for a small test program.) The second macro I used did whatever was necessary to execute one of the translation. Some of the translations are native T code, so in these cases, the macro expands to code that includes all of the previously defined procedures. In this case, compiling a file (containing the macro) compiles the T code that implements the program. This is very important; it would be necessary even if I did write code to read Icon programs and translate them. (Yes, I could write a T source file from the translations and then compile it, but ....) One of the versions I generated used upwards continuations. T doesn't support them, but chez scheme does. Therefore, I wanted my system to run in both chez scheme and T. The common subset of these two languages doesn't allow procedure or macro definition, so I used macros to define a larger common subset. (Other differences were filled in with procedures.) The decision to use macros instead of program to read and translate the pseudo-Icon programs helped here as well; I didn't have to write common subset I/O code. This isn't the first time I (or others) have pulled this common language trick. Once I convinced Interlisp and Maclisp to use the same source. Naturally this involved lots of hoops and whistles (mapcar in the common dialect was called @mapcar), but it was workable and used for a complete version of MRS. These may not count as "good counterexamples", but macros made my work possible. -andy -------  Date: Mon, 30 Dec 85 15:48:40 EST From: Jonathan A Rees Subject: syntax To: ANDY@SU-SUSHI.ARPA cc: T-DISCUSSION@MC.LCS.MIT.EDU, csi!meehan%UUCP@YALE.ARPA In-reply-to: Msg of Sun 29 Dec 85 20:49:24-PST from Andy Freeman Message-ID: <[MC.LCS.MIT.EDU].768944.851230.JAR> Your message doesn't contradict my quoted claim: ... I practically never see a legitimate use of a macro by anyone other than a language designer. You WERE being a language designer/implementor - you were designing an embedded implementation of Icon. I also use macros when I'm playing with new languages, or trying to run code in multiple Lisp implementations. The main reason I write macros instead of file transducers is so that the embedded language fits in neatly with all the user interface tools developed for use with the native Lisp: LOAD, the read-eval-print loop, editor interfaces, and compilers. I guess I don't see this technique as a case where one extends the syntax of the underlying language; really a new language is being invented. It would be nice to have multi-lingual user interfaces, so that one needn't write macros and pollute the underlying environment just in order to make it as easy to use the new language as it is to use the old. By not writing a file transducer, you weren't just being lazy; you were being modular. I'd like to have a better programming interface to the user interface than the macro chainsaw. - Jonathan.  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 30 Dec 85 18:22:28 EST Received: from yale (yale.arpa.ARPA) by yale-cheops.YALE.ARPA; Mon, 30 Dec 85 18:13:11 est From: Received: by Yale-Bulldog.YALE.ARPA; 30 Dec 85 15:43:08 EST (Mon) Date: 30 Dec 85 15:43:08 EST (Mon) Message-Id: <8512302043.AA07896@Yale-Bulldog.YALE.ARPA> Subject: Re: Interaction between syntax-tables and environments To: Jim Meehan Cc: t-discussion@YALE.ARPA In-Reply-To: Jim Meehan , Mon, 23 Dec 85 16:45:06 EST ... But one nagging problem we've faced in T is that there *is* an interaction between macro-expanders and the environment, and it can cause trouble. Of course there is. Macros, once expanded, call procedures and use other macros. Since these are gotten to through symbols, there must be an environment in which these symbols are evaluated. Now you gotta decide whether these work as in closures, or you want to look up the values at run-time. (The former, I hope, at least for procedures; possible also for macros (see below).) (DEFINE-SYNTAX (KAR X) `(CAR ,X)) (LET ((CAR CDR)) (KAR '(1 2 3))) => (2 3) The person who defined KAR probably wanted the expanded code to use the standard CAR... This is the most common case, since we love non-dynamic binding and use it (and expect it) all the time. Why should this work for procedures but not for macros? Comments? Other suggestions? I'm not sure how easy it is to separate syntax tables and environments (and, for that matter, read tables). I liked your "workspaces" idea. I think of syntaxes as being associated with the environments in which they are defined, in fact almost as if the "value" of a symbol was a syntax, analogous to the treatment of procedures, and syntax tables were an implementational detail. The advantage of this is uniformity with the closure idea. All but the most trivial macros refer to other macros (or special forms) and to other procedures too, just like procedures do. And just like procedures are closed at definition time and run in the environment in which they were defined, I would like my macros to have the symbols they use refer to the value they have in the definition environment. One way to ensure this is to use things like (*value *standard-env* 'CADR) ;(or a special form version of *VALUE) for standard procedures, just like you use (t-syntax 'BLOCK) = (syntax-table-entry *standard-syntax-table* 'BLOCK) for standard macros in T2.9 and T3. But it gets painful to wrap a reference around every symbol in a macro definition. Just like you can have: (define (kar x) (car x)) which you can import into another environment and have it work correctly even if CAR is defined differently there, I would like to be able to do the same with: (define-syntax (kar x) `(car ,x)) For the same reason, I think making the user wrap (T-SYNTAX ...) around syntax references is a copout; if KAR refers to a macro, it should be taken from the definition environment of KAR. Syntaxes seem ugly in T because they are too much like dynamic binding. Handling them like procedures should make them a nicer genre of beast to work with. -- Ashwin. -------  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 1 Jan 86 14:21:46 EST Received: from yale (yale.arpa.ARPA) by yale-cheops.YALE.ARPA; Wed, 1 Jan 86 13:30:26 est From: Received: by Yale-Bulldog.YALE.ARPA; 1 Jan 86 13:13:48 EST (Wed) Date: 1 Jan 86 13:13:48 EST (Wed) Message-Id: <8601011813.AA00491@Yale-Bulldog.YALE.ARPA> Subject: macros To: rees@YALE.ARPA Cc: t-discussion@YALE.ARPA, hudak@YALE.ARPA Jonathan: I'm not saying there shouldn't be a macro facility, or that the language shouldn't have a limited amount of syntactic sugar, but rather that I practically never see a legitimate use of a macro by anyone other than a language designer. Of course, this begs an answer to the question: "What is a language designer?" It would be tempting for each of us to argue that the only time we use macros is when we're playing the role of language designer; it's a rather subjective concept. In fact, for a language designer, macros are a rather constrained form of syntactic extension -- one might ultimately prefer tools that allow full context-free parsing. Since such tools don't currently exist in the convenient framework of a REPL and it's associated utilities (which is what's so nice about macros), then one has to resort to source-to-source transformations (compilation!) if macros don't fill the bill. If people have good counterexamples to this argument, I would like to see them. I almost never use macros, because it's almost always the case that procedural abstraction will do the job just as well (usually better). But it seems to me that legitimate uses of macros are always tied to the desire to delay the evaluation of something. For example, one of three macros that we use in the ALFL compiler is the following very *simple* one: (define-syntax (smt ob) `(let ((done ())) (lambda () (if done done (set done ,ob)) ) ) ) SMT stands for "self-modifying-thunk" and is our way of emulating graph-reduction without the inefficiency of T's DELAY (this works because () is not a valid value in ALFL). Do you think this use is legitimate? If so, am I being a language designer? I suppose I could have used a procedure like: (define (smt delayed-ob) (let ((done ())) (lambda () (if done done (set done (delayed-ob))) ) ) ) but then I would incur the inefficiency of *two* nullary closures instead of one. -Paul  Date: Thu, 2 Jan 86 16:19:33 EST From: Jonathan A Rees Subject: macros To: hudak@YALE.ARPA cc: T-DISCUSSION@MC.LCS.MIT.EDU In-reply-to: Msg of 1 Jan 86 13:13:48 EST (Wed) from Message-ID: <[MC.LCS.MIT.EDU].771100.860102.JAR> Obviously T's DELAY and FORCE should be made more efficient.  Received: from yale by MC.LCS.MIT.EDU 28 Jan 86 13:47:54 EST Received: by Yale-Bulldog.YALE.ARPA; 28 Jan 86 06:22:59 EST (Tue) Date: 28 Jan 86 06:22:59 EST (Tue) From: Message-Id: <8601281122.AA16563@Yale-Bulldog.YALE.ARPA> Subject: Of growing code and diminishing hacks... To: t-discussion@YALE.ARPA, scheme@mit-mc.arpa A SHORT BALLAD DEDICATED TO THE GROWTH OF PROGRAMS ================================================== by Ashwin Ram This is a tale of a sorry quest To master pure code at the T guru's behest I enrolled in a class that appealing did seem For it promised to teach fine things like T3 and Scheme The first day went fine; we learned of cells And symbols and lists and functions as well Lisp I had mastered and excited was I For to master T3 my hackstincts did cry I sailed through the first week with no problems at all And I even said "closure" instead of "function call" Then said the master that ready were we To start real hacking instead of simple theory Will you, said he, write me a function please That in lists would associate values with keys I went home and turned on my trusty Apollo And wrote a function whose definition follows: (cdr (assq key a-list)) A one-liner I thought, fool that I was Just two simple calls without a COND clause But when I tried this function to run CDR didn't think that NIL was much fun So I tried again like the good King of yore And of code I easily generated some more: (cond ((assq key a-list) => cdr)) It got longer but purer, and it wasn't too bad But then COND ran out and that was quite sad Well, that isn't hard to fix, I was told Just write some more code, my son, be bold Being young, not even a moment did I pause I stifled my instincts and added a clause (cond ((assq key a-list) => cdr) (else nil)) Sometimes this worked and sometimes it broke I debugged and prayed and even had a stroke Many a guru tried valiantly to help But undefined datums their efforts did squelch. I returneth once more to the great sage of T For no way out of the dilemma I could see He said it was easy -- more lines must I fill with code, for FALSE was no longer NIL. (let ((val (assq key a-list))) (cond (val (cdr val)) (else nil))) You'd think by now I might be nearing the end Of my ballad which seems bad things to portend You'd think that we could all go home scot-free But COND eschewed VAL; it wanted #T So I went back to the master and appealed once again I said, pardon me, but now I'm really insane He said, no you're not really going out of your head Instead of just VAL, you must use NOT NULL instead (let ((val (assq key a-list))) (cond ((not (null? val)) (cdr val)) (else nil))) My song is over and I'm going home to bed With this ineffable feeling that I've been misled And just in case my point you have missed Somehow I preferred (CDR (ASSQ KEY A-LIST)) :-) ================================================== -------  Received: from yale by MC.LCS.MIT.EDU 29 Jan 86 11:58:54 EST Received: by Yale-Bulldog.YALE.ARPA; 29 Jan 86 02:10:33 EST (Wed) From: Return-Path: Received: from Cabernet.ms by ArpaGateway.ms ; 28 JAN 86 23:49:12 PST Date: 28 Jan 86 23:36 PST Subject: Re: Of growing code and diminishing hacks... In-Reply-To: 's message of 28 Jan 86 06:22:59 EST (Tue) To: ram@YALE-RING.YALE.ARPA Cc: t-discussion@YALE.ARPA, scheme@MC.LCS.MIT.EDU Message-Id: <860128-234912-1014@Xerox> (define (overloaded-cdr val) (if (null? val) nil (cdr val))) (overloaded-cdr (assq key a-list)) In other words, if you want a cdr that horribly overloads nil, then write one. As for me, I think of a cons cell as an object with car and cdr fields in it, just as a point is an object with x and y fields in it. How about: (define (overloaded-x point) (if (null? point) nil (x point)))  Received: from yale by MC.LCS.MIT.EDU 29 Jan 86 12:15:24 EST Received: by Yale-Bulldog.YALE.ARPA; 29 Jan 86 03:23:44 EST (Wed) From: Return-Path: Received: from Salvador.ms by ArpaGateway.ms ; 29 JAN 86 01:20:42 PST Date: 29 Jan 86 01:14 PST Subject: Re: Of growing code and diminishing hacks... In-Reply-To: 's message of 28 Jan 86 06:22:59 EST (Tue) To: ram@YALE-RING.YALE.ARPA Cc: t-discussion@YALE.ARPA, scheme@MC.LCS.MIT.EDU Message-Id: <860129-012042-1051@Xerox> And another thing. The only reason NIL == #F usually works out so well in lisps is that the most common domain of concern is lists. In both C and APL, FALSE == 0 since a very common domain of concern is numbers. Hopefully we are moving towards a programming style that is more abstract datatype or object based, and so the primacy of lists will diminish. In any case, I don't want my programming language prejudging for me what types of object should be my major concern, and compromising its foundations to optimize for that one type.  Received: from yale by MC.LCS.MIT.EDU 29 Jan 86 12:52:02 EST Received: by Yale-Bulldog.YALE.ARPA; 29 Jan 86 08:12:57 EST (Wed) Return-Path: Date: Wed, 29 Jan 86 08:58:51 EST From: "George J. Carrette" Subject: Overloading of empty list as false. To: Miller.pa@XEROX.COM Cc: SCHEME@MC.LCS.MIT.EDU, t-discussion@YALE.ARPA, ram@YALE-RING.ARPA In-Reply-To: Msg of 29 Jan 86 01:14 PST from Miller.pa at Xerox.COM Message-Id: <[MC.LCS.MIT.EDU].800287.860129.GJC> The primacy of lists in lisp is due to the fact that lisp is its own meta language and the vocabulary of that meta language is constructed inductively from lists, symbols and other constants. Furthermore, the most general graphs can be constuctured entirely in terms of bifurcations represented as cons cells; and bifurcations have a primacy over trifurcations etc. Topping this off by using the logical falsity constant as the token to mark the end of certain kinds of graphs is entirely natural definition to use. The lists themeselves will remain in their primacy as a prefered construct of efficient assembly language programming, (especially if this means your assembly language is LISP on a LISPMACHINE). Take note Plummer's multilisp emulator that he implemented on the 3600: Comments in the code indicating that using (SETQ *STACK* (CONS ELEMENT *STACK*)) was more efficient than using the C/FORTRAN/PASCAL style INDEX plus ARRAY, because the GC overhead was smaller than the expense of the extra instructions and memory references needed to manipulate the more complicated data structure. But I am arguing the barn door closed after the cows have left. The recent slant of revised-revised-report-on-scheme has indeed cleaned up things to make them more acceptable to the general community; throwing out all the obvious meta language machinery and with it much of the preference for lists. The reason that FALSE == 0 in C is not due to the concern for the domain of numbers. (Since in C one will often mark the end of character strings with 0, and represent the NULL pointer as 0 also). FALSE == 0 because of the instruction sets and memory organizations of the machines on which C was developed. Similarly in PDP10 Maclisp and CADR Lispmachine NIL == 0 (as a machine location address).  Received: from yale by MC.LCS.MIT.EDU 29 Jan 86 13:06:15 EST Received: by Yale-Bulldog.YALE.ARPA; 29 Jan 86 09:39:05 EST (Wed) Date: 29 Jan 86 09:39:05 EST (Wed) From: Message-Id: <8601291439.AA10931@Yale-Bulldog.YALE.ARPA> Subject: Re: Of growing code and diminishing hacks... To: Cc: t-discussion@YALE.ARPA, scheme@mit-mc.arpa In-Reply-To: , 28 Jan 86 23:36 PST (define (overloaded-cdr val) (if (null? val) nil (cdr val))) (overloaded-cdr (assq key a-list)) In other words, if you want a cdr that horribly overloads nil, then write one. As for me, I think of a cons cell as an object with car and cdr fields in it, just as a point is an object with x and y fields in it. How about: (define (overloaded-x point) (if (null? point) nil (x point))) So now we have a proliferation of functions. You could just as well think of CAR and CDR as operations, and NIL as an object that handles them by returning NIL. Much cleaner. Well, maybe not; I guess that's debatable. I think the code is cleaner even though the semantics that the compiler must implement may become a little hairier. But that's what compilers are for :-). -------  Received: from yale by MC.LCS.MIT.EDU 29 Jan 86 13:20:14 EST Received: by Yale-Bulldog.YALE.ARPA; 29 Jan 86 09:49:57 EST (Wed) Date: 29 Jan 86 09:49:57 EST (Wed) From: Message-Id: <8601291449.AA11227@Yale-Bulldog.YALE.ARPA> Subject: Re: Of growing code and diminishing hacks... To: Cc: t-discussion@YALE.ARPA, scheme@mit-mc.arpa In-Reply-To: , 29 Jan 86 01:14 PST And another thing. The only reason NIL == #F usually works out so well in lisps is that the most common domain of concern is lists. In both C and APL, FALSE == 0 since a very common domain of concern is numbers. I didn't say that NIL was in any way the best choice for FALSE across all languages. In Lisps, NIL = #F is just as reasonable as 0 = FALSE in C or APL. Try telling a C programmer that 0 won't be FALSE anymore. -------  Received: from yale by MC.LCS.MIT.EDU 18 Feb 86 17:31:04 EST Received: by Yale-Bulldog.YALE.ARPA; 18 Feb 86 15:48:52 EST (Tue) Return-Path: Received: by ll-vlsi.ARPA (4.12/4.7) id AA10471; Tue, 18 Feb 86 15:52:19 est Date: Tue, 18 Feb 86 15:52:19 est From: young@ll-vlsi.ARPA (George Young) Message-Id: <8602182052.AA10471@ll-vlsi.ARPA> To: t-discussion-request@YALE.ARPA, t-discussion@YALE.ARPA I am a new user of t2.9, (hoping for t3) running bsd4.2 on a vax/780, developing cad software for wafer-scale integration. Please add me to the t-discussion mailing list (or whatever appropriate mailing list exists). Thanks, George R. Young ( young@ll-vlsi.arpa ) MIT Lincoln Laboratory, Lexington, Mass. 01273  Received: from yale by MC.LCS.MIT.EDU 21 Feb 86 21:43:16 EST Received: by Yale-Bulldog.YALE.ARPA; 21 Feb 86 17:31:16 EST (Fri) Date: 21 Feb 86 17:31:16 EST (Fri) From: Ashwin Ram Message-Id: <8602212231.AA15193@Yale-Bulldog.YALE.ARPA> Subject: CASE and SELECT To: t-bugs@YALE.ARPA Cc: t-users@YALE.ARPA, t-discussion@YALE.ARPA BUG: ---- I think there is an inconsistency in the definition of CASE and SELECT in T. Both should take an extra first argument, which is the predicate to use in the comparison, and CASEQ and SELECTQ should be defined to use EQ? as the default predicate. (This is in keeping with MEM? and MEMQ?, ASS and ASSQ, etc.) Similarly, there may also be a CASEV and SELECTV. FIX: ---- The fixed code for CASE follows. Feel free to use it if you like. (I've been calling it CASEF so as not to clobber the original CASE, but I think that CASE and CASEQ is a better way to go.) The code is tested. ;;****************************************************************************** ;; CASE with specifiable PREDicate to compare the cases with. ;; Original CASE is equivalent to: (CASE eq? key . clauses) [now called CASEQ]. ;; Ashwin Ram, May 1985. (define **case-fell-off-end** '**case-fell-off-end**) (define-syntax (case pred key . clauses) (labels (((expand-case-1 keyvar clauses) (if (atom? clauses) '**case-fell-off-end** (let ((clause (car clauses)) (lose (lambda () (syntax-error "bad ~s clause syntax: ~s" 'case (car clauses))))) (cond ((atom? clause) (lose)) ((list? (car clause)) `(if (or ,@(map (lambda (k) `(,pred ,keyvar ',k)) (car clause))) ,(blockify (cdr clause)) ,(expand-case-1 keyvar (cdr clauses)))) ((memq? (car clause) '(t else)) (blockify (cdr clause))) (t (lose))))))) (let ((keyvar '%%%%key%%%%)) `((lambda (,keyvar) ,(expand-case-1 keyvar clauses)) ,key)))) (define-syntax (xcase pred key . clauses) `(case ,pred ,key ,@clauses (else (losing-xcase)))) (define (losing-xcase) (error "no clause selected in ~s expression" 'xcase)) (define-syntax (caseq key . clauses) `(case eq? ,key ,@clauses)) (define-syntax (casev key . clauses) `(case alikev? ,key ,@clauses)) ;;****************************************************************************** -------  Received: from yale-bulldog by MC.LCS.MIT.EDU 26 Feb 86 14:11:06 EST Received: by Yale-Bulldog.YALE.ARPA; 26 Feb 86 13:45:38 EST (Wed) Date: 26 Feb 86 13:45:38 EST (Wed) From: Charles Martin Message-Id: <8602261845.AA07245@Yale-Bulldog.YALE.ARPA> Subject: Re: Bug fix for Ashwin's CASE To: Olin.Shivers@H.CS.CMU.EDU Cc: ram@YALE.ARPA, t-discussion@YALE.ARPA In-Reply-To: Olin.Shivers@H.CS.CMU.EDU, 26 Feb 1986 07:09:50-EST Minor programming style point. Instead of doing things like (define-syntax (case pred key . clauses) (let ((comparator '%%%%casefun%%%%)) ... )) I've always preferred constructions such as (define-syntax (case pred key . clauses) (let ((comparator (generate-symbol 'CASE-FUN))) ... )) (Personally, "%%%%CASEFUN%%%%" is one of my favorite temporary variable names, so my code would break with your version... :-) -------  Received: from yale-bulldog by MC.LCS.MIT.EDU 25 Mar 86 14:38:56 EST Received: by Yale-Bulldog.YALE.ARPA; 25 Mar 86 14:31:11 EST (Tue) Date: 25 Mar 86 14:31:11 EST (Tue) From: Jonathan Young Message-Id: <8603251931.AA09255@Yale-Bulldog.YALE.ARPA> Subject: Tables To: T-Discussion@YALE.ARPA I would like to see some discussion about desirable features for the T table package. Recall that the current ("Released", although it isn't in the manual) table package supports the following operations: (MAKE-TABLE tag) => table (TABLE-ENTRY table key) => value or nil if none (settable) (SET-TABLE-ENTRY table key value) => undefined (adds an association) Now, the wish list. Clearly, it is desirable to have hash tables where the hash function and comparision function are other than POINTER-HASH (or some other hack) and EQ?. Obvious examples are , , and . Weak Tables. A table is a list of associations - pairs of keys and values. If the key is garbage, i.e., is no longer accessible, I would like the association (i.e. the pointer to the value) to go away. This is not implementable in the current scheme. Table Walking. It is desirable (occasionally) to apply a procedure to each pair in a table. This is possible in the current scheme only if you put a layer on top of the table package. Generators. I often write the following idiom: (or (table-entry table key) (set (table-entry table key) (make-value key))) This would be eliminated by the provision of a generator procedure to be called in the case when there is no value associated with the key in a call to TABLE-ENTRY. Before someone goes out and blindly writes a new table package, I'd like to hear more feedback. Are these idioms you use a lot? Are there other ideas you really need? Is this even the proper abstraction? --- Jonathan -------  Received: from yale-bulldog by MC.LCS.MIT.EDU 26 Mar 86 10:20:38 EST Received: by Yale-Bulldog.YALE.ARPA; 26 Mar 86 07:13:32 EST (Wed) Date: 26 Mar 86 07:13:32 EST (Wed) From: Larry Hunter Message-Id: <8603261213.AA18953@Yale-Bulldog.YALE.ARPA> Subject: tables To: young@YALE-BULLDOG.YALE.ARPA Cc: t-discussion@YALE.ARPA I agree that it would be nice to be able to specify the hash and comparison functions. The nonstandard stuff I use is a table-walker, an association-list to table conversion (and vice versa) and, for my own perverse reasons, I sometimes need to get back a random (not arbitrary) element from a table. One thing that bothers me is that table-entries that have never been defined return nil. I often want to discriminate between values that have never been set and ones that have been set to nil. Shouldn't uninitialized table-entries return some undefined value instead of nil? Larry -------  Received: from yale-bulldog by MC.LCS.MIT.EDU 26 Mar 86 11:04:36 EST Received: by Yale-Bulldog.YALE.ARPA; 26 Mar 86 10:54:44 EST (Wed) Date: 26 Mar 86 10:54:44 EST (Wed) From: Jonathan Young Message-Id: <8603261554.AA21038@Yale-Bulldog.YALE.ARPA> To: Hunter@YALE.ARPA Cc: T-Discussion@YALE.ARPA Subject: Tables returning nil if no value One thing that bothers me is that table-entries that have never been defined return nil. I often want to discriminate between values that have never been set and ones that have been set to nil. Shouldn't uninitialized table-entries return some undefined value instead of nil? The problem is that *any* value could be stored in the table, including "some undefined value". The correct solution is to return multiple values such as the following: (table-entry table key) => found?, value where found? is true if there was a pair in the table and value is undefined if found? is false. Any votes for this system? Against? --- Jonathan  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 26 Mar 86 14:47:45 EST Received: from LOCUS.UCLA.EDU (locus.ucla.edu.ARPA) by yale-cheops.YALE.ARPA; Wed, 26 Mar 86 14:37:49 est Date: Wed, 26 Mar 86 11:28:56 PST From: Scott Turner To: Jonathan Young Cc: t-discussion@yale.arpa Subject: Re: Tables returning nil if no value In-Reply-To: Message of 26 Mar 86 10:54:44 EST (Wed) from "Jonathan Young " <8603261554.AA21038@Yale-Bulldog.YALE.ARPA> Message-Id: <860326.192856z.02571.srt@ZEUS.LOCUS.UCLA.EDU> > One thing that bothers me is that table-entries that have never been > defined return nil. I often want to discriminate between values that > have never been set and ones that have been set to nil. Shouldn't > uninitialized table-entries return some undefined value instead of nil? > The problem is that *any* value could be stored in the table, including > "some undefined value". > The correct solution is to return multiple values such as the following: > (table-entry table key) => found?, value I hesitate to offer an alternative to "the correct solution", but in our hash table (HT) package here at UCLA, we have nil as the undefined value and an additional function, HT:KEY? that returns true if the key is defined in the table (even with a nil value) and false otherwise. This has the advantage that you can ignore the defined/undefined issue if you'd like. In general, our solution has been to have the application (built on top of HT) decide about the defined/undefined question. As far as what functions I'd like in a table package, here are the ones that we have in HT: ; Functions intended for use by mortal beings ; ; HT:CREATE HT? HT:REMOVE HT:PAIRS ; HT:ENTRY HT:PAIR FREE HT:KEY? ; HT:WALK DUMP HT:KEYS COPY ; HT:MAP HT:ADD HT:RECORDS HT:COMBINE ; HT:FIND-ENTRY HT:UPDATE HT:COUNT The unobvious ones: HT:FIND-ENTRY -- returns the first pair that satisfies a predicate. HT:ADD/UPDATE -- add assumes the key is new, update the key is old. DUMP, FREE and COPY are generic operations defined on many of the packages we have here. DUMP is a debug print-out, FREE releases an object to storage management, and COPY returns a copy of the object. COPY in particular is ill-defined and is slowly going away. Ashwin has a copy of this code if you'd care to look at it. It is largely based on the original HT code. The default hashing function is OBJECT-HASH, but the user can define another (as well as the equality predicate) in the call to HT:CREATE. -- Scott Turner  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 26 Mar 86 15:02:25 EST Received: from MC.LCS.MIT.EDU (mc.lcs.mit.edu.ARPA) by yale-cheops.YALE.ARPA; Wed, 26 Mar 86 14:58:03 est Date: Wed, 26 Mar 86 14:09:43 EST From: Jonathan A Rees Subject: Tables returning nil if no value To: young-jonathan@YALE.ARPA Cc: Hunter@YALE.ARPA, T-Discussion@YALE.ARPA In-Reply-To: Msg of 26 Mar 86 10:54:44 EST (Wed) from Jonathan Young Message-Id: <[MC.LCS.MIT.EDU].862572.860326.JAR> Here's what I had in mind when I added tables: I really wanted them to be extremely minimal, with very little structure. I wanted them to be as simple and primitive as pairs. They were to be viewed as primitive components out of which one could build higher-level abstractions. My inspiration was SNOBOL4's tables. I didn't like the idea of having a zillion bells and whistles like in Common Lisp, or worse, Zetalisp. It was always my intent that the tables created by MAKE-TABLE would be weak tables, and they clearly could be; that's why there's no TABLE-WALK. I never got around to implementing them that way, however. I'm not saying this is the best way for this feature to be, I'm just saying it's what I had in mind. The correct way to deal with lookup failure is NOT to return a second found? value, but instead to either build failure into the language (as in Prolog, Snobol, or Icon, or zetalisp's condition system), or to pass multiple continuations (like PDP-10 assembly language programmers do): (table-entry table key (lambda (val) ... success ...) (lambda () ... failure ...)) Given that neither of these alternatives seems particularly realistic (the first because it's too drastic and the second because it's just as cumbersome as dealing with multiple values), I think the way it is is better.  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 26 Mar 86 15:47:52 EST Received: from decwrl.DEC.COM (decwrl.dec.com.ARPA) by yale-cheops.YALE.ARPA; Wed, 26 Mar 86 15:26:25 est Received: from clark.ARPA (clark) by decwrl.DEC.COM (4.22.03/4.7.34) id AA05012; Wed, 26 Mar 86 12:24:56 pst Received: by clark.ARPA (4.12/4.7.34) id AA19878; Wed, 26 Mar 86 12:24:04 pst From: ellis@decwrl.DEC.COM (John R. Ellis) Message-Id: <8603262024.AA19878@clark.ARPA> Date: 26 Mar 1986 1222-PST (Wednesday) To: Jonathan Young Cc: T-Discussion@YALE.ARPA, Hunter@YALE.ARPA Subject: Re: Tables returning nil if no value In-Reply-To: Your message of 26 Mar 86 10:54:44 EST (Wed). <8603261554.AA21038@Yale-Bulldog.YALE.ARPA> The problem is that *any* value could be stored in the table, including "some undefined value". The typical solution is to have a unique value defined in the table interface, say *table-undefined*, which is used only for undefined table entries. There is no practical reason to store *table-undefined* in a table as an explicit value. The minor advantage of *table-undefined* compared with returning two values is that it makes many applications simpler and slighlty more efficient. These applications will look up a key's value and compare it for equality with some value they're holding; this test is a little easier if *table-undefined* is used as sentinel value, since there will be only one test instead of two.  Received: from yale-bulldog by MC.LCS.MIT.EDU 30 Mar 86 00:32:41 EST Received: by Yale-Bulldog.YALE.ARPA; 27 Mar 86 11:38:39 EST (Thu) Date: 27 Mar 86 11:38:39 EST (Thu) From: Ashwin Ram Message-Id: <8603271638.AA03707@Yale-Bulldog.YALE.ARPA> Subject: Re: Tables returning nil if no value To: Jonathan Young Cc: t-discussion@YALE.ARPA In-Reply-To: Jonathan Young , 26 Mar 86 10:54:44 EST (Wed) The correct solution is to return multiple values such as the following: (table-entry table key) => found?, value where found? is true if there was a pair in the table and value is undefined if found? is false. I don't think this solution is "correct", since it violates the semantics we intuitively expect. Given a table T, a key K and a value V, we would, in your scheme, have: (set (table-entry T K) V) (table-entry T K) ==> something not EQ? to V I would vote for a predicate TABLE-ENTRY? (like Scott's HT:KEY?) which checks whether K has an association in T. I liked your idea of generator functions. The user may then choose to return NIL if s/he then wishes. However, this is obviously orthogonal to the "found?" problem. Well, maybe it's not so obvious. If a table is used as a data structure common to two modules in a program, there is no a priori way for the one to know that an "undefined value" (as Ellis suggested) is in fact not a legitimate value stored in the table by the other. The only way it could do this is to test if the "undefined value" belonged to the co-domain of the function being implemented, which requires an extra test anyway (and one that is presumably more complex than null?). Alternatively, the table package can provide a predicate like valid-undefined-value?, which gets us right back where we started. -- Ashwin. -------  Received: from yale-bulldog by MC.LCS.MIT.EDU 30 Mar 86 00:33:23 EST Received: by Yale-Bulldog.YALE.ARPA; 27 Mar 86 11:49:29 EST (Thu) Date: 27 Mar 86 11:49:29 EST (Thu) From: Ashwin Ram Message-Id: <8603271649.AA03849@Yale-Bulldog.YALE.ARPA> Subject: Re: Tables To: Jonathan Young Cc: t-discussion@YALE.ARPA In-Reply-To: Jonathan Young , 25 Mar 86 14:31:11 EST (Tue) Weak Tables. A table is a list of associations - pairs of keys and values. If the key is garbage, i.e., is no longer accessible, I would like the association (i.e. the pointer to the value) to go away. This is not implementable in the current scheme. The tables used by OBJECT-HASH/OBJECT-UNHASH are weak tables, and it isn't too hard to implement similar tables for yourself if you really need them. I agree, however, that they should be part of the abstraction. Table Walking. It is desirable (occasionally) to apply a procedure to each pair in a table. This is possible in the current scheme only if you put a layer on top of the table package. Or if you used WALK-TABLE. Unreleased, but that never stopped me from using it. Before someone goes out and blindly writes a new table package, I'd like to hear more feedback. Are these idioms you use a lot? Are there other ideas you really need? Is this even the proper abstraction? --- Jonathan I think I agree with Rees ["I really wanted them to be extremely minimal, with very little structure. I wanted them to be as simple and primitive as pairs. They were to be viewed as primitive components out of which one could build higher-level abstractions"]. I think Scott's HT package is great (except that it doesn't implement weak tables), but I find it somewhat "big". I never use more than 25% of the functions provided. Since most can be built up on top of the 25% or so that are "really primitive" very easily in an particular application, my vote lies with a good abstraction that is reasonably "small". -- Ashwin. -------  Received: from yale-bulldog by MC.LCS.MIT.EDU 30 Mar 86 00:33:54 EST Received: by Yale-Bulldog.YALE.ARPA; 27 Mar 86 12:02:01 EST (Thu) Date: 27 Mar 86 12:02:01 EST (Thu) From: Ashwin Ram Message-Id: <8603271702.AA04000@Yale-Bulldog.YALE.ARPA> Subject: Re: Tables returning nil if no value To: Scott Turner Cc: t-discussion@YALE.ARPA In-Reply-To: Scott Turner , Wed, 26 Mar 86 11:28:56 PST I hesitate to offer an alternative to "the correct solution", but in our hash table (HT) package here at UCLA, we have nil as the undefined value and an additional function, HT:KEY? that returns true if the key is defined in the table (even with a nil value) and false otherwise. This has the advantage that you can ignore the defined/undefined issue if you'd like. In general, our solution has been to have the application (built on top of HT) decide about the defined/undefined question. I agree. My philosophy is always to let the user decide about the sticky issues, while providing a clean way to implement the outcome of the decision. ...The default hashing function is OBJECT-HASH, but the user can define another (as well as the equality predicate) in the call to HT:CREATE. This is also in concord with my philosophy. Provide nice defaults but never sacrifice extensibility. For the HT problem, the hashing and equality functions are the obvious examples of this. (I was surprised not to see functions in your list that get the hashing and equality functions for an HT.) The unobvious ones: HT:FIND-ENTRY -- returns the first pair that satisfies a predicate. HT:ADD/UPDATE -- add assumes the key is new, update the key is old. HT:FIND-ENTRY (along with HT:MAP) don't seem to make much sense. What does "the FIRST pair" mean? What significance would the order of entries returned by HT:MAP have? Entries in a table don't have any endogenous order. HT:WALK, by contrast, is fine (if you're into side-effects). It might be useful to make HT:MAP return a table (in the obvious way, so that (COPY ht) is just (HT:MAP IDENTITY ht)). -- Ashwin. -------  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 31 Mar 86 12:21:38 EST Received: from C.CS.CMU.EDU (c.cs.cmu.edu.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 12:08:23 est Received: ID ; Mon 31 Mar 86 11:38:53-EST Date: Mon, 31 Mar 1986 01:51 EST Message-Id: Sender: FAHLMAN@C.CS.CMU.EDU From: "Scott E. Fahlman" To: Miller.pa@XEROX.COM Cc: Kahn.pa@XEROX.COM, scheme@MC.LCS.MIT.EDU, t-discussion@YALE.ARPA Subject: non-list arguments In-Reply-To: Msg of 31 Mar 1986 01:19-EST from Miller.pa at Xerox.COM It certainly doesn't work in Common Lisp because lambda lists don't do destructuring in Common Lisp (though the argument lists for macros do destructure). Also, in Common Lisp you'd have to say "(function (lambda ...))". -- Scott  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 31 Mar 86 12:47:05 EST Received: from decwrl.DEC.COM (decwrl.dec.com.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 12:32:32 est Received: from magic.ARPA (magic) by decwrl.DEC.COM (4.22.03/4.7.34) id AA20193; Sun, 30 Mar 86 22:21:05 pst Received: by magic.ARPA (4.12/4.7.34) id AA06874; Sun, 30 Mar 86 22:22:02 pst From: ellis@decwrl.DEC.COM (John R. Ellis) Message-Id: <8603310622.AA06874@magic.ARPA> Date: 30 Mar 1986 2219-PST (Sunday) To: Ashwin Ram Cc: t-discussion@YALE.ARPA, Jonathan Young Subject: Re: Tables returning nil if no value In-Reply-To: Your message of 27 Mar 86 11:38:39 EST (Thu). <8603271638.AA03707@Yale-Bulldog.YALE.ARPA>  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 31 Mar 86 13:02:08 EST Received: from Xerox.COM (xerox.com.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 12:48:53 est Received: from Cabernet.ms by ArpaGateway.ms ; 30 MAR 86 22:19:17 PST Date: 30 Mar 86 22:19 PST From: Miller.pa@Xerox.COM Subject: non-list arguments To: scheme@MC.LCS.MIT.EDU, t-discussion@YALE.ARPA Cc: Miller.pa@Xerox.COM, Kahn.pa@Xerox.COM Message-Id: <860330-221917-4500@Xerox> (apply (lambda (x . y) (+ x y)) (cons 1 2)) Does this nescesarily work in Scheme? How about T? Common-Lisp? (Example due to Ken Kahn)  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 31 Mar 86 13:08:06 EST Received: from Xerox.COM (xerox.com.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 12:50:29 est Received: from Cabernet.ms by ArpaGateway.ms ; 30 MAR 86 23:33:06 PST Date: 30 Mar 86 23:33 PST From: Miller.pa@Xerox.COM Subject: Re: non-list arguments In-Reply-To: "Scott E. Fahlman" 's message of Mon, 31 Mar 86 01:51 EST To: Fahlman@C.CS.CMU.EDU Cc: Miller.pa@Xerox.COM, Kahn.pa@Xerox.COM, scheme@MC.LCS.MIT.EDU, scheme%OZ@MC.LCS.MIT.EDU, t-discussion@YALE.ARPA Message-Id: <860330-233306-4514@Xerox> It certainly doesn't work in Common Lisp because lambda lists don't do destructuring in Common Lisp (though the argument lists for macros do destructure). Also, in Common Lisp you'd have to say "(function (lambda ...))". OK, for Common Lisp how about: (apply #'(lambda (x &rest y) (+ x y)) (cons 1 2)) In other words, "&rest" is all the destructuring I need to ask this question. "." is simply the cleaner way one can write it in the Schemes. (Sorry for the redundant scheme mailing addresses. I'm having some mail returned and I don't know which address is causing the problem)  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 31 Mar 86 13:17:04 EST Received: from XX.LCS.MIT.EDU (xx.lcs.mit.edu.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 13:08:58 est Received: from OZ.AI.MIT.EDU by XX.LCS.MIT.EDU via Chaosnet; 31 Mar 86 09:38-EST Date: 31 Mar 1986 09:33 EST (Mon) Message-Id: From: Bill Rozas To: Miller.pa@XEROX.COM Cc: Kahn.pa@XEROX.COM, scheme@MC.LCS.MIT.EDU, t-discussion@YALE.ARPA Subject: non-list arguments In-Reply-To: Msg of 31 Mar 1986 01:19-EST from Miller.pa at Xerox.COM The Revised Revised Report on Scheme states that the second argument (2 argument form) to APPLY must be a "proper" list. Individual implementations are free to extend the semantics of APPLY. APPLY in MIT Scheme signals an error when given somthing other than a "proper" list.  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 31 Mar 86 14:02:32 EST Received: from C.CS.CMU.EDU (c.cs.cmu.edu.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 13:34:55 est Received: ID ; Mon 31 Mar 86 13:08:26-EST Date: Mon, 31 Mar 1986 02:49 EST Message-Id: Sender: FAHLMAN@C.CS.CMU.EDU From: "Scott E. Fahlman" To: Miller.pa@XEROX.COM Cc: Kahn.pa@XEROX.COM, scheme%OZ@MC.LCS.MIT.EDU, scheme@MC.LCS.MIT.EDU, t-discussion@YALE.ARPA Subject: non-list arguments In-Reply-To: Msg of 31 Mar 1986 02:33-EST from Miller.pa at Xerox.COM OK, for Common Lisp how about: (apply #'(lambda (x &rest y) (+ x y)) (cons 1 2)) Ah, I see what you're driving at now. No this is not guaranteed to work in Common Lisp in my opinion. The second argument to apply is a list of operands. In this case, you've got a list of one operand, 1, with a particularly ugly terminator, so the rest arg, Y, should end up bound to NIL. Some implementations may get this "right" by accident, but in most of them the Apply takes apart the operand list and simulates a call to the function. The lambda would be called with only one arg, and the rest arg would be NIL. The 2 has been discarded before the function ever gets called. -- Scott  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 31 Mar 86 14:32:48 EST Received: from MC.LCS.MIT.EDU (mc.lcs.mit.edu.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 14:25:28 est Date: Mon, 31 Mar 86 04:05:03 EST From: Alan Bawden Subject: non-list arguments To: Miller.pa@XEROX.COM, Fahlman@C.CS.CMU.EDU Cc: SCHEME@MC.LCS.MIT.EDU, Kahn.pa@XEROX.COM, t-discussion@YALE.ARPA In-Reply-To: Msg of 30 Mar 86 22:19 PST from Miller.pa at Xerox.COM Message-Id: <[MC.LCS.MIT.EDU].866607.860331.ALAN> Date: 30 Mar 86 22:19 PST From: Miller.pa at Xerox (apply (lambda (x . y) (+ x y)) (cons 1 2)) Date: Mon, 31 Mar 1986 01:51 EST From: Scott E. Fahlman It certainly doesn't work in Common Lisp because lambda lists don't do destructuring in Common Lisp (though the argument lists for macros do destructure). Also, in Common Lisp you'd have to say "(function (lambda ...))". I would translate the question into Common Lisp as: (apply (function (lambda (x &rest y) (+ x y))) (cons 1 2)) which eliminates the question of "descructuring", but I would guess still preserves Ken Kahn's original question. A strict reading of the Common Lisp book would not require this to work, as far as I can see. An implementor would seem to be within his rights to insist that the last argument to APPLY always be a proper list.  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 31 Mar 86 16:02:18 EST Received: from MC.LCS.MIT.EDU (mc.lcs.mit.edu.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 15:45:50 est Date: Sun, 30 Mar 86 16:23:54 EST From: Jonathan A Rees Subject: Tables returning nil if no value To: ram@YALE.ARPA Cc: t-discussion@YALE.ARPA, young-jonathan@YALE.ARPA In-Reply-To: Msg of 27 Mar 86 11:38:39 EST (Thu) from Ashwin Ram Message-Id: <[MC.LCS.MIT.EDU].866301.860330.JAR> Date: 27 Mar 86 11:38:39 EST (Thu) From: Ashwin Ram I would vote for a predicate TABLE-ENTRY? (like Scott's HT:KEY?) which checks whether K has an association in T. This sort of conflicts with my design which for (set (table-entry foo bar) '#f) deletes bar's entry in the table; if there's a possibility of having an entry of #f being different from no entry, then you have to have a separate deletion primitive. Things get out of hand quickly -- once you have one feature you want a zillion others. I say nip them in the bud. Jonathan.  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 31 Mar 86 17:17:33 EST Received: from LOCUS.UCLA.EDU (locus.ucla.edu.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 17:12:52 est Date: Mon, 31 Mar 86 13:58:46 PST From: Uri Zernik To: t-discussion@YALE.ARPA Subject: please take me off the list Message-Id: <860331.215846z.04196.uri@SPHINX.LOCUS.UCLA.EDU> thanks, uri  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 31 Mar 86 17:22:11 EST Received: from MC.LCS.MIT.EDU (mc.lcs.mit.edu.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 17:02:38 est Date: Mon, 31 Mar 86 16:52:27 EST From: Jonathan A Rees Subject: non-list arguments To: Fahlman@C.CS.CMU.EDU Cc: SCHEME@MC.LCS.MIT.EDU, Kahn.pa@XEROX.COM, Miller.pa@XEROX.COM, t-discussion@YALE.ARPA In-Reply-To: Msg of Mon 31 Mar 1986 01:51 EST from Scott E. Fahlman Message-Id: <[MC.LCS.MIT.EDU].867344.860331.JAR> Date: Mon, 31 Mar 1986 01:51 EST From: Scott E. Fahlman It certainly doesn't work in Common Lisp because lambda lists don't do destructuring in Common Lisp (though the argument lists for macros do destructure). Scheme and T don't have lambda list destructuring; they just use "." instead of "&rest". I haven't checked the manuals for T or Scheme but it was certainly the intent that the list passed to APPLY is unrelated to the list that a rest-parameter gets bound to. The rest-list should always be freshly consed, so e.g. the procedure LIST is equivalent to (LAMBDA X X). The last argument to APPLY must be a proper list. I think Common Lisp takes the same stance.  Received: from yale-bulldog by MC.LCS.MIT.EDU 31 Mar 86 18:30:50 EST Received: by Yale-Bulldog.YALE.ARPA; 31 Mar 86 18:11:20 EST (Mon) Date: 31 Mar 86 18:11:20 EST (Mon) From: Ashwin Ram Message-Id: <8603312311.AA12756@Yale-Bulldog.YALE.ARPA> Subject: Re: Tables returning nil if no value To: ellis@decwrl.DEC.COM (John R. Ellis) Cc: young@YALE-BULLDOG.YALE.ARPA, t-discussion@YALE.ARPA In-Reply-To: ellis@decwrl.DEC.COM (John R. Ellis), 30 Mar 1986 2224-PST (Sunday) If a table is used as a data structure common to two modules in a program, there is no a priori way for the one to know that an "undefined value" (as Ellis suggested) is in fact not a legitimate value stored in the table by the other. I don't understand. The Table package (interface, module, abstraction, ...) defines and exports a constant of unique type called UndefinedTableValue. By the contract of the interface, no one stores that value in the table (why should they?). Everyone knows for sure that UndefinedTableValue is not a legitimate table value. So there isn't any possiblity of confusing UndefinedTableValue with any other value. As I hinted at in my original message, the UndefinedTableValue solution is fine but reduces to the TABLE-ENTRY-EXISTS? solution. For consider what the program that is handed UndefinedTableValue in response to a TABLE-ENTRY call must do in order to detect that there was no proper value stored in the table under that key. It could either: a - Check that the returned value is *not* part of the co-domain of the function that the table implements, and hence is an "undefined table value", but writing (BELONGS-TO? V SOME-FUNCTIONAL-DOMAIN) is hard in general. b - Check that the returned value is the constant UndefinedTableValue (which is specified by the particular table package the user is using). However, (EQ? V 'UndefinedTableValue) reduces (i) portability of the code to other table packages, and (ii) transparency of the table implementation to the user program. Thus the user would need to "hide" the "constant of unique type" in an implementation-independent way, as follows: c - Define a predicate (UNDEFINED-TABLE-VALUE? V) which returns #t only to the constant UndefinedTableValue and #f to all other objects (by checking if V is EQ? to UndefinedTableValue). But this, of course, is identical to the TABLE-ENTRY-EXISTS? solution (which has the minor advantage of requiring one less function call). It would be nice if the table package provided this as part of the interface/module/abstraction for the reasons outlined in b above. -- Ashwin. -------  Received: from yale-bulldog by MC.LCS.MIT.EDU 31 Mar 86 18:59:34 EST Received: by Yale-Bulldog.YALE.ARPA; 31 Mar 86 18:45:15 EST (Mon) Date: 31 Mar 86 18:45:15 EST (Mon) From: Ashwin Ram Message-Id: <8603312345.AA13600@Yale-Bulldog.YALE.ARPA> Subject: Re: Tables returning nil if no value To: JAR@MC.LCS.MIT.EDU Cc: young@YALE-BULLDOG.YALE.ARPA, t-discussion@YALE.ARPA In-Reply-To: Jonathan A Rees , Sun, 30 Mar 86 16:23:54 EST Date: 27 Mar 86 11:38:39 EST (Thu) From: Ashwin Ram I would vote for a predicate TABLE-ENTRY? (like Scott's HT:KEY?) which checks whether K has an association in T. This sort of conflicts with my design which for (set (table-entry foo bar) '#f) deletes bar's entry in the table; if there's a possibility of having an entry of #f being different from no entry, then you have to have a separate deletion primitive. Things get out of hand quickly -- once you have one feature you want a zillion others. I say nip them in the bud. Jonathan. In practical terms I agree with you. I've been using tables (and even property lists) for a long time without ever being bothered by the "nil vs. doesn't-exist" distinction. In the few cases where it matters, it's easy enough to write a couple of one-liners to handle the situation. For the same reason I'm quite happy with ASS returning nil for non-existent entries and a cons cell otherwise, and using these interchangeably as boolean and list values. In the case of tables, however, a strong (theoretical) case could be made for having a separate TABLE-ENTRY? predicate (along with the REMOVE-TABLE-ENTRY primitive it necessitates). I expect to hear a million voices claiming that they would like to be able to store nil (or #f) explicitly in a table as a value in its own right. Making (set (table-entry tbl key) '#f) automatically delete the entry may be problematic (for a sample, what is the size of the table after you've entered one #t and five #f's into it? One or six? What if you now set the one #t entry to #f? Do you now have an empty table?) One of these days we'll move on to three-valued logics and then everyone will be happy :-). -- Ashwin. -------  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 1 Apr 86 09:37:50 EST Received: from MC.LCS.MIT.EDU (mc.lcs.mit.edu.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 14:25:28 est Date: Mon, 31 Mar 86 04:05:03 EST From: Alan Bawden Subject: non-list arguments To: Miller.pa@XEROX.COM, Fahlman@C.CS.CMU.EDU Cc: SCHEME@MC.LCS.MIT.EDU, Kahn.pa@XEROX.COM, t-discussion@YALE.ARPA In-Reply-To: Msg of 30 Mar 86 22:19 PST from Miller.pa at Xerox.COM Message-Id: <[MC.LCS.MIT.EDU].866607.860331.ALAN> Date: 30 Mar 86 22:19 PST From: Miller.pa at Xerox (apply (lambda (x . y) (+ x y)) (cons 1 2)) Date: Mon, 31 Mar 1986 01:51 EST From: Scott E. Fahlman It certainly doesn't work in Common Lisp because lambda lists don't do destructuring in Common Lisp (though the argument lists for macros do destructure). Also, in Common Lisp you'd have to say "(function (lambda ...))". I would translate the question into Common Lisp as: (apply (function (lambda (x &rest y) (+ x y))) (cons 1 2)) which eliminates the question of "descructuring", but I would guess still preserves Ken Kahn's original question. A strict reading of the Common Lisp book would not require this to work, as far as I can see. An implementor would seem to be within his rights to insist that the last argument to APPLY always be a proper list.  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 1 Apr 86 09:45:58 EST Received: from C.CS.CMU.EDU (c.cs.cmu.edu.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 12:08:23 est Received: ID ; Mon 31 Mar 86 11:38:53-EST Date: Mon, 31 Mar 1986 01:51 EST Message-Id: Sender: FAHLMAN@C.CS.CMU.EDU From: "Scott E. Fahlman" To: Miller.pa@XEROX.COM Cc: Kahn.pa@XEROX.COM, scheme@MC.LCS.MIT.EDU, t-discussion@YALE.ARPA Subject: non-list arguments In-Reply-To: Msg of 31 Mar 1986 01:19-EST from Miller.pa at Xerox.COM It certainly doesn't work in Common Lisp because lambda lists don't do destructuring in Common Lisp (though the argument lists for macros do destructure). Also, in Common Lisp you'd have to say "(function (lambda ...))". -- Scott  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 1 Apr 86 09:53:25 EST Received: from C.CS.CMU.EDU (c.cs.cmu.edu.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 13:34:55 est Received: ID ; Mon 31 Mar 86 13:08:26-EST Date: Mon, 31 Mar 1986 02:49 EST Message-Id: Sender: FAHLMAN@C.CS.CMU.EDU From: "Scott E. Fahlman" To: Miller.pa@XEROX.COM Cc: Kahn.pa@XEROX.COM, scheme%OZ@MC.LCS.MIT.EDU, scheme@MC.LCS.MIT.EDU, t-discussion@YALE.ARPA Subject: non-list arguments In-Reply-To: Msg of 31 Mar 1986 02:33-EST from Miller.pa at Xerox.COM OK, for Common Lisp how about: (apply #'(lambda (x &rest y) (+ x y)) (cons 1 2)) Ah, I see what you're driving at now. No this is not guaranteed to work in Common Lisp in my opinion. The second argument to apply is a list of operands. In this case, you've got a list of one operand, 1, with a particularly ugly terminator, so the rest arg, Y, should end up bound to NIL. Some implementations may get this "right" by accident, but in most of them the Apply takes apart the operand list and simulates a call to the function. The lambda would be called with only one arg, and the rest arg would be NIL. The 2 has been discarded before the function ever gets called. -- Scott  Received: from yale-bulldog by MC.LCS.MIT.EDU 1 Apr 86 16:25:07 EST Received: by Yale-Bulldog.YALE.ARPA; 1 Apr 86 12:20:32 EST (Tue) Date: 1 Apr 86 12:20:32 EST (Tue) From: Larry Hunter Message-Id: <8604011720.AA06892@Yale-Bulldog.YALE.ARPA> Subject: Nil v. UndefinedTableValue To: t-discussion@YALE.ARPA After bringing up the issue and listening (?) to the various replies, I find myself inclined to side with Rees and retract my initial wish. In situations where I want to know if an entry has been actually set to nil, there are a variety of approaches I can use on top of the vanilla package (eg, maintain a list of keys as a table entry, cons each entry to some symbol thereby simulating multiple value return, etc). If I don't care, I can use the vanilla package. I have been doing this all along, and, given T's philosophy of providing the minimum sufficient functionality and leaving the driving to us, I don't see any compelling reason to change. My comments about having hooks for providing hashing and equality functions still stand, tho. Larry -------  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 1 Apr 86 17:17:13 EST Received: from MIT-ZERMATT.ARPA (mit-zermatt.arpa.ARPA) by yale-cheops.YALE.ARPA; Tue, 1 Apr 86 17:01:10 est Received: from ASPEN.LCS.MIT.EDU by MIT-ZERMATT.ARPA via CHAOS with CHAOS-MAIL id 29890; Tue 1-Apr-86 15:27:29-EST Date: Tue, 1 Apr 86 15:26 EST From: Robert Halstead Subject: non-list arguments To: JAR@MIT-MC.ARPA Cc: SCHEME@MIT-MC.ARPA, t-discussion@YALE.ARPA In-Reply-To: <[MC.LCS.MIT.EDU].867344.860331.JAR> Message-Id: <860401152644.7.RHH@ASPEN.LCS.MIT.EDU> I haven't checked the manuals for T or Scheme but it was certainly the intent that the list passed to APPLY is unrelated to the list that a rest-parameter gets bound to. The rest-list should always be freshly consed, so e.g. the procedure LIST is equivalent to (LAMBDA X X). The last argument to APPLY must be a proper list. I think Common Lisp takes the same stance. A quick scan of the Common Lisp book leaves the question unresolved; maybe Guy Steele could comment. However, I have seen object-oriented programs where this would probably lead to less than the most efficient implementation. Suppose we represent objects by procedures and call them using the general form ( ) where the indicates the operation to be performed on and (possibly empty) consists of operation-dependent parameters. One way to code up such an object is as (lambda (key . rest) (cond ((eq? key 'foo) (apply f1 rest)) ((eq? key 'bar) (apply f2 (cons 'barbar rest))) ...)) where we use the key to pick a function (or new object) to forward the request to, on the assumption that somebody at the end of the chain will actually use the rest of the original arguments. Putting an extra list copy in at each forwarding step seems mildly expensive and somewhat unnecessary. I don't think that LAMBDA should be prohibited from checking that its argument is a true list, or from copying it over, but I also don't think it should be required to. Why is it important for the list of rest arguments to be copied over when we don't, for example, expect quoted lists to be copied over every time an expression '(...) is evaluated? To summarize, I think it should be permissible for (eq? ((lambda x x) l) l) to return true, but it should not be a requirement. Furthermore, it should be permissible for an implementation to report an error if l in the above expression is not a true list, but an implementation should not be required to do so. Of course, it would still be true that ((lambda x x) 3 4 5) would return a freshly consed list, just like (list 3 4 5). An interesting question: do people expect (apply list l) to return a top-level copy of l? -b.  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 2 Apr 86 02:58:39 EST Received: from C.CS.CMU.EDU (c.cs.cmu.edu.ARPA) by yale-cheops.YALE.ARPA; Mon, 31 Mar 86 12:08:23 est Received: ID ; Mon 31 Mar 86 11:38:53-EST Date: Mon, 31 Mar 1986 01:51 EST Message-Id: Sender: FAHLMAN@C.CS.CMU.EDU From: "Scott E. Fahlman" To: Miller.pa@XEROX.COM Cc: Kahn.pa@XEROX.COM, scheme@MC.LCS.MIT.EDU, t-discussion@YALE.ARPA Subject: non-list arguments In-Reply-To: Msg of 31 Mar 1986 01:19-EST from Miller.pa at Xerox.COM It certainly doesn't work in Common Lisp because lambda lists don't do destructuring in Common Lisp (though the argument lists for macros do destructure). Also, in Common Lisp you'd have to say "(function (lambda ...))". -- Scott  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 3 Apr 86 10:47:16 EST Received: from GODOT.THINK.COM (godot.think.com.ARPA) by yale-cheops.YALE.ARPA; Thu, 3 Apr 86 10:35:10 est Received: from katherine by GODOT.THINK.COM via CHAOS; Thu, 3 Apr 86 10:34:56 est Date: Thu, 3 Apr 86 10:36 EST From: Guy Steele Subject: non-list arguments To: rhh@MIT-VAX.ARPA, JAR@MIT-MC.ARPA Cc: SCHEME@MIT-MC.ARPA, t-discussion@YALE.ARPA, gls@THINK-AQUINAS.ARPA In-Reply-To: <860401152644.7.RHH@ASPEN.LCS.MIT.EDU> Message-Id: <860403103623.3.GLS@THINK-KATHERINE.ARPA> I haven't checked the manuals for T or Scheme but it was certainly the intent that the list passed to APPLY is unrelated to the list that a rest-parameter gets bound to. The rest-list should always be freshly consed, so e.g. the procedure LIST is equivalent to (LAMBDA X X). The last argument to APPLY must be a proper list. I think Common Lisp takes the same stance. A quick scan of the Common Lisp book leaves the question unresolved; maybe Guy Steele could comment. This question came up recently on the Common-Lisp mailing list. The unofficial consensus, as I understood it, was that the book is vague on this point and requires correcting; that the last argument to APPLY should be a proper list; and that a list passed as an argument to APPLY might or might not share list structure with an eventual &REST argument resulting from the application. --Guy  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 4 Apr 86 02:17:51 EST Received: from GODOT.THINK.COM (godot.think.com.ARPA) by yale-cheops.YALE.ARPA; Thu, 3 Apr 86 10:35:10 est Received: from katherine by GODOT.THINK.COM via CHAOS; Thu, 3 Apr 86 10:34:56 est Date: Thu, 3 Apr 86 10:36 EST From: Guy Steele Subject: non-list arguments To: rhh@MIT-VAX.ARPA, JAR@MIT-MC.ARPA Cc: SCHEME@MIT-MC.ARPA, t-discussion@YALE.ARPA, gls@THINK-AQUINAS.ARPA In-Reply-To: <860401152644.7.RHH@ASPEN.LCS.MIT.EDU> Message-Id: <860403103623.3.GLS@THINK-KATHERINE.ARPA> I haven't checked the manuals for T or Scheme but it was certainly the intent that the list passed to APPLY is unrelated to the list that a rest-parameter gets bound to. The rest-list should always be freshly consed, so e.g. the procedure LIST is equivalent to (LAMBDA X X). The last argument to APPLY must be a proper list. I think Common Lisp takes the same stance. A quick scan of the Common Lisp book leaves the question unresolved; maybe Guy Steele could comment. This question came up recently on the Common-Lisp mailing list. The unofficial consensus, as I understood it, was that the book is vague on this point and requires correcting; that the last argument to APPLY should be a proper list; and that a list passed as an argument to APPLY might or might not share list structure with an eventual &REST argument resulting from the application. --Guy  Received: from yale-bulldog by MC.LCS.MIT.EDU 4 Apr 86 16:20:25 EST Received: by Yale-Bulldog.YALE.ARPA; 4 Apr 86 12:05:25 EST (Fri) Date: 4 Apr 86 12:05:25 EST (Fri) From: Ashwin Ram Message-Id: <8604041705.AA18731@Yale-Bulldog.YALE.ARPA> Subject: Kudos To: t-discussion@YALE.ARPA What do you think this will return (i.e., T or NIL): (= (factorial 1999) (/ (factorial 2000) 2000)) where FACTORIAL is the obvious non-tail-recursive implementation of the factorial function? (Remember that (factorial 2000) is a VERY big number.) Well, I tried it. After three garbage collections, it finally returned with --- did you guess it? --- T !!! Hats off to the T implementors! Ashwin. -------  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 8 Apr 86 00:27:31 EST Received: from OZ.AI.MIT.EDU (mc.lcs.mit.edu.ARPA) by yale-cheops.YALE.ARPA; Tue, 8 Apr 86 00:14:37 est Received: from SINATRA.AI.MIT.EDU by OZ.AI.MIT.EDU via Chaosnet; 8 Apr 86 00:09-EST Date: Tue, 8 Apr 86 00:09 EST From: Scott W. Layson Subject: Tables returning nil if no value To: JAR@MIT-MC.ARPA Cc: T-Discussion@YALE.ARPA In-Reply-To: <[MC.LCS.MIT.EDU].862572.860326.JAR> Message-Id: <860408000949.1.GYRO@SINATRA.AI.MIT.EDU> Date: Wed, 26 Mar 86 14:09:43 EST From: Jonathan A Rees The correct way to deal with lookup failure is NOT to return a second found? value, but instead to either build failure into the language (as in Prolog, Snobol, or Icon, or zetalisp's condition system), or to pass multiple continuations (like PDP-10 assembly language programmers do): Perhaps the correct way to carry on this discussion is not to introduce proposals as "the correct way..."? (table-entry table key (lambda (val) ... success ...) (lambda () ... failure ...)) Given that neither of these alternatives seems particularly realistic (the first because it's too drastic and the second because it's just as cumbersome as dealing with multiple values), I think the way it is is better. Is dealing with multiple values all that cumbersome? I don't have my T manual with me, so can't check, but I wrote a macro NLET for ZetaLisp that allows, among others, the following syntax: (nlet ((found? value (table-entry table key))) ... body ...) i.e., in each clause, all forms but the last are symbols to be bound to the values returned by the last form. It expands, of course, to the much less pretty MULTIPLE-VALUE-BIND. In this particular case, however, I must say I like the semantics of Jon's multiple-continuation approach (because it avoids the bugaboo of having some variable, e.g. VALUE in the above example, bound to an undefined value). My experience with such things is that if the semantics is right, it's worth the effort to fiddle with the syntax until it's no longer cumbersome. In this case, it's easy enough to have the default continuation be used in case of success, so only one extra need be specified: (table-entry-efc table key (lambda () ... failure ...)) where "efc" stands for "explicit failure continuation". Then it's easy enough to define table-entry in terms of table-entry-efc. (One can imagine -EFC versions of most if not all system primitives. Somehow, allowing the user explicit access to these strikes me as far more elegant than ZetaLispoid CONDITION-BIND and other such. It would also bring the "error handler" out into the open, in the sense that somewhere there would be code that defined + in terms of +-EFC, etc., which the user could read and create her own versions of.) There's a whole 'nother approach to problems like this that I may as well mention, for completeness. TABLE-ENTRY could return an object which supported FOUND? and VALUE operations. I think it would be very worthwhile to teach the compiler to implement this essentially identically to the multiple-value version (i.e. without ever consing the object in the heap (assuming the situation is such that that's not strictly necessary)). -- Scott  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 9 Apr 86 00:58:19 EST Received: from MC.LCS.MIT.EDU (mc.lcs.mit.edu.ARPA) by yale-cheops.YALE.ARPA; Wed, 9 Apr 86 00:45:29 est Date: Wed, 9 Apr 86 00:41:53 EST From: Jonathan A Rees Subject: correctness To: x.Gyro@OZ.AI.MIT.EDU Cc: T-Discussion@YALE.ARPA In-Reply-To: Msg of Tue 8 Apr 86 00:09 EST from Scott W. Layson Message-Id: <[MC.LCS.MIT.EDU].878387.860409.JAR> Date: Tue, 8 Apr 86 00:09 EST From: Scott W. Layson Perhaps the correct way to carry on this discussion is not to introduce proposals as "the correct way..."? ... My apologies, I meant to put the word "correct" in quote marks. Being a not-quite-reformed assembly language hacker, I prefer multiple continuations to boolean return values because they feel more direct and efficient to me. It takes work to generate different boolean values in different places, then merge to a common point of control, then immediately test the boolean value to produce divergent streams of control again. Better to make use of the information directly and avoid the encoding and decoding. This is just one of my personal, idiosyncratic stylistic principles (the "avoid encoding/decoding" principle) which I don't expect everyone to agree with, and I admit that the notation can be cumbersome. [And don't get me wrong - I'm not saying there's a compiler out there which does nearly as well with multiple continuations as an assembly language programmer does; TC's object code would cons up a storm creating those continuations. But I wouldn't say such a compiler is impossible either. Certainly special cases of this exist all over the place in higher-level languages, for example the FOO(A, B, &4=123, &8=2000) feature of IBM FORTRAN (do I remember the syntax correctly? it involved ampersands, I know), signalling in CLU, etc. It ought be possible to get a Scheme compiler to generate equivalent or better code from the more general surface language.] Jonathan  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 10 Apr 86 16:17:13 EST Received: by yale-cheops.YALE.ARPA; Thu, 10 Apr 86 14:54:12 est Date: Thu, 10 Apr 86 14:54:12 est Message-Id: <8604101954.AA19580@yale-cheops.YALE.ARPA> To: t-discussion@YALE.ARPA From: The Deputy Postmaster Subject: Validity Test of the t-discussion mailing list Reply-To: ortiz-luis@yale.arpa This is a test of the t-discussion mailing list. We at Yale University are trying to keep mailing lists under our administration up to date. We are therefore sending mail to each and every list in an effort to weed out bad addresses. If you find that you are getting mail from a mailing list that you do not wish to be on, please send mail to " DB-CHANGES@YALE.ARPA " requesting that you be removed. Thank you for your patience. Luis F. Ortiz Deputy Postmaster General Yale University P.S. The members and mailing list properties are as follows: ** Mailing list T-Discussion Purpose: Discussion of the shape of the T language and implementation Maintainer: postmaster@Yale Recipients: T-Discussion-Except-Yale@MIT-MC.Arpa, T-Discussion-Yale: 't_discussion@Yale-Ring, Adams-Norman, arpa.t-discussion-news@Yale-Cheops, Baldwin-Douglas, Ellis-John, Johnson-Lewis, Mcdermott-Drew, Mishkin-Nathaniel, Nix-Robert, Odonnell-John, Philbin-Jim, Riesbeck-Chris, Shivers-Olin  Received: from yale-bulldog by MC.LCS.MIT.EDU 30 Jun 86 23:10:38 EDT Received: by Yale-Bulldog.YALE.ARPA; 30 Jun 86 16:34:57 EDT (Mon) Date: 30 Jun 86 16:34:57 EDT (Mon) From: Stephen Slade Message-Id: <8606302034.AA16592@Yale-Bulldog.YALE.ARPA> Subject: T Book To: ai-local@YALE.ARPA, t-discussion@YALE.ARPA A complete draft of my book "The T Programming Language: A Dialect of LISP" is now available for the casual reader. You may obtain copies from Audubon Copy Shop on Whitney Avenue or from the facility office. Prentice-Hall will publish the book this fall. -------  Received: from yale-bulldog by MC.LCS.MIT.EDU 2 Jul 86 17:18:33 EDT Received: by Yale-Bulldog.YALE.ARPA; 2 Jul 86 16:21:40 EDT (Wed) Date: 2 Jul 86 16:21:40 EDT (Wed) From: Stephen Slade Message-Id: <8607022021.AA15424@Yale-Bulldog.YALE.ARPA> Subject: Re: T book To: t-discussion@YALE.ARPA I have received several inquiries from people outside Yale interested in receiving a copy of the T book. To get a copy of the manuscript, send your US mail address to: perrelli@yale It is not feasible to transmit the manuscript source files. However, the source code from the book's examples, exercises, and answers will be included in the upcoming release of T. The manuscript is over 400 pages, so we don't want to get involved with massive copying efforts. Therefore, we will send only one copy to each institution, and request that the recipients make that copy available for others to read or copy. The publisher (Prentice-Hall) has informed me that the book should be "in-stock" before Thanksgiving. To give you an idea of the level of the text, I quote from the preface: This book is not an introductory programming text. Rather, it is for students who have already learned to program in some language other than LISP. Given the ready access most students have to computers these days, it is rare to find a college student interested in computers who has not previously been exposed to programming. The odds are pretty good that a student's first programming language was not LISP... The T language has been used in range of college courses including artificial intelligence, data structures, computer systems, and compiler design. The present book is suitable as a companion text in such courses. Here are the chapter titles: 1 LISP and T 1 2 A Tutorial Introduction 6 3 Lists 34 4 Recursion 60 5 Local vs Global Reference 79 6 Characters and Strings 92 7 Ports: Output and Input 110 8 LAMBDA and LABELS 131 9 Control 149 10 Debugging 174 11 Macros 192 12 Structures 220 13 Objects and Operations 237 14 Vectors 259 15 Environments and EVAL 290 16 Efficiency and Compilation 321 17 Implementation of T 339 Appendices: A List of LISP's 348 Discusses differences between T, Scheme, and Common LISP. Provides compatability packages for T-in-Scheme and T-in-CommonLISP (!?). B ASCII Character Codes 365 C Answers to Selected Exercises 369 D References 409 We shall also maintain an electronic mailing list for corrections, additions, and suggestions. (Discussed in Appendix A). Note also that the book is based on the new version of T, aka T3. Thus, we speak of ports instead of streams, along with other minor changes. -------  Received: from yale-cheops.YALE.ARPA by MC.LCS.MIT.EDU 13 Jul 86 15:27:55 EDT Received: from ll-vlsi.ARPA (ll-vlsi.arpa.ARPA) by yale-cheops.YALE.ARPA; Fri, 11 Jul 86 16:55:02 edt Received: by ll-vlsi.ARPA (4.12/4.7) id AA06369; Fri, 11 Jul 86 17:02:53 edt Date: Fri, 11 Jul 86 17:02:53 edt From: jjh@ll-vlsi.ARPA (Jim Hunt) Message-Id: <8607112102.AA06369@ll-vlsi.ARPA> To: T-Discussion@YALE.ARPA Subject: Expert System Tools Does anyone know if there are any expert system building languages, e.g. OPS5, available that are implemented in T or could be easily ported to T? Please send replies to JJH@LL-VLSI. Thanks, JJHunt  Received: from yale-bulldog by MC.LCS.MIT.EDU 17 Jul 86 14:49:23 EDT Received: by Yale-Bulldog.YALE.ARPA; 17 Jul 86 13:53:34 EDT (Thu) Date: 17 Jul 86 13:53:34 EDT (Thu) From: Robert Farrell Message-Id: <8607171753.AA17099@Yale-Bulldog.YALE.ARPA> Subject: LOOPS To: t-discussion@YALE.ARPA Has anyone heard of a LOOPS being ported to Scheme or T? -- Rob -------  Received: from MX.LCS.MIT.EDU by MC.LCS.MIT.EDU via Chaosnet; 7 AUG 86 04:34:17 EDT Date: Thu, 7 Aug 86 04:30:58 EDT From: Jonathan A Rees Subject: non-list arguments To: rhh@MC.LCS.MIT.EDU cc: scheme@MC.LCS.MIT.EDU, t-discussion@MC.LCS.MIT.EDU In-reply-to: Msg of Tue 1 Apr 86 15:26 EST from Robert Halstead Message-ID: <[MX.LCS.MIT.EDU].939050.860807.JAR> Date: Tue, 1 Apr 86 15:26 EST From: Robert Halstead To summarize, I think it should be permissible for (eq? ((lambda x x) l) l) to return true, but it should not be a requirement. Furthermore, it should be permissible for an implementation to report an error if l in the above expression is not a true list, but an implementation should not be required to do so. Of course, it would still be true that ((lambda x x) 3 4 5) would return a freshly consed list, just like (list 3 4 5). An interesting question: do people expect (apply list l) to return a top-level copy of l? -b. Permitting sharing between the argument passed to apply and the rest-argument leads to all kinds of obscure bugs - especially if sharing isn't guaranteed. In fact I have written and used interpreters which shared the list, and I regretted it every time. Efficiency shouldn't guide the design on this issue. A compiler could easily detect the situation you described (a rest-variable referenced only as the last argument to APPLY) and generate code which doesn't cons. Jonathan  Received: from AI.AI.MIT.EDU by MC.LCS.MIT.EDU via Chaosnet; 15 AUG 86 16:46:38 EDT Date: Fri, 15 Aug 86 16:47:19 EDT From: Jonathan A Rees Subject: LOOPS To: T-Discussion@MC.LCS.MIT.EDU In-reply-to: Msg of 17 Jul 86 13:53:34 EDT (Thu) from Robert Farrell Message-ID: <[AI.AI.MIT.EDU].84187.860815.JAR> Date: 17 Jul 86 13:53:34 EDT (Thu) From: Robert Farrell To: t-discussion at YALE.ARPA Re: LOOPS Message-Id: <8607171753.AA17099@Yale-Bulldog.YALE.ARPA> Has anyone heard of a LOOPS being ported to Scheme or T? Did you ever track down Texas Instruments' SCOOPS? I know it's available for free, but I forget from whom. - Jonathan  Received: from yale-eli.YALE.ARPA by MC.LCS.MIT.EDU 15 Oct 86 08:53:41 EDT Received: from mitre-bedford.ARPA (mitre-bedford.arpa.ARPA) by yale-eli.YALE.ARPA; Wed, 15 Oct 86 01:51:42 edt Organization: The MITRE Corp., Bedford, MA Received: by faron.MENET (4.12/4.7) id AA01564; Wed, 15 Oct 86 08:25:01 edt Date: Wed, 15 Oct 86 08:25:01 edt From: John D. Ramsdell Posted-Date: Wed, 15 Oct 86 08:25:01 edt Message-Id: <8610151225.AA01564@faron.MENET> To: t-discussion@yale.ARPA Subject: T types not objects? In the CommonLoops paper from OOPSLA '86, it was stated that "there is no integration of Lisp types with objects" (p. 26). News to me. I thought that all types behaved as objects to which I can send messages. The print operation comes to mind. It works on user defined objects as well as simple data objects like pairs. Could it be that they are complaining about the fact that the interface used to modify handlers of simple data objects is unreleased? John  Received: from yale-celray.YALE.ARPA (TCP 20011000031) by MC.LCS.MIT.EDU 15 Dec 86 18:48:28 EST Received: by yale-celray.YALE.ARPA; Mon, 15 Dec 86 14:56:21 est Date: Mon, 15 Dec 86 14:56:21 est From: slade-stephen@YALE.ARPA Message-Id: <8612151956.AA16959@yale-celray.YALE.ARPA> Received: by yale-ring (node-aac4.ring.cs.yale.edu/AAC4) via WIMP-MAIL ($Revision: 1.1 $) ; Mon Dec 15 14:43:08 Subject: T Book To: t-discussion@YALE.ARPA It's out (just in time for Christmas). "The T Programming Language: A Dialect of LISP" Stephen Slade. Prentice-Hall, Inc., 1987, 448pp, $19.95. Telephone orders via (201) 767-5049. ------- -------  Received: from yale-eli.YALE.ARPA (TCP 20011000001) by MC.LCS.MIT.EDU 16 Dec 86 13:03:03 EST Received: from bass.ARPA (nosc.arpa.ARPA) by yale-eli.YALE.ARPA; Tue, 16 Dec 86 09:24:06 est Received: by bass.ARPA (5.31/4.7) id AA23821; Tue, 16 Dec 86 09:43:22 PST Received: by vis.uucp (1.1/SMI-3.0DEV3) id AA09369; Tue, 16 Dec 86 09:06:47 PST Date: Tue, 16 Dec 86 09:06:47 PST From: vis!greg@nosc.ARPA (J. Greg Davidson) Message-Id: <8612161706.AA09369@vis.uucp> To: slade-stephen@YALE.ARPA Cc: t-discussion@YALE.ARPA In-Reply-To: Stephen Slade's message of Mon, 15 Dec 86 14:56:21 EST Subject: Re: T Book According to the publisher, the price was increased to $23.?? on 1 Dec. (I forget the exact amount). Now that I've ordered the book, I would like to again inquire about the availability of T on SUN Workstations. I have a SUN-2 running SUN's 3.0 O/S. Is T available yet on the SUN? _Greg  Received: from yale-eli.YALE.ARPA (TCP 20011000001) by MC.LCS.MIT.EDU 17 Dec 86 17:01:10 EST Received: by yale-eli.YALE.ARPA; Wed, 17 Dec 86 16:25:55 est Date: Wed, 17 Dec 86 16:25:55 est From: Stephen Slade Message-Id: <8612172125.AA05710@yale-eli.YALE.ARPA> Received: by yale-ring (node-aac4.ring.cs.yale.edu/AAC4) via WIMP-MAIL ($Revision: 1.1 $) ; Wed Dec 17 16:20:32 Subject: Re: T Book To: vis!greg@nosc.ARPA (J. Greg Davidson) Cc: slade-stephen@YALE.ARPA, t-discussion@YALE.ARPA In-Reply-To: vis!greg@nosc.ARPA (J. Greg Davidson), Tue, 16 Dec 86 09:06:47 PST According to the publisher, the price was increased to $23.?? on 1 Dec. (I forget the exact amount). Now that I've ordered the book, I would like to again inquire about the availability of T on SUN Workstations. I have a SUN-2 running SUN's 3.0 O/S. Is T available yet on the SUN? _Greg I just spoke with my editor who assures me that the price is actually $19.95. With whom did you speak? Maybe Oliver North is now working for Prentice-Hall, marking up prices, and sending the difference to the Contras. T is available on the Sun, Apollo, and HP workstations, as well as the VAX. --Stephen ------- -------  Received: from yale-eli.YALE.ARPA (TCP 20011000001) by MC.LCS.MIT.EDU 13 Feb 87 01:47:41 EST Received: from mitre-bedford.ARPA (mitre-bedford.arpa.ARPA) by yale-eli.YALE.ARPA; Fri, 13 Feb 87 01:34:56 est Posted-From: The MITRE Corp., Bedford, MA Received: by linus.MENET (1.1/4.7) id AA13493; Thu, 12 Feb 87 15:07:31 EST Date: Thu, 12 Feb 87 15:07:31 EST From: John D. Ramsdell Posted-Date: Thu, 12 Feb 87 15:07:31 EST Message-Id: <8702122007.AA13493@linus.MENET> To: t-discussion@yale.ARPA Subject: T & Emacs Cc: ramsdell@mitre-bedford.ARPA Thanks to Jonathan Rees, tea mode for emacs gives us T users a nice programming environment in which to interact with T. Etags is a program that creates tag files for use with Emacs. The etags distributed with Emacs does not know that ".t" is the extension of a lisp like language, and thus makes bogus tag files for T. The fix is simple, just modify the extensions recognized by emacs as lisp files. The diff follows. John --------------------------------------------- 364c364 < /* .l or .el or .lisp (or .cl or .clisp or .t!) implies lisp source code */ --- > /* .l or .el or .lisp (or .cl or .clisp or ...) implies lisp source code */ 366d365 < !strcmp (cp + 1, "t") ||  Received: from yale-eli.arpa (TCP 20011000001) by MC.LCS.MIT.EDU 5 Jun 87 11:55:48 EDT Received: from mitre-bedford.ARPA by yale-eli.arpa; Fri, 5 Jun 87 11:14:51 EDT Full-Name: Posted-From: The MITRE Corp., Bedford, MA Received: by linus.research (3.2/4.7) id AA00960; Fri, 5 Jun 87 11:19:07 EDT Date: Fri, 5 Jun 87 11:19:07 EDT From: Thom Brando Posted-Date: Fri, 5 Jun 87 11:19:07 EDT Message-Id: <8706051519.AA00960@linus.research> To: t-discussion@YALE.ARPA Subject: please add me to t list Please add me to the t-discussion mailing list. Thanks. Thom Brando linus!brando@MITRE-BEDFORD.{ARPA,BITNET,CSNET} 617-271-3947 {allegra,decvax,ihnp4,philabs,...}!linus!brando.UUCP  Received: from yale-celray.arpa (TCP 20011000031) by MC.LCS.MIT.EDU 12 Jun 87 12:38:48 EDT Received: by yale-celray.arpa; Fri, 12 Jun 87 11:52:56 EDT Date: Fri, 12 Jun 87 11:52:56 EDT From: James F Philbin Full-Name: James F Philbin Message-Id: <8706121552.AA05288@yale-celray.arpa> Received: by yale-ring (node-aac0.ring.cs.yale.edu/AAC0) via WIMP-MAIL (Version 1.2/1.4) ; Fri Jun 12 11:42:46 Subject: Re: A missing function that bugs me. To: James Firby Cc: t-users@YALE.ARPA In-Reply-To: James Firby , Wed, 3 Jun 87 21:22:38 EDT Doesn't it seem to anyone else that T ought to have a function meaning (NOT (NULL? x))? ... Any ideas on names, I could live with NOT-NULL?. I'm not sure another name is needed, but wouldn't NON-NULL? be better? - Jim -------  Received: from yale-eli.arpa (TCP 20011000001) by MC.LCS.MIT.EDU 12 Jun 87 17:09:40 EDT Received: from neptune.CS.UCLA.EDU by yale-eli.arpa; Fri, 12 Jun 87 14:53:55 EDT Received: by neptune.CS.UCLA.EDU (Sendmail 5.54/5.14) id AA04950; Fri, 12 Jun 87 11:58:49 PDT Message-Id: <8706121858.AA04950@neptune.CS.UCLA.EDU> To: James F Philbin Cc: James Firby , t-users@YALE.ARPA Subject: Re: A missing function that bugs me. In-Reply-To: Your message of Fri, 12 Jun 87 11:52:56 EDT. <8706121552.AA05288@yale-celray.arpa> Date: Fri, 12 Jun 87 11:58:47 PDT From: mujica@CS.UCLA.EDU ---- your message ---- Doesn't it seem to anyone else that T ought to have a function meaning (NOT (NULL? x))? ... Any ideas on names, I could live with NOT-NULL?. I'm not sure another name is needed, but wouldn't NON-NULL? be better? - Jim ------- I would certainly like to have something like that, NOT or NON don't make a difference. In any case I would like MUCH BETTER to stick to the convention the nil stands for false and non null stands for true. -------------- Sergio Mujica, mujica@cs.ucla.edu ...!{sdcrdcf,ucbvax}!ucla-cs!mujica 3804 Boelter Hall, Computer Science Department, UCLA (213) 825-7276  Received: from yale-celed.arpa (TCP 20011000034) by MC.LCS.MIT.EDU 16 Jun 87 15:50:48 EDT Received: by yale-celed.arpa; Tue, 16 Jun 87 15:11:00 EDT Date: Tue, 16 Jun 87 15:11:00 EDT From: Ashwin Ram Full-Name: Ashwin Ram Message-Id: <8706161911.AA29893@yale-celed.arpa> Received: by yale-ring (node-abc3.ring.cs.yale.edu/ABC3) via WIMP-MAIL (Version 1.2/1.4) ; Tue Jun 16 15:02:33 To: t-users@YALE.ARPA Subject: WATCH package for T3 ? Does anyone have a WATCH or PROFILE package for T3 that allows one to collect time, calls, and space statistics for a set of functions during the evaluation of a given form? -- Ashwin.  Received: from yale-eli.arpa (TCP 20011000001) by MC.LCS.MIT.EDU 16 Jun 87 23:08:58 EDT Received: from zeus.CS.UCLA.EDU ([128.97.2.2]) by yale-eli.arpa; Tue, 16 Jun 87 22:20:36 EDT Received: by zeus.CS.UCLA.EDU (Sendmail 5.54/5.14) id AA11674; Tue, 16 Jun 87 19:26:38 PDT Message-Id: <8706170226.AA11674@zeus.CS.UCLA.EDU> To: Ashwin Ram Cc: t-users@YALE.ARPA Subject: Re: WATCH package for T3 ? In-Reply-To: Your message of Tue, 16 Jun 87 15:11:00 -0400. <8706161911.AA29893@yale-celed.arpa> Date: Tue, 16 Jun 87 19:26:34 PDT From: srt@CS.UCLA.EDU Well, I suspect you already have this, but here is "profile.t". I don't recall where I originally found it. -- Scott (herald profile (env tsys)) ;;; The beginings of a profiler. (define (make-uid_$t) (make-bytev 8)) (define-foreign proc2_$who_am_i (proc2_$who_am_i (ignore rep/extend my-uid)) ignore) (define (make-proc2_$info_t) (make-bytev 112)) (define (cpu_total.high info) (mref-integer info 28)) (define (cpu_total.low info) (mref-16-u info 28)) (define (priv_faults info) (mref-integer info 86)) (define (glob_faults info) (mref-integer info 90)) (define (disk_page_io info) (mref-integer info 94)) (define (net_page_io info) (mref-integer info 98)) (define-foreign proc2_$get_info (proc2_$get_info (ignore rep/extend process-uid) (out rep/extend info) (in rep/integer-16-u info-buf-length) (out rep/integer status)) ignore) (define (make-time_$clock_t) (make-bytev 6)) (define-foreign time_$clock (time_$clock (ignore rep/extend clock)) ignore) (define-syntax (monitor . expr) `(let ((thunk (lambda () ,@expr))) (%monitor 1 thunk))) (define-syntax (bench repetitions . expr) `(let ((thunk (lambda () ,@expr))) (%monitor ,repetitions thunk))) ;++ why is cpu sometime greater than elapsed? ;++ make this machine independent ********* (let ((pid (make-uid_$t)) (start (make-time_$clock_t)) (stop (make-time_$clock_t)) (pstart (make-proc2_$info_t)) (pstop (make-proc2_$info_t))) (define (%monitor repetitions thunk) (proc2_$who_am_i pid) (let ((heap-start (process-global task/area-frontier))) (time_$clock start) (proc2_$get_info pid pstart 112 nil) (let ((val (iterate loop ((i 1)) (cond ((fx>= i repetitions) (thunk)) (else (thunk) (loop (fx+ i 1))))))) (proc2_$get_info pid pstop 112 nil) (time_$clock stop) (let* ((heap-stop (process-global task/area-frontier)) (cells (fx- heap-stop heap-start)) (etime (- (clock->bignum stop) (clock->bignum start))) (cpu (- (info->cpu pstop) (info->cpu pstart))) (priv (fx- (priv_faults pstop) (priv_faults pstart))) (glob (fx- (glob_faults pstop) (glob_faults pstart))) (disk (fx- (disk_page_io pstop) (disk_page_io pstart))) (net (fx- (net_page_io pstop) (net_page_io pstart)))) (let ((factor (* 250000 repetitions))) (format t "~&;Elapsed time = ~a.~a CPU time = ~a.~a~%" (quotient etime factor) (remainder etime factor) (quotient cpu factor) (remainder cpu factor))) (format t "~&;Page faults: Private = ~a Global = ~a Disk = ~a Net = ~a~%" (quotient priv repetitions) (quotient glob repetitions) (quotient disk repetitions) (quotient net repetitions)) (format t "~&;Consed ~s longwords~%" cells) val))))) (define (info->cpu info) (+ (ash (mref-16-u info 28) 32) (ash (mref-16-u info 30) 16) (mref-16-u info 32))) (define (clock->bignum clock) (+ (ash (mref-16-u clock 0) 32) (ash (mref-16-u clock 2) 16) (mref-16-u clock 4)))  Received: from inmet.inmet.com (TCP 3201200110) by MC.LCS.MIT.EDU 21 Jun 87 10:27:58 EDT Received: by inmet.inmet.com (5.51/inmet.com) id AA07438; Sun, 21 Jun 87 10:26:03 EDT Date: Sun, 21 Jun 87 10:26:03 EDT From: jose@inmet.inmet.com (Jose Oglesby) Message-Id: <8706211426.AA07438@inmet.inmet.com> To: t-users@mc.lcs.mit.edu Subject: Questions from a new user Can anyone out there help? I am interested in calling foreign language functions from T. In particular, I would like to be able to use the graphics libraries on the Sun. My T manual and the T Programming Languages book do not give any information about the define-foreign special form. While I am at it, I have also had some difficulties running the functions in the file unix_utilities.t of the distribution. The file loads and compiles fine but when the functions are invoked the variable *system-xenoid* is undefined. One final request : Does anyone have an implementation of engines or other multiprocessing models for T? Thanks for any and all help. Jose Oglesby U.S. Mail : c/o Intermetrics Inc 733 Concord Ave Cambridge MA 02138  Received: from yale-celray.arpa (TCP 20011000031) by MC.LCS.MIT.EDU 30 Jun 87 15:29:36 EDT Received: by yale-celray.arpa; Mon, 29 Jun 87 16:07:34 EDT Date: Mon, 29 Jun 87 16:07:34 EDT From: Ashwin Ram Full-Name: Ashwin Ram Message-Id: <8706292007.AA01671@yale-celray.arpa> Received: by yale-ring (node-abc3.ring.cs.yale.edu/ABC3) via WIMP-MAIL (Version 1.2/1.4) ; Mon Jun 29 15:54:53 To: t-users@YALE.ARPA Subject: OPERATION NOT HANDLED What's the best way of "trapping" a "operation not handled" error, in the sense of being able to specify an action rather than break with the usual error? For example, consider a procedure (or operation) that would behave like WHERE-DEFINED, except it would return NIL (rather than breaking) if the object didn't handle the WHERE-DEFINED operation (e.g., tables and read-tables don't). Is there any way to find out if a given object handles a given operation before calling it, or any way to trap the resulting error if it does get called? -- Ashwin. ARPA: Ram-Ashwin@yale UUCP: {decvax,linus,seismo}!yale!Ram-Ashwin BITNET: Ram@yalecs  Received: from yale-eli.arpa (TCP 20011000001) by MC.LCS.MIT.EDU 30 Jun 87 22:08:33 EDT Received: from zeus.CS.UCLA.EDU ([128.97.2.2]) by yale-eli.arpa; Tue, 30 Jun 87 20:32:35 EDT Full-Name: Received: by zeus.CS.UCLA.EDU (Sendmail 5.54/5.14) id AA29816; Tue, 30 Jun 87 16:40:48 PDT Message-Id: <8706302340.AA29816@zeus.CS.UCLA.EDU> To: Ashwin Ram Cc: t-users@YALE.ARPA Subject: Re: OPERATION NOT HANDLED In-Reply-To: Your message of Mon, 29 Jun 87 16:07:34 -0400. <8706292007.AA01671@yale-celray.arpa> Date: Tue, 30 Jun 87 16:40:46 PDT From: srt@CS.UCLA.EDU > ...For example, consider a procedure (or operation) that would behave >like WHERE-DEFINED, except it would return NIL (rather than breaking) if the >object didn't handle the WHERE-DEFINED operation (e.g., tables and >read-tables don't). I think the default body of DEFINE-OPERATION will handle this for you, i.e., (define-operation (where-defined foo) nil) will cause NIL to be returned if WHERE-DEFINED isn't defined. Scott R. Turner UCLA Computer Science "Are we controlled by secret forces?" Domain: srt@ucla.cs.edu UUCP: ...!{cepu,ihnp4,trwspp,ucbvax}!ucla-cs!srt  Received: from yale-eli.arpa (TCP 20011000001) by MC.LCS.MIT.EDU 30 Jun 87 23:46:17 EDT Received: by yale-eli.arpa; Tue, 30 Jun 87 22:31:55 EDT Date: Tue, 30 Jun 87 22:31:55 EDT From: Ashwin Ram Full-Name: Ashwin Ram Message-Id: <8707010231.AA06489@yale-eli.arpa> Received: by yale-ring (node-abc3.ring.cs.yale.edu/ABC3) via WIMP-MAIL (Version 1.2/1.4) ; Tue Jun 30 22:28:54 To: srt@CS.UCLA.EDU Cc: t-users@YALE.ARPA In-Reply-To: srt@CS.UCLA.EDU's logical message of Tue, 30 Jun 87 16:40:46 PDT Subject: Re: OPERATION NOT HANDLED > I think the default body of DEFINE-OPERATION will handle this for you, i.e., > > (define-operation (where-defined foo) nil) > > will cause NIL to be returned if WHERE-DEFINED isn't defined. I know about default methods. Sorry, I guess I didn't state the problem clearly enough since I got a couple of replies that basically said the same thing. I want to take an EXISTING operation 'foo' and write another one that calls 'foo' if the object handles 'foo', but returns 'nil' (instead of breaking) if the object does not handle 'foo'. I used 'where-defined' as an example, in which I wanted to define a NEW operation that behaved like 'where-defined' but returned 'nil' for, say, a read-table. I could, of course, just redefine 'foo' but (a) I then lose whatever default method 'foo' had, and (b) assuming 'foo' is part of a package/tool (or a T3 thing like 'where-defined'), it doesn't seem clean to redefine it (plus it could possibly break with new versions of the package or even due to other uses of that operation by the package that I didn't anticipate). What I would like is something like: (let ((package-foo (*value package-env 'foo))) (define-operation (foo x) ...use package-foo if possible... ...else use my default...)) rather than: (eval '(define-operation (foo x) ...) package-env) -- Ashwin.  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 1 Jul 87 13:19:28 EDT Date: Wed, 1 Jul 87 13:19:54 EDT From: Jonathan A Rees Subject: OPERATION NOT HANDLED To: ram-ashwin@YALE.ARPA cc: srt@CS.UCLA.EDU, t-users@MC.LCS.MIT.EDU Message-ID: <222139.870701.JAR@AI.AI.MIT.EDU> I think there used to be a HANDLES? predicate in T, but maybe it got removed. Check in the implementation environment. Note that the predicate always returned true for operations that had default methods, since all objects handle such operations (by invoking the operation's default method). The problem with a HANDLES? predicate (and the reason that it got flushed, if it was) is that it necessarily makes the dispatch mechanism a little more complicated. Right now it's totally procedural -- you just tell the object to deal with the operation -- but the existence of HANDLES? implies either doing things in two stages (get the method, then either invoke it or return a boolean) or keeping some sort of database of the methods around so that it can be inspected without actually invoking any method. Also it seems sort of artificial to distinguish a default method that signals an error from no default method. It is nice to be able to implement the latter as the former. As for WHERE-DEFINED, I think it would be a good idea for it to have a default method that returns #f.  Received: from yale-eli.arpa (TCP 20011000001) by MC.LCS.MIT.EDU 6 Aug 87 16:35:50 EDT Received: from maui.cs.ucla.edu ([128.97.2.26]) by yale-eli.arpa; Thu, 6 Aug 87 16:11:14 EDT Return-Path: Received: by maui.cs.ucla.edu (Sendmail 5.57/1.04) id AA10611; Thu, 6 Aug 87 13:15:40 PDT Date: Thu, 6 Aug 87 13:15:40 PDT From: srt@CS.UCLA.EDU (Scott Turner) Message-Id: <8708062015.AA10611@maui.cs.ucla.edu> To: t-users@YALE.ARPA Subject: Release Display in *Pre-GC-Agenda* ? ------- If you are doing graphics on an Apollo from T, should you release the display in the pre-gc agenda and then reacquire (the appropriate # of times) in the post-gc agenda? There is some claim that this doesn't work and/or screws up the graphics. Any truth to this? What environment is *pre-gc-agenda* in? What do the elements look like (i.e., are they argumentless lambdas)? Can you code these as normal T, or do you have to worry about interactions with the GC? Anyone have the release/reacquire written for T3? If so, could you send it to me? thanx -- Scott  Received: from yale-eli.arpa (TCP 20011000001) by MC.LCS.MIT.EDU 6 Aug 87 19:45:49 EDT Received: by yale-eli.arpa; Thu, 6 Aug 87 16:31:10 EDT Date: Thu, 6 Aug 87 16:31:10 EDT From: James Firby Full-Name: James Firby Message-Id: <8708062031.AA06070@yale-eli.arpa> Received: by yale-ring (node-ad56.ring.cs.yale.edu/AD56) via WIMP-MAIL (Version 1.2/1.4) ; Thu Aug 6 16:33:14 Subject: Re: Release/reacquire in T3 To: srt@cs.ucla.edu Cc: t-users@YALE.ARPA I've been writing some graphics stuff for the Apollos in T3 and was forced to write the function supplied below to do the right thing when (error ...) is called. I haven't thought about what to do about GC yet. Let me know when you find out how *pre-gc-agenda* works. The release/reacquire in the error function works just fine unless the process is waiting on event input. If something happens then (I'm guessing a GC can't) one seems to be out of luck. Also, the error function itself should be extended a little deeper (or augmented with another) to handle T VM faults. It doesn't do the right thing when one occurs. Good luck with this code. Jim ; ------------------------------------------------------------------------------ ; ; Written by: R. James Firby ; ; ------------------------------------------------------------------------------ ; ** Patch to the T System so that errors don't kill the GPR System ; ----------------------------------------------------------------- ; ; (1) Create a new error that doesn't choke when GPR running ; (2) Make the new error available in all the usual places ; ; This could be a lot more robust but should be fine for most users. (set (*value t-implementation-env 'error) (let ( (error-old (*value t-implementation-env 'error)) ) (lambda stuff (receive (count okay) (gpr_$force_release nil nil) (ignore okay) (unwind-protect (apply error-old stuff) (do ( (count count (fx- count 1)) ) ((fx<= count 0) T) (gpr_$acquire_display nil))))))) (import t-implementation-env error) -------  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 17 Aug 87 11:10:10 EDT Received: from mitre-bedford.ARPA by ELI.CS.YALE.EDU; Sat, 15 Aug 87 20:15:14 EDT Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.research (3.2/4.7) id AA02897; Sat, 15 Aug 87 20:23:04 EDT Posted-Date: Sat, 15 Aug 87 20:22:56 EDT Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA07154; Sat, 15 Aug 87 20:22:56 EDT Date: Sat, 15 Aug 87 20:22:56 EDT From: ramsdell%linus@mitre-bedford.arpa Message-Id: <8708160022.AA07154@darwin.sun.uucp> To: alliant!jac.UUCP@seismo.css.gov, t-users@YALE.ARPA, t3-bugs@YALE.ARPA Subject: Alliant T at 192.12.120.51 Cc: ramsdell@mitre-bedford.arpa Alliant T3 is in use at MITRE. At this time, we know of only one problem. Interrupts are not handled correctly, so ^C does not work. Fortunately job control does work so you can kill T with ^Z followed by "kill %t". Alliant T3 is available via anonymous ftp to linus (192.12.120.51). On linus, a compressed tar file, called pub/alliant.tar.Z, contains the binary image and the sources used to create T from sun T3. The previous announcement gave the wrong Internet address. Sorry about that. John  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 17 Aug 87 11:29:42 EDT Received: from mitre-bedford.ARPA by ELI.CS.YALE.EDU; Fri, 14 Aug 87 13:58:32 EDT Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.research (3.2/4.7) id AA20756; Fri, 14 Aug 87 14:03:58 EDT Posted-Date: Fri, 14 Aug 87 14:03:53 EDT Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA06157; Fri, 14 Aug 87 14:03:53 EDT Date: Fri, 14 Aug 87 14:03:53 EDT From: ramsdell%linus@mitre-bedford.arpa Message-Id: <8708141803.AA06157@darwin.sun.uucp> To: t-bugs@mitre-bedford.arpa, alliant!jac.UUCP@seismo.css.gov, t-users@YALE.ARPA Cc: ramsdell@mitre-bedford.arpa Subject: Alliant T3 runs! Alliant T3 is in use at MITRE. At this time, we know of only one problem. Interrupts are not handled correctly, so ^C does not work. Fortunately job control does work so you can kill T with ^Z followed by "kill %t". Alliant T3 is available via anonymous ftp to linus (192.12.120.106). On linus, a compressed tar file, called pub/alliant.tar.Z, contains the binary image and the sources used to create T from sun T3. John  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 18 Aug 87 22:51:52 EDT Received: from Xerox.COM by ELI.CS.YALE.EDU; Tue, 18 Aug 87 22:04:29 EDT Full-Name: Received: from Cabernet.ms by ArpaGateway.ms ; 18 AUG 87 16:48:16 PDT Sender: "James_L_Mayer.WBST128"@Xerox.COM Date: 18 Aug 87 16:45:32 PDT (Tuesday) Subject: T3 documentation (help) From: mayer.WBST128@Xerox.COM To: t-users@YALE.ARPA Cc: mayer.WBST128@Xerox.COM Message-Id: <870818-164816-1529@Xerox> We just received our release of T3 (Sun 3.2, version 3000). Unfortunately, the documentation for the compiler is pretty skimpy. In particular, there is no mention of how to get a listing file, or how do do selective linking. Is there a document on that anywhere? Also, if I wanted to try to recompile the system, how would I go about it? Finally, are there any good things out there that I should know about? -- Jim Mayer (Xerox Corporation)  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 26 Aug 87 08:33:00 EDT Received: from mitre-bedford.ARPA by ELI.CS.YALE.EDU; Wed, 26 Aug 87 08:09:48 EDT Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.research (3.2/4.7) id AA22755; Wed, 26 Aug 87 08:16:18 EDT Posted-Date: Wed, 26 Aug 87 08:15:43 EDT Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA28827; Wed, 26 Aug 87 08:15:43 EDT Date: Wed, 26 Aug 87 08:15:43 EDT From: ramsdell%linus@mitre-bedford.arpa Message-Id: <8708261215.AA28827@darwin.sun.uucp> To: t-discussion@YALE.ARPA Subject: Alliant T3 runs! Alliant T3 is in use at MITRE. At this time, we know of only one problem. Interrupts are not handled correctly, so ^C does not work. Fortunately job control does work so you can kill T with ^Z followed by "kill %t". Alliant T3 is available via anonymous ftp to linus (192.12.120.51). On linus, a compressed tar file, called pub/alliant.tar.Z, contains the binary image and the sources used to create T from sun T3. John  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 27 Aug 87 20:35:38 EDT Received: from src.dec.com by ELI.CS.YALE.EDU; Thu, 27 Aug 87 20:00:27 EDT Received: from jumbo.dec.com by src.dec.com (5.54.3/4.7.34) id AA14122; Thu, 27 Aug 87 17:08:26 PDT Received: by jumbo.dec.com (1.2/4.7.34) id AA04122; Thu, 27 Aug 87 17:08:54 pdt Date: Thu, 27 Aug 87 17:08:54 pdt From: morris@src.DEC.COM (Robert Morris) Message-Id: <8708280008.AA04122@jumbo.dec.com> To: t-users@YALE.ARPA Subject: join I want to have a version of join that gives each of the joined objects an opportunity to handle the operation, and does *not* stop after the first. I don't care what is returned, as I want to modify the joined objects, not query them. Is there some convenient way to do this already that I'm overlooking? Right now I'm rolling my own join using *object, which doesn't appear to be a released T feature. Perhaps the right thing would be to be able to specify join's behaviour on an operation-by-operation basis.  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 1 Sep 87 15:31:47 EDT Received: from wiscvm.wisc.edu by ELI.CS.YALE.EDU; Tue, 1 Sep 87 15:03:22 EDT Message-Id: <8709011903.AA07202@ELI.CS.YALE.EDU> Received: from YALEMED.BITNET by wiscvm.wisc.edu ; Tue, 01 Sep 87 14:11:02 CDT Date: Tue, 1 Sep 87 12:17 EST From: Subject: T Version 3 To: T-USERS@YALE.ARPA X-Original-To: T-USERS@YALE.ARPA, MILLER Does anybody know if T-version 3.0 (or any version of T ) for VAX/VMS > 4.3 is available ? Paul Pharm MILLER@YALEMED.BITNET  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 16 Sep 87 14:30:12 EDT Received: from mitre-bedford.ARPA by ELI.CS.YALE.EDU; Wed, 16 Sep 87 14:02:01 EDT Full-Name: Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.research (3.2/4.7) id AA19000; Wed, 16 Sep 87 14:11:09 EDT Posted-Date: Wed, 16 Sep 87 14:07:20 EDT Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA03928; Wed, 16 Sep 87 14:07:20 EDT Date: Wed, 16 Sep 87 14:07:20 EDT From: ramsdell%linus@mitre-bedford.arpa Message-Id: <8709161807.AA03928@darwin.sun.uucp> To: t-discussion@YALE.ARPA, t-users@YALE.ARPA Subject: Alliant T3 handles interrupts Alliant T3 is in use at MITRE. At this time, we know of no incompatiablities with Sun T3. Interrupts are handled correctly, so ^C does work. Alliant T3 is available via anonymous ftp to linus (192.12.120.51). On linus, a compressed tar file, called pub/alliant.tar.Z, contains the binary image and the sources used to create T from sun T3. John  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 17 Sep 87 14:01:51 EDT Received: from gargoyle.uchicago.edu by ELI.CS.YALE.EDU; Thu, 17 Sep 87 13:40:10 EDT Full-Name: Received: by gargoyle.uchicago.edu from anubis.UChicago.EDU (5.54/1.14) id AA09596; Thu, 17 Sep 87 12:47:10 CDT Received: by anubis.UChicago.EDU (5.52/4.7) id AA20054; Thu, 17 Sep 87 12:46:29 CDT Date: Thu, 17 Sep 87 12:46:29 CDT From: mitchell@anubis.uchicago.edu (Mitchell Marks) Message-Id: <8709171746.AA20054@anubis.UChicago.EDU> To: t-discussion@YALE.ARPA Subject: Please add me to mailing list From mitchell Thu Sep 17 09:46:34 1987 Received: by anubis.UChicago.EDU (5.52/4.7) id AA16183; Thu, 17 Sep 87 09:46:31 CDT Date: Thu, 17 Sep 87 09:46:31 CDT From: mitchell (Mitchell Marks) Message-Id: <8709171446.AA16183@anubis.UChicago.EDU> To: tdiscussion@yale.arpa Subject: Please add me to mailing list Cc: mitchell Status: R Hi. Would you please add me to the T discussion mailing list (and a T news or notices list, if they are distinct), at the following e-mail address: mitchell@anubis.UChicago.EDU The CS Dept here at Chicago uses T on Suns and Apollos for AI and other purposes; there is much interest in T both from a theoretical programming- languages viewpoint and from an applications viewpoint. Thanks very much. Mitchell Marks (graduate student, CS Dept, Univ of Chicago)  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 26 Sep 87 00:18:47 EDT Received: by ATHENA.CS.YALE.EDU; Fri, 25 Sep 87 15:41:37 EDT Date: Fri, 25 Sep 87 15:41:37 EDT From: Paul Hudak Full-Name: Paul Hudak Message-Id: <8709251941.AA19752@ATHENA.CS.YALE.EDU> Received: by yale-ring (alta.ring.cs.yale.edu/ADD2) via WIMP-MAIL (Version 1.2/1.4) ; Fri Sep 25 15:32:03 Subject: Re: A suggestion about the T compiler To: William Moran Cc: t-discussion@YALE.ARPA In-Reply-To: William Moran , Thu, 24 Sep 87 23:37:50 EDT Thanks for the note. Seems like a reasonable suggestion, but maybe there are reasons why the T implementers did it otherwise. I have cc'ed this reply to the T-DISCUSSION mailing-list in case anyone else wishes to comment on the issue. -Paul Date: Thu, 24 Sep 87 23:37:50 EDT From: William Moran To: hudak-paul@YALE.ARPA Subject: A suggestion about the T compiler Hi, I don't know who to send this to, so I'll send it to you assuming that you will know who to send it to. If in T, I say (compile-file 'foo) and I get foo.mobj, it seems to then always be loaded when I say (load 'foo). This is normal and acceptable behavior, UNLESS foo.t has been modified since foo.mobj was created. Every other lisp I've ever seen will load the most recent one. if nothing else, the system should say : "Hey I'm loading foo.mobj even though there is a more recent foo.t" for a good example of what I mean, take a look at gnuemacs when the autosave file is more recent than the file being edited. This is just my $.02 worth. Bill Moran -------  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 28 Sep 87 11:39:53 EDT Received: by ELI.CS.YALE.EDU; Mon, 28 Sep 87 11:06:36 EDT Date: Mon, 28 Sep 87 11:06:36 EDT From: Ashwin Ram Full-Name: Ashwin Ram Message-Id: <8709281506.AA05264@ELI.CS.YALE.EDU> Received: by yale-ring (node-abc3.ring.cs.yale.edu/ABC3) via WIMP-MAIL (Version 1.2/1.4) ; Mon Sep 28 11:07:32 To: moran-william@YALE.ARPA Cc: t-discussion@YALE.ARPA In-Reply-To: Paul Hudak's message of Fri, 25 Sep 87 15:41:37 EDT Subject: Re: A suggestion about the T compiler I have a little hacque which lets you specify what you want done in the case when you type (LOAD 'FOO) and foo.t is newer than foo.mobj. There is a switch which you can set to one of: binary - always load foo.mobj (this is T's normal default) source - always load foo.t newer - always load whichever is newer recompile - recompile foo.t, then load foo.mobj if successful query - ask user whether to recompile warn - print warning message, then load foo.mobj Some of this was present in osys/load.t but it didn't work. Also, I needed to fix REQUIRE so that this works correctly with both LOAD and REQUIRE. I'd be happy to pass this along to you if you like. A bunch of us have been using it with no problems for several months. -- Ashwin Ram -- ARPA: Ram-Ashwin@cs.yale.edu UUCP: {decvax,linus,seismo}!yale!Ram-Ashwin BITNET: Ram@yalecs  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 30 Sep 87 10:39:09 EDT Received: by ELI.CS.YALE.EDU; Wed, 30 Sep 87 10:09:12 EDT Date: Wed, 30 Sep 87 10:09:12 EDT From: Ashwin Ram Full-Name: Ashwin Ram Message-Id: <8709301409.AA04925@ELI.CS.YALE.EDU> Received: by yale-ring (node-abc3.ring.cs.yale.edu/ABC3) via WIMP-MAIL (Version 1.2/1.4) ; Wed Sep 30 10:10:03 To: t-discussion@YALE.ARPA Subject: Re: Re: A suggestion about the T compiler I have gotten so many requests for the load hacque that I've decided to post it to t-discussion. Here it comes, along with the original copyright message of the T3 distribution. Cut where indicated and compile the file, then load it first thing in your init.t file as described below. Enjoy! ----------------------------------------cut here------------------------------------------------ (herald load (env tsys) (syntax-table (env-syntax-table t-implementation-env))) ;;********************************************************************************************** ;; ;; LOAD.T ;; ;;********************************************************************************************** ;; File: [yale-ring]~/sys/homes/ram/t3/load.t ;; Author: Ashwin Ram ;; Written: 02/26/87 ;; CONTENTS: ;; --------- ;; Fix bug in *REQUIRE (actually, LOADED?). ;; Fix bug in LOAD (actually, OPEN-DEFAULT-FILENAME). ;; Abstract LOAD-OUT-OF-DATE-ACTION checking and add to both REQUIRE and LOAD. ;; HOW TO USE: ;; ----------- ;; This file must be loaded into T-IMPLEMENTATION-ENV, ;; after which you should import *REQUIRE (and LOAD-OUT-OF-DATE-ACTION if ;; you want it) into your own environment. ;; ;; I have the following lines at the beginning of my INIT.T file: ;; ;; (load '(sys/homes/ram/t3 load) t-implementation-env) ;; Load this file. ;; (import t-implementation-env *require load-out-of-date-action) ;; (set (load-out-of-date-action) 'recompile) ;; ;; The options for load-out-of-date-action are as follows. Assume you have typed ;; (load 'foo) or (require foo), and foo.t and foo.mobj both exist. ;; ;; binary - always load foo.mobj (this is T's normal default) ;; source - always load foo.t ;; newer - always load whichever is newer ;; recompile - recompile foo.t, then load foo.mobj if successful ;; query - ask user whether to recompile ;; warn - print warning message, then load foo.mobj ;; ;; To select the option you want, type: (set (load-out-of-date-action) 'xxxxxx) ;;********************************************************************************************** ;;; Copyright (c) 1985 Yale University ;;; Authors: N Adams, R Kelsey, D Kranz, J Philbin, J Rees. ;;; This material was developed by the T Project at the Yale University Computer ;;; Science Department. Permission to copy this software, to redistribute it, ;;; and to use it for any purpose is granted, subject to the following restric- ;;; tions and understandings. ;;; 1. Any copy made of this software must include this copyright notice in full. ;;; 2. Users of this software agree to make their best efforts (a) to return ;;; to the T Project at Yale any improvements or extensions that they make, ;;; so that these may be included in future releases; and (b) to inform ;;; the T Project of noteworthy uses of this software. ;;; 3. All materials developed as a consequence of the use of this software ;;; shall duly acknowledge such use, in accordance with the usual standards ;;; of acknowledging credit in academic research. ;;; 4. Yale has made no warrantee or representation that the operation of ;;; this software will be error-free, and Yale is under no obligation to ;;; provide any services, by way of maintenance, update, or otherwise. ;;; 5. In conjunction with products arising from the use of this material, ;;; there shall be no use of the name of the Yale University nor of any ;;; adaptation thereof in any advertising, promotional, or sales literature ;;; without prior written consent from Yale in each case. ;;; ;;; Modications by Ashwin Ram, 02/26/87. ;;********************************************************************************************** ;; Fix bug in loaded?. ;;********************************************************************************************** ;; Files are entered in the loaded-files table after expanding to full path ;; names, so loaded? better expand filenames before looking in that table. ;; From ~/TSYS/LOAD.T (changes in uppercase): (define (loaded? name env) (let ((id (cond ((string? name) name) ((filename? name) (filename->string name)) ((port? name) (port-name name)) (else (error "invalid identifier for file - ~a" name))))) (true? (loaded-file env (FILENAME->STRING (EXPAND-FILENAME (->FILENAME id))))))) ;;********************************************************************************************** ;; From ~/TSYS/LOAD.T (changes in uppercase): (define (instantiate-comex comex env . id) (let* ((id (if (null? id) nil (car id))) (h (vref (comex-objects comex) 1)) (herald (parse-herald (car h) (cdr h)))) (set (comex-module-name comex) herald) (receive (unit code) (install-comex comex env) (set (weak-table-entry code-unit-table code) unit) (add-to-population code-population code) (if id (set (loaded-file env id) (AUGMENT-UNIT unit ID))) (run-compiled-code unit env)))) (define (instantiate-source port form env) (receive (h port) (cond ((and (pair? form) (eq? (car form) 'herald)) (let ((h (parse-herald (cadr form) (cddr form)))) (cond ((herald-read-table h) => (lambda (rt) (set (port-read-table port) (eval rt env))))) (return h port))) (else ;++(warning "file ~S has no HERALD form.~%" ;++ (port-name port)) (return (make-default-herald (port-name port)) (cons-port form port)))) (check-compatibility port h env) (let ((unit (standard-compile-port port (get-target-syntax h env) h))) (if (port-name port) (set (loaded-file env (port-name port)) (AUGMENT-UNIT unit (PORT-NAME PORT)))) (run-compiled-code unit env)))) ;;********************************************************************************************** ;; Fix bug in open-default-filename. ;;********************************************************************************************** ;; From ~/TSYS/LOAD.T (changes in uppercase): (define (open-default-filename filespec complain?) (let ((open (if complain? open maybe-open)) (fname (GET-DEFAULT-FILENAME filespec))) (OPEN FNAME 'IN))) ;;********************************************************************************************** ;; Abstract the load-out-of-date-action feature. ;;********************************************************************************************** ;; This code is new. (define (get-default-filename filespec) (let* ((fname (->filename filespec)) (ftype (filename-type fname)) (src (filename-with-type fname (source-file-type (local-machine)))) (bin (filename-with-type fname (object-file-type (local-machine))))) (cond ((or (string? filespec) (not (null? ftype))) fname) ((file-exists? bin) (xcase (load-out-of-date-action) ((binary) bin) ((source) src) ((newer) (if (and (file-exists? src) (file-newer? src bin)) src bin)) ((recompile) (if (and (file-exists? src) (file-newer? src bin)) (if (maybe-comfile src bin) bin src) bin)) ((warn) (if (and (file-exists? src) (file-newer? src bin)) (if (print-load-message?) (let ((msg-port (standard-output))) (comment-indent msg-port (fx* *load-level* 2)) (format msg-port "Warning: ~a has changed since it was last compiled~%" src) (force-output msg-port)))) bin) ((query) (if (and (file-exists? src) (file-newer? src bin) (yes-or-no? "File ~a is out of date. Recompile " src)) (if (maybe-comfile src bin) bin src) bin)))) (else src)))) ;; Like COMFILE but doesn't break if can't compile (say, it isn't your file). ;; If can't compile, behaves like NEWER which is presumably what you wanted. (define (maybe-comfile src bin) (cond ((maybe-open bin '(out)) ;; hack! => (lambda (port) (close port) (comfile src) '#t)) (else (if (print-load-message?) (let ((msg-port (standard-output))) (comment-indent msg-port (fx* *load-level* 2)) (format msg-port "Can't compile ~a~%" (filename->string src)) (force-output msg-port))) '#f))) ;;********************************************************************************************** ;; Add newer and warn options. ;;********************************************************************************************** ;; From ~/TSYS/LOAD.T (changes in uppercase): (define-simple-switch load-out-of-date-action (lambda (sym) (case sym ((binary) t) ((source) t) ((query) t) ((recompile) t) ((WARN) T) ((NEWER) T) (else nil))) 'binary) ;;********************************************************************************************** ;; Add load-out-of-date-action feature to require. ;;********************************************************************************************** ;; From ~/TSYS/LOAD.T (changes in uppercase): (define (*require id filespec env) (let ((fname (EXPAND-FILENAME (GET-DEFAULT-FILENAME filespec)))) (cond ((AND (loaded? fname env) (SAME-AS-BEFORE? FNAME ENV)) (cond ((print-load-message?) (let ((msg-port (standard-output))) (comment-indent msg-port (fx* *load-level* 2)) (format msg-port "Already loaded ~a~%" (FILENAME->STRING fname)) (force-output msg-port)))) (undefined-value "File already loaded")) (else (load-file (FILENAME->STRING fname) env t))))) ;; Why do GET-DEFAULT again? ;;********************************************************************************************** ;; New stuff to check write dates. ;;********************************************************************************************** ;; The right way to do LOADED? is to check both the name of the file as well as the file write ;; date, since if the file has changed since it was loaded, we shouldn't really consider it ;; loaded any more. On systems supporting version or generation numbers, we can just check ;; that instead. For example, if *require causes an already-loaded file to be recompiled, ;; it really should reload that file. ;; Here's one way to fix it that will be relatively painless to get rid of once the T guys ;; fix it for real. This code is new and hopefully temporary: (define-operation (unit-write-date unit) *min-fixnum*) (define (augment-unit unit id) (let ((write-date (if (null? id) *min-fixnum* (file-write-date id)))) (join (object nil ((unit-write-date self) write-date)) unit))) ;; This code duplicates some of LOADED?, but rather than hack LOADED? I separated this out ;; since I don't know what else depends on LOADED?. (define (same-as-before? name env) (let* ((fname (expand-filename (->filename (cond ((string? name) name) ((filename? name) (filename->string name)) ((port? name) (port-name name)) (else (error "invalid identifier for file - ~a" name)))))) (id (filename->string fname)) (unit (loaded-file env id))) (cond ((fx> (file-write-date fname) (unit-write-date unit)) (cond ((print-load-message?) (let ((msg-port (standard-output))) (comment-indent msg-port (fx* *load-level* 2)) (format msg-port "~a has changed since it was loaded~%" id) (force-output msg-port)))) '#f) (else '#t)))) ;;********************************************************************************************** 'LOAD ----------------------------------------cut here------------------------------------------------ Let me know if you have any trouble setting it up. Comments, suggestions and improvements are welcome too. -- Ashwin Ram -- ARPA: Ram-Ashwin@cs.yale.edu UUCP: {decvax,linus,seismo}!yale!Ram-Ashwin BITNET: Ram@yalecs  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 30 Sep 87 14:05:40 EDT Received: by ATHENA.CS.YALE.EDU; Wed, 30 Sep 87 13:45:00 EDT Date: Wed, 30 Sep 87 13:45:00 EDT From: Ashwin Ram Full-Name: Ashwin Ram Message-Id: <8709301745.AA03996@ATHENA.CS.YALE.EDU> Received: by yale-ring (node-abc3.ring.cs.yale.edu/ABC3) via WIMP-MAIL (Version 1.2/1.4) ; Wed Sep 30 13:40:00 To: srt@CS.UCLA.EDU Cc: t-discussion@YALE.ARPA In-Reply-To: Scott Turner's message of Wed, 30 Sep 87 09:51:33 PDT Subject: Re: [Load hacque] [Uppercase filenames] Works for me: > (require "~/sys/homes/ram/Foo.t") ;Loading //leo/yale/ram/Foo.t into USER-ENV ... > (require "~/sys/homes/ram/Foo.t") ;Already loaded //leo/yale/ram/Foo.t #{Undefined-value 5 File already loaded} > (require "~/sys/homes/ram/foo.t") ** Error: (OPEN '#[Filename () "~/sys/homes/ram" "foo" "t"] 'IN) failed ** Type (RET) or (RET filespec) to retry. > (require "~/sys/homes/ram/Foo:bar.t") ;Loading //leo/yale/ram/Foo:bar.t into USER-ENV ... > (require "~/sys/homes/ram/Foo:bar.t") ;Already loaded //leo/yale/ram/Foo:bar.t #{Undefined-value 6 File already loaded} The problem you and Seth are facing is that Aegis uses : characters in filenames to denote capital letters (and also to quote leading dots). (This is an Aegis bug.) I suspect either PORT-NAME or PORT-TRUENAME (or EXPAND-FILENAME) uses an Aegis system call (such as NAME_$RESOLVE! or IOS_$INQ_NAME or something), which screws up on files with colons or caps in them. Try tracing PORT-TRUENAME (called by EXPAND-FILENAME) and PORT-NAME to see if they are converting your colons. (They are in T-IMPLEMENTATION-ENV). If so, you can either (a) configure Aegis (and the DM) not to use : to quote uppercase letters, leaving both : and uppercase letters as they are, or (b) wrap something around PORT-TRUENAME that undoes the damage. One of the T implementors should be able to help you with (b). Send me mail if you need help with this. -- Ashwin.  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 2 Oct 87 14:03:52 EDT Received: by ATHENA.CS.YALE.EDU; Fri, 2 Oct 87 13:43:46 EDT Date: Fri, 2 Oct 87 13:43:46 EDT From: Juan Carlos Guzman Full-Name: Juan Carlos Guzman Message-Id: <8710021743.AA25135@ATHENA.CS.YALE.EDU> Received: by yale-ring (node-e769/E769) via WIMP-MAIL (Version 1.2/1.4) ; Fri Oct 2 17:41:52 Subject: Automatic Lexer and Parser Generators To: T-discussion@YALE.ARPA, T-users@YALE.ARPA I would like to know if there are any T programs (Scheme is also ok) that generate lexers and/or parsers from grammars. The model I have in mind is something like Unix LEX and YACC. Thanks in advance for any clues, Maria M. Guzman -------  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 2 Oct 87 17:32:33 EDT Received: by ATHENA.CS.YALE.EDU; Fri, 2 Oct 87 17:09:52 EDT Date: Fri, 2 Oct 87 17:09:52 EDT From: Ashwin Ram Full-Name: Ashwin Ram Message-Id: <8710022109.AA26751@ATHENA.CS.YALE.EDU> Received: by yale-ring (node-abc3/ABC3) via WIMP-MAIL (Version 1.2/1.4) ; Fri Oct 2 17:05:21 To: t-discussion@YALE.ARPA Subject: Wanna have some fun? Guess what happens when you type the following line to your T3 session: (orbit '(set (car nil) 'foo)) We found out the hard way... -- Ashwin Ram and Eric Jones.  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 2 Oct 87 19:11:22 EDT Received: by ELI.CS.YALE.EDU; Fri, 2 Oct 87 18:48:09 EDT Date: Fri, 2 Oct 87 18:48:09 EDT From: Larry Hunter Full-Name: Larry Hunter Message-Id: <8710022248.AA06996@ELI.CS.YALE.EDU> Received: by yale-ring (node-dd05/DD05) via WIMP-MAIL (Version 1.2/1.4) ; Fri Oct 2 18:50:06 Subject: Window package To: ram@YALE.ARPA, t-users@YALE.ARPA Ashwin's window package is back and functioning happily in T3. For those of you who prefer text-oriented window stuff over Firby's pictures, just load [yale-ring]~sys/homes/hunter/t/windows/load_windows.t Bug reports to hunter@yale.edu. -------  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 18 Nov 87 15:29:40 EST Date: Wed, 18 Nov 87 15:26:59 EST From: Jonathan A Rees Subject: [Paul Otto : FTP'ing T] To: otto%Cs.Ucl.AC.UK@XX.LCS.MIT.EDU cc: philbin-jim@YALE.ARPA, t-users@MC.LCS.MIT.EDU In-reply-to: Msg of Wed 18 Nov 87 08:44:58 EST from James F Philbin Message-ID: <287882.871118.JAR@AI.AI.MIT.EDU> Date: Wed, 18 Nov 87 08:44:58 EST From: James F Philbin To: rees at YALE.ARPA Re: [Paul Otto : FTP'ing T] **** Forwarded Message Follows **** Message-Id: <8711181324.AA04506@ELI.CS.YALE.EDU> To: Philbin-Jim@YALE.ARPA Subject: FTP'ing T Date: Wed, 18 Nov 87 09:21:49 +0000 From: Paul Otto I have been trying to FTP the latest T release from zurich.ai.mit.edu, and have not yet managed to transfer a single byte of any file. (I can successfully do a "dir" on small directories, but not in /u3/t/documentation/{unix,manual}.) It has been suggested to me that this is probably due to zurich running an old version of TCP, which works poorly with the heavily-loaded net. Is T available on some other machine please? Or can you suggest another route (other than mag tape!). Try prep:/t/*.tar.Z, which are compressed tar files. * is one of sources, vax_unix, sun, or hp. The only problem is that file names in the sources tree are truncated to 14 characters.  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 28 Jan 88 14:41:43 EST Received: by ATHENA.CS.YALE.EDU; Thu, 28 Jan 88 13:59:39 EST Date: Thu, 28 Jan 88 13:59:39 EST From: Robert Farrell Full-Name: Robert Farrell Message-Id: <8801281859.AA02876@ATHENA.CS.YALE.EDU> Received: by yale-ring (node-9437/9437) via WIMP-MAIL (Version 1.2/1.4) ; Thu Jan 28 13:51:13 Subject: = read macro To: t-discussion@YALE.ARPA I want to make #\= a read macro in T3, but I want to leave => undisturbed for COND (since COND doesn't use read tables to do the => ``macro'') Does anyone know a clean way of doing this? -- Rob -------  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 28 Jan 88 14:49:04 EST Received: by ELI.CS.YALE.EDU; Thu, 28 Jan 88 14:39:34 EST Date: Thu, 28 Jan 88 14:39:34 EST From: Robert Farrell Full-Name: Robert Farrell Message-Id: <8801281939.AA07864@ELI.CS.YALE.EDU> Received: by yale-ring (node-9437/9437) via WIMP-MAIL (Version 1.2/1.4) ; Thu Jan 28 14:31:56 Subject: =var To: t-discussion@YALE.ARPA Sorry. Let me be clearer. I have code that works well enough. Its just that I don't like it because it has to read ahead and that can cause problems. I would like the code to just have to do peeks, not do reads. Here is the current code: (set (read-table-entry *VAR-READ-TABLE* #\=) (lambda (port char old-read-table) (ignore old-read-table) (let ((next-char (peek-char port))) (if (char= next-char #\>) ; ignore => because of T's COND (block (read-char port) '=>) (make-Var (read-refusing-eof port)))))) where make-var creates a var object. --- Rob -------  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 9 Feb 88 18:47:51 EST Received: from cu-arpa.cs.cornell.edu by ELI.CS.YALE.EDU; Tue, 9 Feb 88 18:39:00 EST Full-Name: Received: from arvak.cs.cornell.edu by cu-arpa.cs.cornell.edu (5.54/4.30) id AA14671; Tue, 9 Feb 88 18:38:35 EST Message-Id: <8802092338.AA00472@arvak.cs.cornell.edu> Received: by arvak.cs.cornell.edu (3.2/4.30) id AA00472; Tue, 9 Feb 88 18:38:28 EST To: t-discussion@YALE.ARPA Subject: Compiling T Date: Tue, 09 Feb 88 18:38:23 -0500 From: murthy@arvak.cs.cornell.edu Hi. I just got T from mit-prep, and I really like it, but I would like to know how to go about recompiling it - I have 4.3+NFS, 4.3 vanilla, 4.2, and Ultrix machines here, and I would like to know that the version of T running on a machine was compiled for that machine configuration in particular. Does anybody know how to build it from the sources? I have the source.tar file, by the way. I am not on this newsgroup, so could you please mail me? Thanks in advance, --chet-- In Real Life: Chet Murthy ARPA: murthy@svax.cs.cornell.edu SnailMail: Chet Murthy North Woods Apts #20-2A 700 Warren Road Ithaca, NY 14850 Office: 4162 Upson (607) 255-2219 MaBellNet: (607)-257-2542  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 10 Feb 88 08:29:55 EST Received: from mitre-bedford.ARPA by ELI.CS.YALE.EDU; Wed, 10 Feb 88 08:16:01 EST Full-Name: From: ramsdell%linus@mitre-bedford.arpa Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.research (3.2/4.7) id AA27722; Wed, 10 Feb 88 08:13:26 EST Posted-Date: Wed, 10 Feb 88 08:12:15 EST Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA12350; Wed, 10 Feb 88 08:12:15 EST Date: Wed, 10 Feb 88 08:12:15 EST Message-Id: <8802101312.AA12350@darwin.sun.uucp> To: murthy@arvak.cs.cornell.edu, murthy@svax.cs.cornell.edu Cc: t-discussion@YALE.ARPA In-Reply-To: murthy@arvak.cs.cornell.edu's message of Tue, 09 Feb 88 18:38:23 -0500 <8802092338.AA00472@arvak.cs.cornell.edu> Subject: Compiling T Here is what is required to generate Alliant T from a Sun. You should be able to modify it to do what you want. John #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # sources/system/sun2al.sh # sources/orbit/assembler/alis.t # sources/orbit/back_end/unalgen.t # sources/orbit/build/ocomp.t # sources/orbit/build/oload.t # sources/orbit/build/orbit_files.t # sources/system/sun2al.t # sources/system/sun2al.c # sources/system/sun2almakefile # sources/system/al_start_t.s # sources/system/al.sh # sources/system/almachine.t # This archive created: Sun Sep 20 10:27:29 1987 export PATH; PATH=/bin:$PATH if test -f 'sources/system/sun2al.sh' then echo shar: will not over-write existing file "'sources/system/sun2al.sh'" else cat << \SHAR_EOF > 'sources/system/sun2al.sh' #!/bin/sh # See $OSYS/sun2al.t for instructions. date > 'sun2al.log' # You should delete information files. # rm $TSOURCES/*/*.m* # rm $TSOURCES/*/*/*.m* t >> 'sun2al.log' <<\T_EOF (set (repl-env) orbit-env) (load '(osys sun2al)) (sun->alliant) (exit) T_EOF date >> 'sun2al.log' SHAR_EOF fi # end of overwriting check if test -f 'sources/orbit/assembler/alis.t' then echo shar: will not over-write existing file "'sources/orbit/assembler/alis.t'" else cat << \SHAR_EOF > 'sources/orbit/assembler/alis.t' (herald (assembler alis t 0) (env t (assembler as_open)) (syntax-table tas-syntax-table)) ;;; Instructions special to the Alliant. ;;; fmoveddfp0 moves a double precision floating point ;;; number in register fp0 to an effective address. ;;; Used to handle a return of a double from C code. (define (al/fmoveddfp0 ea) (or (fmoveddfp0 ea) (error "no match for (fmove.dd fp0 ~g)" ea))) ;;; Ugly hack to make it only work with 2(a4). (define-fg (fmoveddfp0 (ea-m&a? dst)) (printer "fmove.d fp0,2(a4)") ;; Op-code (1 1 1 1 1 0 1 0 0 0) ;; 6-bits of effective address. (1 0 1 1 0 0) ;; type-ea type-fpy fpy 1 0 1 0 0 0 0 ;; double double fp0 1 0 1 0 0 0 0 (1 1 1 1 1 1 0 0 0 1 0 1 0 0 0 0) (0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0)) SHAR_EOF fi # end of overwriting check if test -f 'sources/orbit/back_end/unalgen.t' then echo shar: will not over-write existing file "'sources/orbit/back_end/unalgen.t'" else cat << \SHAR_EOF > 'sources/orbit/back_end/unalgen.t' (herald unalgen) ;;; we can do unsafe things here once we set the foreign call cont (define (generate-foreign-call node) (destructure (((cont foreign rep-list value-rep . args) (call-args node))) (emit m68/move .l SP (reg-offset TASK task/foreign-call-cont)) (generate-push nil-reg) ; save slink (generate-move nil-reg AN) (emit m68/move .l TASK (reg-offset AN slink/current-task)) ;;; make a dummy stack frame. (emit m68/link TASK (machine-num -8)) (iterate loop ((args (reverse args)); Push args. (reps (map cadr (leaf-value rep-list)))) (cond ((null? args) (walk (lambda (node) (kill (leaf-value node))) args)) ((eq? (car reps) 'rep/double) (let ((reg (->register 'pointer node (leaf-value (car args)) '*))) (emit m68/move .l (reg-offset reg 6) (@-r 15)) (emit m68/move .l (reg-offset reg 2) (@-r 15)) (loop (cdr args) (cdr reps)))) (else (rep-push node (leaf-value (car args)) (car reps)) (loop (cdr args) (cdr reps))))) (let ((reg (->register 'pointer node (leaf-value foreign) '*))) ; get xenoid (emit m68/move .l (reg-offset reg 6) A1)) ; A1, get 2nd slot ;;; The above uses A0, so this must be done here! (cond ((null? args) ; Set up parameter list pointer in A0. (generate-move-word (machine-num 0) P)) (else (generate-move SP P) ;; This is supposed to generate a pea, but its not an ea. (generate-push (machine-num (length args))))) (emit m68/jsr (@r 9)) ; A1 is 9. Can't be A0 (holds the parameter list). (clear-slots) (emit m68/unlk TASK) ; Pop stack frame; load saved A6 (TASK). (emit m68/move .l (reg-offset TASK task/foreign-call-cont) SP) (emit m68/move .l (reg-offset sp -4) nil-reg) ; restore slink (emit m68/clr .l (reg-offset TASK task/foreign-call-cont)) (case (leaf-value value-rep) ((rep/undefined ignore)) ((rep/double) ; cons a flonum ;;; (emit m68/move .l S1 SCRATCH) ; save hign longword (emit m68/move .l (machine-num 8) S1); 2 words for double ;;; float is left in fp0 on an Alliant. (emit m68/move .l (machine-num header/double-float) AN) (generate-move nil-reg A1) (emit m68/jsr (reg-offset A1 slink/make-extend)) ;;; (emit m68/move .l SCRATCH (reg-offset AN 6)) ;;; (emit m68/move .l S0 (reg-offset AN 2)) (emit al/fmoveddfp0 (reg-offset AN 2)) (emit m68/move .l AN A1)) ; return consed flonum (else (really-rep-convert node S0 (leaf-value value-rep) A1 'rep/pointer))) (if (eq? (leaf-value value-rep) 'ignore) (generate-return 0) (generate-return 1)))) (define (rep-push node value to-rep) (let ((access (access-value node value))) (case to-rep ((rep/pointer) (generate-push access)) ((rep/extend) (emit m68/move .l access (@-r 15)) (emit m68/add .l (machine-num tag/extend) (@r 15))) (else (select (rep-size to-rep) ((size/long) (really-rep-convert node access 'rep/pointer (@-r 15) to-rep)) ((size/word) (emit m68/pea (@r 8)) (really-rep-convert node access 'rep/pointer (d@r 15 2) to-rep)) ((size/byte) (emit m68/pea (@r 8)) (really-rep-convert node access 'rep/pointer (d@r 15 3) to-rep))))))) SHAR_EOF fi # end of overwriting check if test -f 'sources/orbit/build/ocomp.t' then echo shar: will not over-write existing file "'sources/orbit/build/ocomp.t'" else cat << \SHAR_EOF > 'sources/orbit/build/ocomp.t' (herald ocomp) ;;; Alliant version. (define orbit-files '((top orbit_imports) (top defs) (top util) (top primop) (top orbit_syntax) ;** changed 12 July 86 (top top) (front_end free_stuff) (front_end let_nodes) (front_end type_sets) (front_end types) (front_end type) (front_end envs) (front_end nodestuff) (front_end shape) (front_end expand) (front_end alpha) (front_end declare) (front_end node) (front_end assign) (front_end simplify) (front_end simplify_call) (front_end simplify_let) (front_end param) (front_end simplifiers) (front_end simplify_y) (front_end fx_const) (front_end safe) (front_end inf_files) (front_end gen_interface) (front_end fixup) (front_end user) (front_end user_error) (front_end module) (front_end analyze) (front_end front) (back_end strategy) (back_end live) (back_end closure) (back_end comex) (back_end bookkeep) (back_end generate) (back_end generate_y) (back_end parassign) (back_end reg) (back_end lookup) (back_end m68emit) (back_end m68bookkeep) (back_end m68gen) (back_end m68locgen) (back_end m68arithgen) (back_end m68rep) (back_end unalgen) ;;; Alliant foreign code generator. (assembler ib) (assembler as_open) (assembler fg) (assembler lap) (assembler as_utils) (assembler as) (assembler count) (assembler mark) (assembler mini) (assembler bits) (assembler listing) (assembler as_m68) (assembler m68am) (assembler m68is1) (assembler m68is2) (assembler alis))) ;;; Alliant instructions. ;;;; Make sure new code generator is loaded. ;;; (load '(assembler compile_as) orbit-env) ;;; (load '(assembler alis) orbit-env) ; Get new instructions. ;;; (load '(back_end unalgen) orbit-env) ; Get new code generator. (define tas-locale (make-locale standard-env 'tas)) (define tas-syntax-table (env-syntax-table tas-locale)) (walk comfile '((assembler expand) (assembler fg_spec) (assembler fg_expr) (assembler as_syntax))) (load '(assembler as_utils) tas-locale) (load '(assembler fg_spec) tas-locale) (load '(assembler fg_expr) tas-locale) (load '(assembler expand) tas-locale) (load '(assembler as_syntax) tas-locale) (set (tc-syntax-table) (env-syntax-table orbit-env)) (walk comfile (cons '(t3_primops base) orbit-files)) SHAR_EOF fi # end of overwriting check if test -f 'sources/orbit/build/oload.t' then echo shar: will not over-write existing file "'sources/orbit/build/oload.t'" else cat << \SHAR_EOF > 'sources/orbit/build/oload.t' (herald oload (env tsys)) ;;; Alliant version (let ((oenv (make-locale standard-env 'orbit-env))) (*define standard-env 'orbit-env oenv) (*define standard-env '*orbit-env* oenv) (*define t-implementation-env 'orbit-env oenv) (*define t-implementation-env '*orbit-env* oenv) (*define oenv 'load-orbit (lambda system (let ((os (if (null? system) ((*value t-implementation-env 'os-type) ((*value t-implementation-env 'local-os))) (car system))) (processor (if (null? system) ((*value t-implementation-env 'processor-type) ((*value t-implementation-env 'local-processor))) (cadr system)))) (load '(build orbit_files) oenv) (walk (lambda (f) (load f oenv)) (*value oenv '*orbit-files*)) (walk (lambda (f) (load f oenv)) (*value oenv '*top-files*)) (walk (lambda (f) (load f oenv)) (*value oenv '*front-files*)) (*define oenv 'variable-support (*value oenv 'variable-definition)) (*define oenv 'primop.support-variant (*value oenv 'primop.definition-variant)) (walk (lambda (f) (load f oenv)) (*value oenv '*back-end-files*)) (xcase processor ((mc68000) (walk (lambda (f) (load f oenv)) (*value oenv '*orbit-m68-files*))) ((vax11) (walk (lambda (f) (load f oenv)) (*value oenv '*orbit-vax-files*)))) (walk (lambda (f) (load f oenv)) (*value oenv '*tas-files*)) (xcase processor ((mc68000) (walk (lambda (f) (load f oenv)) (*value oenv '*tas-m68-files*))) ((vax11) (walk (lambda (f) (load f oenv)) (*value oenv '*tas-vax-files*)))) (load (xcase os ((aegis) '(back_end aem68gen)) ((unix) (xcase processor ;;;;; Alliant modification ((mc68000) '(back_end unm68gen)) ((mc68000) '(back_end unalgen)) ((vax11) '(back_end unvaxgen))))) orbit-env) (let ((load (*value t-implementation-env 'load-quietly-if-present))) (load '(top fix) oenv) (load '(front_end fix) oenv) (load '(back_end fix) oenv) (load '(assembler fix) oenv)) (xcase processor ((mc68000) ;** (load-quietly '(t3_primops m68constants) oenv) (load-quietly-if-present '(back_end m68fix) oenv) (load-quietly-if-present '(assembler m68fix) oenv) ((*value oenv 'orbit-m68-init) 't3_primops)) ((vax11) ;** (load-quietly '(t3_primops vaxconstants) oenv) (load-quietly-if-present '(back_end vaxfix) oenv) (load-quietly-if-present '(assembler vaxfix) oenv) ((*value oenv 'orbit-vax-init) 't3_primops))) (*define t-implementation-env 'comfile (*value oenv 'comfile)) (walk (lambda (sym) (*define standard-env sym (*value oenv sym))) '(cl quicklist orbit comfile compile-file comfile2 tc-syntax-table make-empty-early-binding-locale ))))) oenv) SHAR_EOF fi # end of overwriting check if test -f 'sources/orbit/build/orbit_files.t' then echo shar: will not over-write existing file "'sources/orbit/build/orbit_files.t'" else cat << \SHAR_EOF > 'sources/orbit/build/orbit_files.t' (herald (front_end orbit_files)) ;;; Alliant version. ;;; Copyright (c) 1985 Yale University ;;; Authors: N Adams, R Kelsey, D Kranz, J Philbin, J Rees. ;;; This material was developed by the T Project at the Yale University Computer ;;; Science Department. Permission to copy this software, to redistribute it, ;;; and to use it for any purpose is granted, subject to the following restric- ;;; tions and understandings. ;;; 1. Any copy made of this software must include this copyright notice in full. ;;; 2. Users of this software agree to make their best efforts (a) to return ;;; to the T Project at Yale any improvements or extensions that they make, ;;; so that these may be included in future releases; and (b) to inform ;;; the T Project of noteworthy uses of this software. ;;; 3. All materials developed as a consequence of the use of this software ;;; shall duly acknowledge such use, in accordance with the usual standards ;;; of acknowledging credit in academic research. ;;; 4. Yale has made no warrantee or representation that the operation of ;;; this software will be error-free, and Yale is under no obligation to ;;; provide any services, by way of maintenance, update, or otherwise. ;;; 5. In conjunction with products arising from the use of this material, ;;; there shall be no use of the name of the Yale University nor of any ;;; adaptation thereof in any advertising, promotional, or sales literature ;;; without prior written consent from Yale in each case. ;;; (block (define *orbit-files* '((front_end free_stuff) (top orbit_imports) )) (define *top-files* '( ; (top sets) ; in system now (top defs) (top util) (top primop) (top orbit_syntax) ;** changed 12 July 86 ;** gone March 86 (top top) )) (define *front-files* '((front_end let_nodes) (front_end type_sets) (front_end types) (front_end type) (front_end envs) (front_end nodestuff) (front_end shape) (front_end expand) (front_end alpha) (front_end declare) (front_end node) (front_end assign) (front_end simplify) (front_end simplify_call) (front_end simplify_let) (front_end param) (front_end simplifiers) (front_end simplify_y) (front_end fx_const) (front_end safe) (front_end inf_files) (front_end gen_interface) (front_end fixup) (front_end user) (front_end user_error) (front_end module) (front_end analyze) (front_end front) )) (define *back-end-files* '((back_end strategy) (back_end live) (back_end closure) (back_end comex) (back_end bookkeep) (back_end generate) (back_end generate_y) (back_end parassign) (back_end reg) (back_end lookup))) (define *orbit-m68-files* '((back_end m68emit) (back_end m68bookkeep) (back_end m68gen) (back_end m68locgen) (back_end m68arithgen) (back_end m68rep) )) (define *orbit-vax-files* '((back_end vaxemit) (back_end vaxbookkeep) (back_end vaxgen) (back_end vaxlocgen) (back_end vaxarithgen) (back_end vaxrep) )) (define *tas-files* '((assembler as_open) ;; for assembler & machine descriptions (assembler as_utils) ;; utilities for the assembler (assembler as) ;; client compiler interface ;; the assembler (assembler fg) (assembler ib) (assembler count) (assembler mark) (assembler mini) (assembler bits) (assembler listing) ;; lap user interface (assembler lap) )) (define *tas-m68-files* '((assembler as_m68) (assembler m68am) (assembler m68is1) (assembler m68is2) (assembler alis) ; Alliant instructions. )) (define *tas-vax-files* '((assembler as_vax) (assembler vaxam) (assembler vmodes) (assembler vaxi) (assembler vaxis) )) nil) SHAR_EOF fi # end of overwriting check if test -f 'sources/system/sun2al.t' then echo shar: will not over-write existing file "'sources/system/sun2al.t'" else cat << \SHAR_EOF > 'sources/system/sun2al.t' (herald sun2al) ;; Load into orbit-env. ;;; A procedural description of how to generate T for the Alliant ;;; when a Sun is available. April 1987. ;;; Authors: John Ramsdell of The MITRE Corporation and ;;; David Kranz of Yale University. ;;; Distributed under the same conditions as is T project software. ;;; Copyright (c) 1985 Yale University ;;; Authors: N Adams, R Kelsey, D Kranz, J Philbin, J Rees. ;;; This material was developed by the T Project at the Yale University Computer ;;; Science Department. Permission to copy this software, to redistribute it, ;;; and to use it for any purpose is granted, subject to the following restric- ;;; tions and understandings. ;;; 1. Any copy made of this software must include this copyright notice in full. ;;; 2. Users of this software agree to make their best efforts (a) to return ;;; to the T Project at Yale any improvements or extensions that they make, ;;; so that these may be included in future releases; and (b) to inform ;;; the T Project of noteworthy uses of this software. ;;; 3. All materials developed as a consequence of the use of this software ;;; shall duly acknowledge such use, in accordance with the usual standards ;;; of acknowledging credit in academic research. ;;; 4. Yale has made no warrantee or representation that the operation of ;;; this software will be error-free, and Yale is under no obligation to ;;; provide any services, by way of maintenance, update, or otherwise. ;;; 5. In conjunction with products arising from the use of this material, ;;; there shall be no use of the name of the Yale University nor of any ;;; adaptation thereof in any advertising, promotional, or sales literature ;;; without prior written consent from Yale in each case. ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Instructions: ;;; On the Sun: ;;; Define the directories: ;;; BACK_END ASSEMBLER T3_PRIMOPS PRIMOP_SOURCE PRIMOP_DEST ;;; BUILD TOP ORBIT_TOP FRONT_END TSCHEME OSYS and LINK. ;;; ;;; setenv BUILD $TSOURCES/orbit/build ;;; setenv TOP $TSOURCES/orbit/top ;;; setenv ORBIT_TOP $TSOURCES/orbit/top ;;; setenv FRONT_END $TSOURCES/orbit/front_end ;;; setenv BACK_END $TSOURCES/orbit/back_end ;;; setenv ASSEMBLER $TSOURCES/orbit/assembler ;;; setenv T3_PRIMOPS $TSOURCES/orbit/primops ;;; setenv PRIMOP_SOURCE $TSOURCES/orbit/primops ;;; setenv PRIMOP_DEST $TSOURCES/orbit/primops ;;; setenv OSYS $TSOURCES/system ;;; setenv LINK $TSOURCES/link ;;; setenv TSCHEME $TSOURCES/scheme ;;; setenv HACKS $TSOURCES/hacks ;;; ;;; Load this file into orbit-env. (See $OSYS/sun2al.sh). ;;; Run sun->alliant (defined in this file) to produce ;;; sun2alt.o, a Sun object file. ;;; On the Alliant: ;;; copy sun2alt.o, al_start_t.s, *.c, sun2almakefile and al.sh ;;; from $OSYS to the Alliant. ;;; "make -f sun2almakefile" will construct xt. ;;; move xt to t and sun2alt.o to sun2alt.o.0. ;;; Load compiler and suspend T with: ;;; t -h 8000000 ;;; (set (repl-env) t-implementation-env) ;;; (load-and-suspend-system '(osys sun2alt)) ;;; (exit) ;;; This is the contents of al.sh. ;;; "make -f sun2almakefile" will construct xt. ;;; This xt should be moved to t and used to compile ;;; (osys alkernel) and any fix files you want preloaded. ;;; You must (set (tc-syntax-table) (env-syntax-table t-implementation-env)) ;;; before compiling (osys alkernel). ;;; Exit t. ;;; Suspend T with ;;; T -h 8000000 ;;; ... your loads, if any ... ;;; (set (repl-env) orbit-env) ;;; (set *object-file-extension* 'aobj) ;;; (set *information-file-extension* 'ainf) ;;; (set *noise-file-extension* 'anoi) ;;; (set (repl-env) t-implementation-env) ;;; (load '(osys alkernel)) ;;; (system-suspend '(osys sun2alt) '#f) ;;; (exit) ;;; "make -f sun2almakefile" will construct xt. ;;; This xt is the final product. Install this as t ;;; after testing it. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;??? Bug here? (*define user-env 'make-empty-support-env make-empty-early-binding-locale) (*define user-env 'make-empty-early-binding-locale make-empty-early-binding-locale) (define (com-sun-primops) ;;; Taken from primops_build.doc ;Below is the procedure for compiling the primops. ;;; To compile system files that contain primops set *COMPILE-PRIMOPS?* to #F ;;; and ignore the "primops not compiled for this system" messages. ;;; 68000 ;;; Run this in a 68000 compiler. (load '(t3_primops m68constants) orbit-env) (orbit-m68-setup 'primop_dest) (orbit-init 'base) (set (orbit-syntax-table) primop-syntax-table) (set *compile-primops?* nil) (create-support '(primop_source m68constants) '(primop_dest m68constants)) (create-support '(primop_source m68primops) '(primop_dest m68primops)) (create-support '(primop_source m68arith) '(primop_dest m68arith)) (create-support '(primop_source locations) '(primop_dest locations)) (create-support '(primop_source m68low) '(primop_dest m68low)) (create-support '(primop_source predicates) '(primop_dest predicates)) (orbit-init 'base 'constants 'primops 'arith 'locations 'low 'predicates) (comfile2 '(primop_source open) '(primop_dest open)) (comfile2 '(primop_source aliases) '(primop_dest aliases)) (comfile2 '(primop_source carcdr) '(primop_dest carcdr)) (orbit-init 'base 'constants 'primops 'arith 'locations 'low 'predicates 'open 'aliases 'carcdr) ;;; To compile the primop code in the MINF files do the following: (compile-primop-source '(primop_dest m68constants minf)) (compile-primop-source '(primop_dest m68primops minf)) (compile-primop-source '(primop_dest m68arith minf)) (compile-primop-source '(primop_dest locations minf)) (compile-primop-source '(primop_dest m68low minf)) (set *compile-primops?* '#t) (walk comfile (del (lambda (x y) (not (eq? x (car y)))) 't3_primops *t-system*)) ) (define *t-linker* '((link defs) (link sunlink) (link linker))) (define (com-sun-linker) (walk comfile *loader-modules*) (walk comfile *t-linker*)) (define (make-alliant-comp) (load '(assembler compile_as) orbit-env) (load '(assembler alis) orbit-env) ; Get new instructions. (load '(back_end unalgen) orbit-env) ; Get new code generator. ) (define (com-sun->alliant) (set (tc-syntax-table) (env-syntax-table t-implementation-env)) (set (table-entry (*value orbit-env '*modules*) 'bignum) '(osys m68_bignum)) (walk comfile (del (lambda (x y) (not (eq? x (car y)))) 'osys *t-system*))) (define *link-env* (make-locale t-implementation-env '*link-env*)) (define (link-sun->alliant) (walk (lambda (x) (load x *link-env*)) *t-linker*) ; Load linker. ((*value *link-env* 'link) *t-system* '(osys sun2alt))) (define (com-sun-tscheme) (walk (lambda (name) (compile-file (list 'tscheme name))) '(syntax system runtime compiler))) (define (sun->alliant) (load '(osys unix_bsd4_2_files)) (com-sun-linker) (load '(build ocomp) user-env) ; Make orbit. (make-alliant-comp) ;;; Now the sun T3 compiler is generating Alliant code. (load '(build ocomp) user-env) ; Make orbit for the Alliant. (com-sun-primops) (walk comfile '((link lp_table) ; Make suspender. (link suspend) (link sunsuspend))) (com-sun-tscheme) (com-sun->alliant) (link-sun->alliant)) SHAR_EOF fi # end of overwriting check if test -f 'sources/system/sun2al.c' then echo shar: will not over-write existing file "'sources/system/sun2al.c'" else cat << \SHAR_EOF > 'sources/system/sun2al.c' /* Translates object files from the Suns into object files for the Alliant. Only the header must be changed. Use on the Alliant only. Just change the a_magic field back to the Unix standard. Command: sun2al < {sun.o} > {alliant.o} */ #include #include struct exec object_hdr; char buf[BUFSIZ]; main() { register int n; /* Get Sun header. */ n = fread ((char *) &object_hdr, sizeof(struct oexec), 1, stdin); if (n != 1) { fprintf (stderr, "Bad read of Sun header\n"); exit (1); } /* Make Alliant header. */ object_hdr.a_magic = OMAGIC; object_hdr.a_flags = 0; /* Write new header. */ n = fwrite ((char *) &object_hdr, sizeof(struct oexec), 1, stdout); if (n != 1) { fprintf (stderr, "Bad write of Alliant header\n"); exit (1); } /* Copy data. */ while ((n = fread (buf, 1, BUFSIZ, stdin)) != 0) { if (n < 0) { perror ("Bad read copying.\n"); exit (1); } if (0 == fwrite (buf, 1, n, stdout)) { perror ("Bad write copying.\n"); exit (1); } } } SHAR_EOF fi # end of overwriting check if test -f 'sources/system/sun2almakefile' then echo shar: will not over-write existing file "'sources/system/sun2almakefile'" else cat << \SHAR_EOF > 'sources/system/sun2almakefile' all: xt map: xt.map sun2al: sun2al.c cc -o $@ sun2al.c t.o: sun2al sun2alt.o sun2al < sun2alt.o > /tmp/t407.o ld -r /tmp/t407.o -o t.out mv t.out $@ rm /tmp/t407.o unassist.o: unassist.c cc -c unassist.c expand.o: expand.c cc -c expand.c float.o: float.c cc -c float.c al_start_t.o: al_start_t.s cc -c al_start_t.s xt.map: xt nm -n xt > $@ xt: t.o unassist.o expand.o al_start_t.o float.o ld -nxp -nc -e start t.o al_start_t.o /lib/crt0.o \ unassist.o expand.o float.o -lm -lc -o xt SHAR_EOF fi # end of overwriting check if test -f 'sources/system/al_start_t.s' then echo shar: will not over-write existing file "'sources/system/al_start_t.s'" else cat << \SHAR_EOF > 'sources/system/al_start_t.s' .globl _start_t .globl interrupt_dispatcher .globl _hack_divide .text _start_t: # On Alliant, overwrite parameter descriptor with return address, # and pop the stack. This fixes the stack for big-bang. movl sp@,a1 movl a0,sp pea a1@ # Flush instruction cache. link a6,#-8 movl a0,a6@(-4) movw #0,a0 | call _flushicache jsr _flushicache unlk a6 # What follows is the same as is done on the Suns. lea interrupt_xenoid+2,a0 movl a0,d0 lea big_bang,a0 movl a0@(-2),a5 jmp a5@ .data .align 2 interrupt_xenoid: .long 49 .long L1 .text # code in S0, context in A1 (at least that is what the comment said.) # I think code really means the signal. L1: movl a0@,d0 | signal movl a0@(8),a1 | context movl a6,sp@- | save frame pointer lea interrupt_dispatcher,a0 movl a0@(-2),a5 jsr a5@ movl sp@+,a6 | pop frame pointer rts _hack_divide: # M68K code: # movl sp@(4),d0 # divsl sp@(8),d0 # Duplicate the top of the stack which allocates four # bytes for temporary storage for ldiv. movl sp@,a1 pea a1@ | Allocate stack space. jmp ldiv | Let ldiv do the return. SHAR_EOF fi # end of overwriting check if test -f 'sources/system/al.sh' then echo shar: will not over-write existing file "'sources/system/al.sh'" else cat << \SHAR_EOF > 'sources/system/al.sh' #!/bin/sh # Remember to move xt to t. date > 'al.log' t -h 8000000 >> 'al.log' <<\T_EOF (set (repl-env) t-implementation-env) (load-and-suspend-system '(ali sun2alt)) (exit) T_EOF date >> 'al.log' SHAR_EOF fi # end of overwriting check if test -f 'sources/system/almachine.t' then echo shar: will not over-write existing file "'sources/system/almachine.t'" else cat << \SHAR_EOF > 'sources/system/almachine.t' (herald almachine (env tsys)) ;;; Modifications to Sun sources for the Alliant. April 1987. ;;; Authors: John Ramsdell of The MITRE Corporation. ;;; Distributed under the same conditions as is T project software. ;;; Copyright (c) 1985 Yale University ;;; Authors: N Adams, R Kelsey, D Kranz, J Philbin, J Rees. ;;; This material was developed by the T Project at the Yale University Computer ;;; Science Department. Permission to copy this software, to redistribute it, ;;; and to use it for any purpose is granted, subject to the following restric- ;;; tions and understandings. ;;; 1. Any copy made of this software must include this copyright notice in full. ;;; 2. Users of this software agree to make their best efforts (a) to return ;;; to the T Project at Yale any improvements or extensions that they make, ;;; so that these may be included in future releases; and (b) to inform ;;; the T Project of noteworthy uses of this software. ;;; 3. All materials developed as a consequence of the use of this software ;;; shall duly acknowledge such use, in accordance with the usual standards ;;; of acknowledging credit in academic research. ;;; 4. Yale has made no warrantee or representation that the operation of ;;; this software will be error-free, and Yale is under no obligation to ;;; provide any services, by way of maintenance, update, or otherwise. ;;; 5. In conjunction with products arising from the use of this material, ;;; there shall be no use of the name of the Yale University nor of any ;;; adaptation thereof in any advertising, promotional, or sales literature ;;; without prior written consent from Yale in each case. ;;; ;;; Modification to (osys sunkernel). (define (local-machine) (object nil ((machine-type self) 'alliant) ((page-size self) 4096) ((source-file-type self) 't) ((object-file-type self) 'aobj) ((information-file-type self) 'ainf) ((noise-file-type self) 'anoi) ((print-type-string self) "Machine"))) ;;; The orbit extension should be set for the Alliant by evaluating ;;; an unquoted version of the form below in the orbit-env. `(block (set *object-file-extension* 'aobj) (set *information-file-extension* 'ainf) (set *noise-file-extension* 'anoi) ) SHAR_EOF fi # end of overwriting check # End of shell archive exit 0  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 10 Feb 88 09:39:42 EST Received: from mitre-bedford.ARPA by ELI.CS.YALE.EDU; Wed, 10 Feb 88 09:27:47 EST Full-Name: From: ramsdell%linus@mitre-bedford.arpa Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.research (3.2/4.7) id AA29970; Wed, 10 Feb 88 09:26:55 EST Posted-Date: Wed, 10 Feb 88 09:25:44 EST Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA12397; Wed, 10 Feb 88 09:25:44 EST Date: Wed, 10 Feb 88 09:25:44 EST Message-Id: <8802101425.AA12397@darwin.sun.uucp> To: t-discussion@YALE.ARPA In-Reply-To: murthy@arvak.cs.cornell.edu's message of Tue, 09 Feb 88 18:38:23 -0500 <8802092338.AA00472@arvak.cs.cornell.edu> Subject: Compiling T Sorry about CC'ing the last message to this discussion. Please delete it. John  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 18 Feb 88 21:12:02 EST Received: from RELAY.CS.NET by ELI.CS.YALE.EDU; Thu, 18 Feb 88 21:01:25 EST Full-Name: Received: from relay2.cs.net by RELAY.CS.NET id ak16859; 18 Feb 88 17:00 EST Received: from tektronix.tek.com by RELAY.CS.NET id bq17110; 18 Feb 88 16:46 EST Received: by tektronix.TEK.COM (5.51/6.24) id AA10729; Thu, 18 Feb 88 10:19:26 PST Received: by tekchips.CRL.TEK.COM (5.51/6.24) id AA24321; Thu, 18 Feb 88 10:19:55 PST Message-Id: <8802181819.AA24321@tekchips.CRL.TEK.COM> To: t-discussion@YALE.ARPA Subject: Huh? Date: 18 Feb 88 10:19:53 PST (Thu) From: kend%tekchips.CRL%tektronix.tek.com@RELAY.CS.NET I have received a number of messages addressed to me via this group which were bounced by our local mailer. My current address is as below. Please update as required. Thanks, -Ken Dickey --------------------------------------------------- CSnet : kend%tekchips.tek.com@relay.cs.net ARPAnet: kend%tekchips%tektronix@csnet-relay UUCP : kend%tekchips@tektronix.TEK.COM ---------------------------------------------------  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 22 Feb 88 23:34:57 EST Date: Mon, 22 Feb 88 23:35:21 EST From: Jonathan A Rees Subject: administrative remarks To: T-Discussion@MC.LCS.MIT.EDU Message-ID: <330441.880222.JAR@AI.AI.MIT.EDU> - If you received this message, you're on the T-Discussion mailing list. - T-Discussion@MC.LCS.MIT.EDU is the same list as T-Discussion@YALE.EDU. - Most of the list is now maintained at MIT, and change requests should be addressed to T-Discussion-Request@MC.LCS.MIT.EDU. There are several local redistributions, however. For the local redistribution at Yale, send change requests to T-Discussion-Request@YALE.EDU. - The T-Users list is being merged in with the T-Discussion list, and soon the two names will be synonyms. This change is happening because most people couldn't remember what the difference between the two was supposed to be.  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 25 Mar 88 07:57:31 EST Received: from mitre-bedford.ARPA by ELI.CS.YALE.EDU; Fri, 25 Mar 88 07:51:17 EST Full-Name: Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.research (3.2/4.7) id AA29128; Fri, 25 Mar 88 07:48:35 EST From: John D. Ramsdell Posted-Date: Fri, 25 Mar 88 07:48:52 EST Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA12346; Fri, 25 Mar 88 07:48:52 EST Date: Fri, 25 Mar 88 07:48:52 EST Message-Id: <8803251248.AA12346@darwin.sun.uucp> To: t-discussion@YALE.ARPA Cc: ramsdell@mitre-bedford.arpa Subject: Simple support for literate T programming. I recently completed writing a fairly complex program in C. The program had to be easily read by people as it was important that the program was "nearly correct", but not important enough to formally verify the program. I used CWEB, a fairly sophisticated system for producing readable programs using TeX. Now that I have paid my dues by writing in C, I am able to return to using T. It is easier to write T programs that are more readable than plain C programs because the language puts less constraints on how you organize input to the compiler. However, my experience with CWEB has shown it is very nice to be able to write comments in TeX, especially when you use mathematics. I have written some software provides support for literate T programming. It simply interprets the lines between forms, and comments within forms, as LaTeX input. When used to make a document, the T forms are printed in typewriter font. The forms in the text file you edit look just like normal T forms, except the comments may look funny. Thus editors which submit part of a file to T for evaluation will still work. The programs and documentation are in a shar file call "schemeTeX.sh" on linus (192.12.120.106). For Unix folk, there is a lex program that provides the same support for any dialect of lisp. John  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 25 Mar 88 09:12:24 EST Received: from mitre-bedford.ARPA by ELI.CS.YALE.EDU; Fri, 25 Mar 88 09:05:48 EST Full-Name: Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.research (3.2/4.7) id AA01435; Mon, 22 Feb 88 08:44:41 EST From: John D. Ramsdell Posted-Date: Fri, 25 Mar 88 07:52:28 EST Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA12350; Fri, 25 Mar 88 07:52:28 EST Date: Fri, 25 Mar 88 07:52:28 EST Message-Id: <8803251252.AA12350@darwin.sun.uucp> To: t-discussion@YALE.ARPA Cc: ramsdell@mitre-bedford.arpa Subject: Simple support for literate T programming. I recently completed writing a fairly complex program in C. The program had to be easily read by people as it was important that the program was "nearly correct", but not important enough to formally verify the program. I used CWEB, a fairly sophisticated system for producing readable programs using TeX. Now that I have paid my dues by writing in C, I am able to return to using T. It is easier to write T programs that are more readable than plain C programs because the language puts less constraints on how you organize input to the compiler. However, my experience with CWEB has shown it is very nice to be able to write comments in TeX, especially when you use mathematics. I have written some software provides support for literate T programming. It simply interprets the lines between forms, and comments within forms, as LaTeX input. When used to make a document, the T forms are printed in typewriter font. The forms in the text file you edit look just like normal T forms, except the comments may look funny. Thus editors which submit part of a file to T for evaluation will still work. The programs and documentation are in a shar file call "schemeTeX.sh" on linus (192.12.120.106). For Unix folk, there is a lex program that provides the same support for any dialect of lisp. John  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 25 Mar 88 10:34:39 EST Received: from mitre-bedford.ARPA by ELI.CS.YALE.EDU; Fri, 25 Mar 88 10:28:12 EST Full-Name: Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.research (3.2/4.7) id AA03808; Mon, 22 Feb 88 10:07:22 EST From: John D. Ramsdell Posted-Date: Fri, 25 Mar 88 10:26:02 EST Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA12888; Fri, 25 Mar 88 10:26:02 EST Date: Fri, 25 Mar 88 10:26:02 EST Message-Id: <8803251526.AA12888@darwin.sun.uucp> To: t-discussion@YALE.ARPA Subject: Simple support for literate T programming. I recently completed writing a fairly complex program in C. The program had to be easily read by people as it was important that the program was "nearly correct", but not important enough to formally verify the program. I used CWEB, a fairly sophisticated system for producing readable programs using TeX. Now that I have paid my dues by writing in C, I am able to return to using T. It is easier to write T programs that are more readable than plain C programs because the language puts less constraints on how you organize input to the compiler. However, my experience with CWEB has shown it is very nice to be able to write comments in TeX, especially when you use mathematics. I have written some software which provides support for literate T programming. It simply interprets the lines between forms, and comments within forms, as LaTeX input. When used to make a document, the T forms are printed in typewriter font. The forms in the text file you edit look just like normal T forms, except the comments may look funny. Thus editors which submit part of a file to T for evaluation will still work. The programs and documentation are in a shar file call "schemeTeX.sh" on linus (192.12.120.51). For Unix folk, there is a lex program that provides the same support for any dialect of lisp. John PS. The last note contained the wrong ArpaNet address. Sorry for the mistake.  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 28 Mar 88 10:25:11 EST Date: Mon, 28 Mar 88 10:25:51 EST From: Jonathan A Rees Subject: [mcvax!ukc!its63b!aiva!jeff: T operations, etc] To: t-discussion@MC.LCS.MIT.EDU Message-ID: <348651.880328.JAR@AI.AI.MIT.EDU> Date: 24 Mar 88 22:14:27 GMT From: mcvax!ukc!its63b!aiva!jeff at uunet.uu.net (Jeff Dalton) Sender: scheme-request at mc.lcs.mit.edu To: scheme at mc.lcs.mit.edu Re: T operations, etc Organization: Dept. of AI, Univ. of Edinburgh, UK In article <574814312.20004@minster.york.ac.uk> martin@minster.york.ac.uk writes: >I've just discovered that T version 3 has an as-far-as-I-can-tell >undocumented syntax for operations. [...] > ((operation-name (self op-name next first) . args) . body) I'd just noticed that myself. Perhaps it is "unreleased", as the T 2.8 release notes used to say of experimental things. > How many other wonderful things are hiding in T3.0 that people >don't know about because of the (lack of up-to-date) documentation? It works the other way too: the LOCALE special form has stopped working despite being documented in the manual and in Stephen Slade's book. Nonetheless, I suspect the release notes cover most of the changes (they cover the LOCALE one) and so expect that the number of further surprises will be small. >On a similar note... Has anyone succeeded in re-compiling & linking T3.0, >or of suspending a T system? I have not tried rebuilding T, but I have no trouble suspending it with csh job control on a Sun. > Has anyone else in Europe/UK got T3.0? Why, yes: I have one, and I know of at least two others. We should keep in touch. Jeff Dalton, JANET: J.Dalton@uk.ac.ed AI Applications Institute, ARPA: J.Dalton%uk.ac.ed@nss.cs.ucl.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!J.Dalton  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 28 Mar 88 10:25:48 EST Date: Mon, 28 Mar 88 10:26:33 EST From: Jonathan A Rees Subject: [mcvax!ukc!reading!onion!minster!SoftEng!martin: T operations, etc] To: t-discussion@MC.LCS.MIT.EDU Message-ID: <348652.880328.JAR@AI.AI.MIT.EDU> Date: 19 Mar 88 22:38:32 GMT From: mcvax!ukc!reading!onion!minster!SoftEng!martin at uunet.uu.net Sender: scheme-request at mc.lcs.mit.edu To: scheme at mc.lcs.mit.edu Re: T operations, etc Organization: Department of Computer Science, University of York, England I've just discovered that T version 3 has an as-far-as-I-can-tell undocumented syntax for operations. The documentation gives: (object procedure . method-clauses) where a method-clause is: ((operation-name self . args) . body) well, it turns out that a method-clause can also be: ((operation-name (self op-name next first) . args) . body) where 'self' is bound to the 'object' in which the method-clause was defined, as before, 'op-name' is bound to the operation being carried out, 'next' is bound to the next 'object' in the 'join' which would have been asked to field this operation if the present 'object' had not got it, and 'first' is bound to the first 'object' of the 'join' that was asked to field the operation. It seems obvious that these are intended to allow more control over the inheritance of operations. 'first' is the Smalltalk equivalent of self, and 'next' the equivalent of super! 'op-name' appears to allow the forwarding of operations. How many other wonderful things are hiding in T3.0 that people don't know about because of the (lack of up-to-date) documentation? On a similar note... Has anyone succeeded in re-compiling & linking T3.0, or of suspending a T system? Whenever I try to compile things I get syntax errors (or worse!), and whenever I try to suspend I get an indefinite recursion in vgc! Help! Martin usenet: ...!mcvax!ukc!minster!martin surface: Martin C. Atkins Department of Computer Science University of York Heslington York Y01 5DD ENGLAND PS I'm using the Sun-3 version of T PPS Despite the above gripes, I like T very much... It's just that I can't use it for the things I want unless I can link in some more C routines! PPPS Has anyone else in Europe/UK got T3.0?  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 28 Mar 88 11:32:07 EST Date: Mon, 28 Mar 88 11:32:49 EST From: Jonathan A Rees Subject: [kranz: T operations, etc] To: t-discussion@MC.LCS.MIT.EDU Message-ID: <348696.880328.JAR@AI.AI.MIT.EDU> Note to people without Internet FTP access: as far as I know, no tapes will be made of T 3.1; you'll have to either beg or wait for T 3.2, which is due in May, probably. Date: Mon, 28 Mar 88 11:05:50 EST From: kranz at wheaties.ai.mit.edu (David Kranz) To: mcvax!ukc!reading!onion!minster!SoftEng!martin at uunet.uu.net cc: mcvax!ukc!its63b!aiva!jeff at uunet.uu.net, t3-bugs at YALE.ARPA Re: T operations, etc The operation stuff is indeed "unreleased". There is a T3.1 which is not yet officialy released but which you can get from anonymous ftp to wheaties.ai.mit.edu in the pub/t3.1 directory. Rebuilding and suspending systems is documented in this version and there is a script for doing so. In addition, it is possible to dynamically load C code and the interface is fully documented. -David Kranz  Received: from SUNED.ZOO.CS.YALE.EDU (TCP 20011000023) by MC.LCS.MIT.EDU 28 Mar 88 13:33:02 EST Received: by SUNED.ZOO.CS.YALE.EDU; Mon, 28 Mar 88 13:19:56 EST Date: Mon, 28 Mar 88 13:19:56 EST From: Bruce Krulwich Full-Name: Bruce Krulwich Message-Id: <8803281819.AA29453@SUNED.ZOO.CS.YALE.EDU> Received: by yale-zoo-suned (yale-zoo-suned) via WIMP-MAIL (Version 1.2/1.4) ; Mon Mar 28 13:19:53 Subject: Re: T operations, etc. To: t-discussion@YALE.ARPA It seems that this operation definition syntax has been disabled in T3.1, as shown: suned/krulwich> t T 3.0 (17) MC68000/UNIX Copyright (C) 1986 Yale University [...] T Top level > (define-operation zowie) #{Operation 10 ZOWIE} > (set q (object nil ((zowie (a b c d)) (list a b c d)))) [Binding Q] #{Object 11} > (zowie q) (#{Object 11} #{Operation 10 ZOWIE} #{Object 12 *THE-BUCK-STOPS-HERE*} #{Object 11}) > (set a (join (object nil) q)) [Binding A] #{Procedure 13} > (zowie a) (#{Object 11} #{Operation 10 ZOWIE} #{Object 12 *THE-BUCK-STOPS-HERE*} #{Procedure 13}) > (exit) suned/krulwich> suned/krulwich> suned/krulwich> suned/krulwich> t3.1 T 3.1 (1) MC68000/UNIX Copyright (C) 1988 Yale University [...] T Top level > (define-operation zowie) #{Operation 1 ZOWIE} > (set q (object nil ((zowie (a b c d)) (list a b c d)))) ** Syntax error: bad syntax for special form (OBJECT NIL ((ZOWIE (A B C D)) (LIST A B C D))) >> > (exit) Is there a reason that it was removed?? It sounds to me like it would be a useful thing to have. Bruce -------  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 28 Mar 88 14:13:57 EST Received: from shredded-wheat.ai.mit.edu ([128.52.36.33]) by ELI.CS.YALE.EDU; Mon, 28 Mar 88 14:00:56 EST Full-Name: Received: by shredded-wheat.ai.mit.edu; Mon, 28 Mar 88 13:53:13 EST Date: Mon, 28 Mar 88 13:53:13 EST From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8803281853.AA04861@shredded-wheat.ai.mit.edu> To: krulwich-bruce@YALE.ARPA Cc: t-discussion@YALE.ARPA In-Reply-To: Bruce Krulwich's message of Mon, 28 Mar 88 13:19:56 EST <8803281819.AA29453@SUNED.ZOO.CS.YALE.EDU> Subject: T operations, etc. Date: Mon, 28 Mar 88 13:19:56 EST From: Bruce Krulwich It seems that this operation definition syntax has been disabled in T3.1, as shown: suned/krulwich> t T 3.0 (17) MC68000/UNIX Copyright (C) 1986 Yale University [...] T Top level > (define-operation zowie) #{Operation 10 ZOWIE} > (set q (object nil ((zowie (a b c d)) (list a b c d)))) [Binding Q] #{Object 11} > (zowie q) (#{Object 11} #{Operation 10 ZOWIE} #{Object 12 *THE-BUCK-STOPS-HERE*} #{Object 11}) > (set a (join (object nil) q)) [Binding A] #{Procedure 13} > (zowie a) (#{Object 11} #{Operation 10 ZOWIE} #{Object 12 *THE-BUCK-STOPS-HERE*} #{Procedure 13}) > (exit) suned/krulwich> suned/krulwich> suned/krulwich> suned/krulwich> t3.1 T 3.1 (1) MC68000/UNIX Copyright (C) 1988 Yale University [...] T Top level > (define-operation zowie) #{Operation 1 ZOWIE} > (set q (object nil ((zowie (a b c d)) (list a b c d)))) ** Syntax error: bad syntax for special form (OBJECT NIL ((ZOWIE (A B C D)) (LIST A B C D))) >> > (exit) Is there a reason that it was removed?? It sounds to me like it would be a useful thing to have. Bruce ------- In T3.0 there was a bug which caused operations to be not quite tail-recursive. This is fixed in T3.1 but I also changed the (still unreleased) syntax to be (self obj) instead of (obj op next self). You can still get next as (joind-rhs obj). -David  Received: from ATHENA (TCP 2222000047) by MC.LCS.MIT.EDU 29 Mar 88 12:27:02 EST Received: by ATHENA.MIT.EDU (5.45/4.7) id AA29531; Tue, 29 Mar 88 12:24:57 EST From: Received: by M1-142-6 (5.45/4.7) id AA03460; Tue, 29 Mar 88 12:24:20 EST Date: Tue, 29 Mar 88 12:24:20 EST Message-Id: <8803291724.AA03460@M1-142-6> To: t-discussion@mc.lcs.mit.edu Subject: T frontend for XWindows Anyone written/writing/contemplating T frontend to X11/X10 XWindows? tnx Mitchell Charity  Received: from neptune.CS.UCLA.EDU (TCP 20030216011) by MC.LCS.MIT.EDU 29 Mar 88 12:46:21 EST Return-Path: Received: by neptune.CS.UCLA.EDU (Sendmail 5.54/2.03) id AA11565; Tue, 29 Mar 88 09:42:07 PST Date: Tue, 29 Mar 88 09:42:07 PST From: dorab@CS.UCLA.EDU (Dorab Patel) Message-Id: <8803291742.AA11565@neptune.CS.UCLA.EDU> To: , t-discussion@mc.lcs.mit.edu Subject: Re: T frontend for XWindows i have a foreign function interface to X10 from T (well, most of X10 anyway) and am working on the corresponding X11 suff (but that's going real slow because of other commitments). though a foreign function interface is probably easiest, it would be real nice if someone would translate the CLX stuff to T and use T paradigms.... 'dorab  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 30 Mar 88 18:22:59 EST Received: by ELI.CS.YALE.EDU; Wed, 30 Mar 88 18:13:59 EST From: James Philbin Full-Name: James Philbin Message-Id: <8803302313.AA08818@ELI.CS.YALE.EDU> Received: by yale-ring (node-aac0/AAC0) via WIMP-MAIL (Version 1.3/1.5) ; Wed Mar 30 18:04:39 Date: Wed, 30 Mar 88 18:04:30 EST Subject: VMS T2.8 To: t-discussion@YALE.ARPA Would anyone who has a working VMS T version 2.8 please contact me. Thanks. - Jim -------  Received: from FLO.CS.YALE.EDU (TCP 20011000022) by MC.LCS.MIT.EDU 31 Mar 88 09:32:15 EST Received: by FLO.CS.YALE.EDU; Thu, 31 Mar 88 09:25:46 EST Date: Thu, 31 Mar 88 09:25:46 EST From: "H. Morrow Long" Full-Name: "H. Morrow Long" Message-Id: <8803311425.AA10596@FLO.CS.YALE.EDU> To: t-discussion@YALE.ARPA Subject: testing mail to t-discussion mailing list testing mail to t-discussion mailing list  Received: from BULLDOG.CS.YALE.EDU (TCP 20011000003) by MC.LCS.MIT.EDU 31 Mar 88 12:31:29 EST Received: from mitre-bedford.ARPA by BULLDOG.CS.YALE.EDU; Thu, 31 Mar 88 12:21:27 EST Full-Name: Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.research (3.2/4.7) id AA11456; Thu, 31 Mar 88 12:18:02 EST From: John D. Ramsdell Posted-Date: Thu, 31 Mar 88 12:18:45 EST Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA02731; Thu, 31 Mar 88 12:18:45 EST Date: Thu, 31 Mar 88 12:18:45 EST Message-Id: <8803311718.AA02731@darwin.sun.uucp> To: t-discussion@YALE.ARPA Subject: Alliant T3.1 Alliant T3.1 is available for Alliant Concentrix 3.1.0. Ftp from linus at 192.12.120.51. John  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 6 Apr 88 23:24:14 EDT Received: by ATHENA.CS.YALE.EDU; Wed, 6 Apr 88 23:09:44 EDT From: Stephen Slade Full-Name: Stephen Slade Message-Id: <8804070309.AA00814@ATHENA.CS.YALE.EDU> Received: by yale-ring (node-e769/E769) via WIMP-MAIL (Version 1.3/1.5) ; Wed Apr 6 22:53:39 Date: Wed, 6 Apr 88 22:53:36 EDT Subject: [Bard Bloom : ANY and ANY?] To: t-discussion@YALE.ARPA **** Forwarded Message Follows **** Received: by YALE-RING-MAIL-GW via SSMTP ($Revision: 1.19 $) ; Fri Apr 1 01:18:50 1988 Received: from THEORY.LCS.MIT.EDU by ELI.CS.YALE.EDU; Fri, 1 Apr 88 01:07:32 EST Full-Name: Received: from TOUCAN.LCS.MIT.EDU by THEORY.LCS.MIT.EDU (4.12/4.7); Fri, 1 Apr 88 00:16:02 est Received: by TOUCAN.LCS.MIT.EDU (4.12/4.7); Thu, 31 Mar 88 23:35:18 est Date: Thu, 31 Mar 88 23:35:18 est From: Bard Bloom Message-Id: <8804010435.AA01539@TOUCAN.LCS.MIT.EDU> To: slade-stephen@YALE.ARPA Subject: ANY and ANY? (This is for the T mailing list, but I can't find the address) T seems to have two functions, called ANY and ANY?, which evidently behave identically. Both of them are documented. Both ANYs take a predicate and some lists, and call predicate on successive cars of lists, until it returns true; then the ANY returns true. If none do, it returns false. The two are not EQ?. Actually, according to the manual, ANY is a sequential function -- it is supposed to do what it actually does. ANY? "Returns true if any element of _list_ answers true to _predicate_" -- e.g., if (predicate 'a) diverges (predicate 'b) returns true then (ANY predicate '(a b a)) should diverge (ANY? predicate '(a b a)) should return true Naturally, ANY? seems to diverge here, despite the manual. I personally suspect that the manual isn't serious about the definition of ANY?. The rest of the language is sequential, and ANY? as formally defined seems to require concurrent calculation of (predicate a) and (predicate b). Unless perhaps someone added a parallel-or function to make the language fully abstract with respect to Scott semantics? If so, I'd very much like to hear about it: I work in Scott semantics and it would be wonderful to know that someone was taking us seriously. Or is it just an accident? -- Bard the \x.gargoyle **** End of Forwarded Message **** -------  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 7 Apr 88 01:54:08 EDT Received: from lanai.cs.ucla.edu by ELI.CS.YALE.EDU; Wed, 6 Apr 88 23:41:10 EST Return-Path: Received: by lanai.cs.ucla.edu (Sendmail 5.58.2/2.04) id AA25418; Wed, 6 Apr 88 21:40:47 PDT Date: Wed, 6 Apr 88 21:40:47 PDT From: jason@CS.UCLA.EDU (Jason Rosenberg) Message-Id: <8804070440.AA25418@lanai.cs.ucla.edu> To: T-Users@YALE.ARPA Cc: d@CS.UCLA.EDU Please remove me from the mailing list. Thanks, Jason Rosenberg  Received: from ELI.CS.YALE.EDU (TCP 20011000001) by MC.LCS.MIT.EDU 7 Apr 88 10:18:40 EDT Received: by ELI.CS.YALE.EDU; Thu, 7 Apr 88 09:08:21 EST Date: Thu, 7 Apr 88 09:08:21 EST Full-Name: Ashwin Ram Message-Id: <8804071408.AA04345@ELI.CS.YALE.EDU> Received: by yale-ring (node-abc3/ABC3) via WIMP-MAIL (Version 1.3/1.5) ; Thu Apr 7 09:58:19 To: t-discussion@YALE.ARPA (Newsgroups: arpa.t-discussion) From: Ram-Ashwin@YALE.ARPA (Ashwin Ram) Subject: Re: [Bard Bloom : ANY and ANY?] References: <26643@yale-celray.yale.UUCP> Reply-To: Ram-Ashwin@YALE.ARPA (Ashwin Ram) In-Reply-To: slade-stephen@yale.UUCP Organization: Computer Science, Yale University, New Haven, CT 06520-2158 In article <26643@yale-celray.yale.UUCP>, slade-stephen@yale writes: > T seems to have two functions, called ANY and ANY?, which evidently > behave identically. Both of them are documented. Both ANYs take a > predicate and some lists, and call predicate on successive cars of lists, > until it returns true; then the ANY returns true. If none do, it returns > false. The two are not EQ?. ANY and ANY? do not behave identically, but they're pretty close. I don't know how the manual is worded, but I think ANY is supposed to return the first non-nil value that the predicate returns, whereas ANY? returns #T or #F (true or false). When I last checked, the definition of ANY? was something like: (define-integrable any? (compose true? any)) Similarly ANYCDR?, EVERY? and EVERYCDR?. If you call ANY with a true predicate, both ANY and ANY? will behave identically. -- Ashwin. ARPA: Ram-Ashwin@cs.yale.edu UUCP: {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin BITNET: Ram@yalecs  Received: from ll-vlsi.arpa (TCP 1200200012) by MC.LCS.MIT.EDU 14 Apr 88 20:53:06 EDT Received: by ll-vlsi.arpa (5.51/3.2.sst.ll) id AA17420; Thu, 14 Apr 88 19:49:56 EST From: James J. Hunt Received: by sonett.vlsi.ll.mit.edu (3.2/SMI-3.2) id AA19779; Thu, 14 Apr 88 20:49:54 EDT Date: Thu, 14 Apr 88 20:49:54 EDT Message-Id: <8804150049.AA19779@sonett.vlsi.ll.mit.edu> To: T-Discussion@mc.lcs.mit.edu Cc: JJH@ll-vlsi.arpa Subject: Naive T Design Questions 1. What is the advantage of having #T and '() not EQ?? 2. Why isn't BOUND? known to Orbit (especially since *BOUND? exists)? 3. Why was VALUES renamed to RETURN? RETURN seems to imply change of the control flow which return does not do! 4. (This is not a design question.) Is there a place where T code may be deposited for the purpose of making it generally available? For example, I have some code: a version of T3 that runs on SUN-2s, a T version of OPS5 (for whatever that's worth), and a DEFINE-FUNCTION macro that accepts all the Common LISP DEFUN bells and whistles, that I would gladly make available if I could (we have no anonymous FTP). In general, I think code sharing amoung T users should be encouraged as much as possible so that we are not all running around recoding simple tools in T. 5. The Ellisp macro package for Maclisp had a macro for then and else clauses in if statements. This greatly improved the readablility of all but the simplest if constructs in a program. (if (predicate? foo) (then (f1 ...) ... (fn ...)) (else (g1 ...) ... (gn ...))) vs. (if (predicate? foo) (block (f1 ...) ... (fn ...)) (block (g1 ...) ... (gn ...))) Why not include this in T? (I know, INSIPID FEATURISM!, but it does seem to make code easier to read.) I even have a macro that expands all three legal combinations of THEN and ELSE, presence and absents (see below). 6. Is this really the best way to implement self evaluating keywords in T: (define (read-keyword port ch rt) (let ((keyword (read-atom port rt ch))) (*lset (the-environment) keyword keyword)))? I've tried several things with QUOTE but they all fail in some obscure way, and I don't want to touch EVAL and friends! Despite the fact that I borrow freely from other dialects, T is the best, and cleanest LISP that I've used! Thanks in advance, JJHunt P.S. I am including the IF THEN ELSE code here because it is short. ;;; ;;; The macro is for improving the readablility of if statements. It allow ;;; the use of THEN and ELSE instead of BLOCK for extending then and else ;;; clauses. For example on can write (IF test (THEN . yes) (ELSE . no)) ;;; instead of (IF test (BLOCK . yes) (BLOCK . no)), where yes and no are ;;; lists of forms to be evaluated when test is true or false repectively. ;;; It also returns nil if the test fails and there is no else clause. ;;; (define-syntax (if test then-expr . rest) (let ((else-expr (car rest))) (cond ((null? rest) `(,(t-syntax 'if) ,test ,(if (and (pair? then-expr) (eq? (car then-expr) 'then)) `(block ,@(cdr then-expr)) then-expr) nil)) ((= 1 (length rest)) `(,(t-syntax 'if) ,test ,(if (and (pair? then-expr) (eq? (car then-expr) 'then)) `(block ,@(cdr then-expr)) then-expr) ,(if (and (pair? else-expr) (eq? (car else-expr) 'else)) `(block ,@(cdr else-expr)) else-expr))) (else (error "Wrong number of arguments to if: ~a~%" `(if ,test ,then-expr ,@rest))))))  Received: from ll-vlsi.arpa (TCP 1200200012) by MC.LCS.MIT.EDU 14 Apr 88 22:03:01 EDT Received: by ll-vlsi.arpa (5.51/3.2.sst.ll) id AA17504; Thu, 14 Apr 88 20:59:51 EST From: James J. Hunt Received: by sonett.vlsi.ll.mit.edu (3.2/SMI-3.2) id AA19898; Thu, 14 Apr 88 21:59:49 EDT Date: Thu, 14 Apr 88 21:59:49 EDT Message-Id: <8804150159.AA19898@sonett.vlsi.ll.mit.edu> To: T-Discussion@mc.lcs.mit.edu Cc: JJH@ll-vlsi.arpa Subject: Naive T Design Questions Addendum 1. Oops! #T should read #F. 6. Sorry, the form given in the last message: (define (read-keyword port ch rt) (let ((keyword (read-atom port rt ch))) (*lset (the-environment) keyword keyword))) is brain dead. The second keyword in the *lset needs to be (list quote keyword), but this doesn't work either since (the-environment) is evaluated at the wrong time! I don't know how to get the correct environment for this, the one into which the keyword is being read. Quoting doesn't work because it is not known at read time if the keyword will be evaluated later: ':key '(some list with :key embedded) `(some list with ,(read-port-with-different-read-table) embedded and file contains :key) etc. 7. Why not separate the concept of () and no entry in tables? This would be easy to implement since () valued keys could be left in place. Then keys not present would denote empty key values. The function TABLE-ENTRY should still probably return () for both. Two new function would be needed: TABLE-ENTRY? for existence, and REMOVE-TABLE-ENTRY for removing a key from the table. Note that having both #F and () doen't get one out of this mess, because one could imagine storing a false for the value of one key and an empty list for the value of another. The user could map both back into say () but that would really violate the notion of there separation (not to mention what this may later break)! Thanks in advance, JJHunt P.S. The IF THEN ELSE macro would be more efficient if (= 1 (length rest)), is replaced by (not (cdr rest)).  Received: from ll-vlsi.arpa (TCP 1200200012) by MC.LCS.MIT.EDU 14 Apr 88 22:57:06 EDT Received: by ll-vlsi.arpa (5.51/3.2.sst.ll) id AA17558; Thu, 14 Apr 88 21:54:06 EST From: James J. Hunt Received: by sonett.vlsi.ll.mit.edu (3.2/SMI-3.2) id AA19955; Thu, 14 Apr 88 22:54:05 EDT Date: Thu, 14 Apr 88 22:54:05 EDT Message-Id: <8804150254.AA19955@sonett.vlsi.ll.mit.edu> To: T-Discussion@mc.lcs.mit.edu Subject: More On Naive T Design Question 6 Sorry, I didn't think the keyword problem out very well in reguards to using environments. The following works, but is ugly: (define (read-keyword port ch rt) (let ((keyword (read-atom port rt ch))) (*lset standard-env `(quote ,keyword) `(quote ,keyword)))) Though I've never used an environment that isn't under standard-env one would want to be able too do this and still have keywords work. If I were just interested in implementing Common Lisp in T, I might do the following: root | +--------------+-----+------+---------------+ | | | | standard-env implementation-env orbit ... cl-standard-env | | +------+--------+ | | | | user-env cl-implementation-env keyword-package | +------+-------+ | | user-package other-packages But for use in T, one would need a keyword-env that is parent to all environments of interest. But is the *lset really neccesary? And, if so, is it better to check and then set or always set? Thanks, JJHunt P.S. For the Common LISP implementation, one would want to have several environments for each package: -function-env, -value-env, -function-export-env, -value-export-env, etc. The export environments are needed for distinguishing between package:value and package::value syntax.  Received: from uunet.UU.NET (TCP 30003106601) by MC.LCS.MIT.EDU 15 Apr 88 11:03:03 EDT Received: from enea.UUCP by uunet.UU.NET (5.54/1.14) with UUCP id AA02418; Fri, 15 Apr 88 10:59:20 EDT Received: by enea.se (5.57++/1.21) id AA09767; Fri, 15 Apr 88 13:27:57 +0200 (MET) Received: by sotka.tut.fi; id AA01071; Fri, 15 Apr 88 14:29:34 +0200 Received: by korppi.tut.fi; id AA02186; Fri, 15 Apr 88 14:29:34 +0200 Message-Id: <8804151229.AA02186@korppi.tut.fi> Date: Fri, 15 Apr 88 14:29:34 +0200 From: jh@tut.fi (Juha Hein{nen) To: T-Discussion@mc.lcs.mit.edu Cc: jar@ai.ai.mit.edu Subject: multiple return values and let T 3.0 release notes describe a reveive form for binding multiple names to multiple return values. In stead of introducing yet another binding construct I would prefer to extend the existing let construct. For example, in stead of (receive (a b c) (return 1 2 3) (list a b c)) I would like to write (let (((a b c) (return 1 2 3))) (list a b c)) This note was trickered by a Scheme article in recent Lisp Pointers where it was mentioned that multiple return values are likely to be part of the next version of Scheme. Juha Heinanen Tampere Univ of Technology Finland  Received: from mitre-bedford.ARPA (TCP 3200600102) by MC.LCS.MIT.EDU 15 Apr 88 13:43:15 EDT Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.MENET (3.2/4.7) id AA27546; Fri, 15 Apr 88 13:38:24 EDT From: John D. Ramsdell Posted-Date: Fri, 15 Apr 88 13:38:15 EDT Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA09684; Fri, 15 Apr 88 13:38:15 EDT Date: Fri, 15 Apr 88 13:38:15 EDT Message-Id: <8804151738.AA09684@darwin.sun.uucp> To: jjh@ll-vlsi.ARPA Cc: T-Discussion@mc.lcs.mit.edu, JJH@ll-vlsi.ARPA In-Reply-To: James J. Hunt's message of Thu, 14 Apr 88 20:49:54 EDT <8804150049.AA19779@sonett.vlsi.ll.mit.edu> Subject: Naive T Design Questions >1. What is the advantage of having #T and '() not EQ?? Did you mean '#f and '()? John  Received: from norbo.cs.wisc.edu (TCP 20032201146) by MC.LCS.MIT.EDU 15 Apr 88 14:50:35 EDT Date: Fri, 15 Apr 88 12:47:45 CST From: wu@cs.wisc.edu (Felix S.-T. Wu) Message-Id: <8804151847.AA26352@norbo.cs.wisc.edu> Received: by norbo.cs.wisc.edu; Fri, 15 Apr 88 12:47:45 CST To: t-discussion@mc.lcs.mit.edu Subject: question on operation handling Is there a [simple] way to check if an object can handle some particular operation ?  Received: from shredded-wheat.ai.mit.edu (TCP 20015022041) by MC.LCS.MIT.EDU 15 Apr 88 15:34:26 EDT Received: by shredded-wheat.ai.mit.edu; Fri, 15 Apr 88 15:32:12 EDT Date: Fri, 15 Apr 88 15:32:12 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8804151932.AA01299@shredded-wheat.ai.mit.edu> To: wu@cs.wisc.edu Cc: t-discussion@mc.lcs.mit.edu In-Reply-To: Felix S.-T. Wu's message of Fri, 15 Apr 88 12:47:45 CST <8804151847.AA26352@norbo.cs.wisc.edu> Subject: question on operation handling Date: Fri, 15 Apr 88 12:47:45 CST From: wu@cs.wisc.edu (Felix S.-T. Wu) Is there a [simple] way to check if an object can handle some particular operation ? No. You could change OBJECT to make something which handled an OPERATIONS-HANDLED operation.  Received: from amax.NPAC.SYR.EDU (TCP 20071400404) by MC.LCS.MIT.EDU 18 Apr 88 11:49:11 EDT Date: Mon, 18 Apr 88 11:46:30 edt From: jbennett@amax.NPAC.SYR.EDU (James P. Bennett) Received: by amax.NPAC.SYR.EDU (4.12/Northeast-Parallel-Architectures-Center) id AA15418; Mon, 18 Apr 88 11:46:30 edt Message-Id: <8804181546.AA15418@amax.NPAC.SYR.EDU> To: T-Discussion@mc.lcs.mit.edu Subject: environmental query Cc: jbennett@cmx.npac.syr.edu I've been thinking of expressing Gilles Fauconnier's idea of 'mental spaces,' which he considers to be generated by syntax, as T environments. Does anyone have experience with manipulating locales in a NLP application? The the release notes for 3.0, it is said that a module system to replace locale is being written. Information available on that? Thanks, jim  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 18 Apr 88 17:27:23 EDT Received: from gargoyle.uchicago.edu ([128.135.20.100]) by ELI.CS.YALE.EDU; Mon, 18 Apr 88 17:15:53 EDT Full-Name: Received: by gargoyle.uchicago.edu from anubis.uchicago.edu (5.54/1.14) id AA28305; Mon, 18 Apr 88 15:47:50 CDT Received: by anubis.uchicago.edu (5.52/4.7) id AA03470; Mon, 18 Apr 88 15:47:28 CDT Date: Mon, 18 Apr 88 15:47:28 CDT From: converse@anubis.uchicago.edu (Tim Converse) Message-Id: <8804182047.AA03470@anubis.uchicago.edu> To: t-discussion@YALE.ARPA Subject: Naive T question I'm using T on an Apollo, and would like to be measuring the CPU time used by various function calls. Anybody know of a way to do this? I imagine there's some way to do this using DEFINE-FOREIGN, but I don't know what the system call itself would look like. --tim converse (converse@gargoyle.uchicago.edu ..!ihnp4!gargoyle!converse)  Received: from sutcase.case.syr.edu (TCP 20071401013) by MC.LCS.MIT.EDU 18 Apr 88 20:54:07 EDT Date: Mon, 18 Apr 88 20:51:31 EST From: Stuart Thorson To: T-Discussion@MC.LCS.MIT.EDU Subject: Please add me Please add me to the T discussion list. Thanks. --Stu  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 21 Apr 88 11:33:25 EDT Received: from uunet.UU.NET by ELI.CS.YALE.EDU; Thu, 21 Apr 88 09:05:58 EDT Received: from enea.UUCP by uunet.UU.NET (5.54/1.14) with UUCP id AA13983; Thu, 21 Apr 88 05:48:22 EDT Received: by enea.se (5.57++/1.21) id AA13405; Thu, 21 Apr 88 08:31:24 +0200 (MET) Received: by sotka.tut.fi; id AA15665; Wed, 20 Apr 88 19:07:59 +0200 Received: by korppi.tut.fi; id AA07249; Wed, 20 Apr 88 19:08:27 +0200 Message-Id: <8804201708.AA07249@korppi.tut.fi> Date: Wed, 20 Apr 88 19:08:27 +0200 From: jh@tut.fi (Juha Hein{nen) To: t-discussion@YALE.ARPA In-Reply-To: Tim Converse's message of Mon, 18 Apr 88 15:47:28 CDT <8804182047.AA03470@anubis.uchicago.edu> Subject: Naive T question I'm using T on an Apollo, and would like to be measuring the CPU time used by various function calls. Anybody know of a way to do this? I imagine there's some way to do this using I have found in the file unix_timer.t functions monitor and bench. How I should call them? They don't seem to be defined in any of the environments mentioned in the release notes. Also I would like to be able to call some T prosedures, bench and others, from the Scheme environment. How is that accomplished? Thirdly, I have not found any documentation on how to rebuild the system or an environment. There is a lot of things missing in the Scheme environment which I would like to add but don't know how to make a new Scheme environment that includes them. Juha Heinanen Tampere Univ of Tech Finland  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 22 Apr 88 11:07:54 EDT Received: from aerospace.aero.org by ELI.CS.YALE.EDU; Fri, 22 Apr 88 10:39:12 EDT Full-Name: Received: by aerospace.aero.org (5.54/6.0.GT) id AA03545; Thu, 21 Apr 88 13:12:11 PST Posted-Date: Thu, 21 Apr 88 13:12:10 -0800 Message-Id: <8804212112.AA03545@aerospace.aero.org> To: t-users@YALE.ARPA Subject: Profiling Date: Thu, 21 Apr 88 13:12:10 -0800 From: srt@aerospace.aero.org I forget exactly where this came from, but it might prove useful to those people interested in timing stuff in T3: (herald profile (env tsys)) ;;; The beginings of a profiler. (define (make-uid_$t) (make-bytev 8)) (define-foreign proc2_$who_am_i (proc2_$who_am_i (ignore rep/extend my-uid)) ignore) (define (make-proc2_$info_t) (make-bytev 112)) (define (cpu_total.high info) (mref-integer info 28)) (define (cpu_total.low info) (mref-16-u info 28)) (define (priv_faults info) (mref-integer info 86)) (define (glob_faults info) (mref-integer info 90)) (define (disk_page_io info) (mref-integer info 94)) (define (net_page_io info) (mref-integer info 98)) (define-foreign proc2_$get_info (proc2_$get_info (ignore rep/extend process-uid) (out rep/extend info) (in rep/integer-16-u info-buf-length) (out rep/integer status)) ignore) (define (make-time_$clock_t) (make-bytev 6)) (define-foreign time_$clock (time_$clock (ignore rep/extend clock)) ignore) (define-syntax (monitor . expr) `(let ((thunk (lambda () ,@expr))) (%monitor 1 thunk))) (define-syntax (bench repetitions . expr) `(let ((thunk (lambda () ,@expr))) (%monitor ,repetitions thunk))) ;++ why is cpu sometime greater than elapsed? ;++ make this machine independent ********* (let ((pid (make-uid_$t)) (start (make-time_$clock_t)) (stop (make-time_$clock_t)) (pstart (make-proc2_$info_t)) (pstop (make-proc2_$info_t))) (define (%monitor repetitions thunk) (proc2_$who_am_i pid) (let ((heap-start (process-global task/area-frontier))) (time_$clock start) (proc2_$get_info pid pstart 112 nil) (let ((val (iterate loop ((i 1)) (cond ((fx>= i repetitions) (thunk)) (else (thunk) (loop (fx+ i 1))))))) (proc2_$get_info pid pstop 112 nil) (time_$clock stop) (let* ((heap-stop (process-global task/area-frontier)) (cells (fx- heap-stop heap-start)) (etime (- (clock->bignum stop) (clock->bignum start))) (cpu (- (info->cpu pstop) (info->cpu pstart))) (priv (fx- (priv_faults pstop) (priv_faults pstart))) (glob (fx- (glob_faults pstop) (glob_faults pstart))) (disk (fx- (disk_page_io pstop) (disk_page_io pstart))) (net (fx- (net_page_io pstop) (net_page_io pstart)))) (let ((factor (* 250000 repetitions))) (format t "~&;Elapsed time = ~a.~a CPU time = ~a.~a~%" (quotient etime factor) (remainder etime factor) (quotient cpu factor) (remainder cpu factor))) (format t "~&;Page faults: Private = ~a Global = ~a Disk = ~a Net = ~a~%" (quotient priv repetitions) (quotient glob repetitions) (quotient disk repetitions) (quotient net repetitions)) (format t "~&;Consed ~s longwords~%" cells) val))))) (define (info->cpu info) (+ (ash (mref-16-u info 28) 32) (ash (mref-16-u info 30) 16) (mref-16-u info 32))) (define (clock->bignum clock) (+ (ash (mref-16-u clock 0) 32) (ash (mref-16-u clock 2) 16) (mref-16-u clock 4)))  Received: from SUNED.ZOO.CS.YALE.EDU (TCP 20011000023) by MC.LCS.MIT.EDU 26 Apr 88 12:55:35 EDT Received: by SUNED.ZOO.CS.YALE.EDU; Tue, 26 Apr 88 12:40:41 EDT From: Bruce Krulwich Full-Name: Bruce Krulwich Message-Id: <8804261640.AA04884@SUNED.ZOO.CS.YALE.EDU> Received: by yale-zoo-suned (yale-zoo-suned) via WIMP-MAIL (Version 1.3/1.5) ; Tue Apr 26 12:40:38 Date: Tue, 26 Apr 88 12:40:37 EDT Subject: Scheme EXTEND-SYNTAX To: t-discussion@YALE.ARPA Hi. Has anyone ported the EXTEND-SYNTAX that's been discussed on the scheme mailing list (and COMP.LANG.SCHEME) to T ?? Bruce Krulwich -------  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 26 Apr 88 16:15:16 EDT Date: Tue, 26 Apr 88 16:18:00 EDT From: Jonathan A Rees Subject: Naive T Design Questions To: jjh@LL-VLSI.ARPA cc: T-Discussion@MC.LCS.MIT.EDU In-reply-to: Msg of Thu 14 Apr 88 20:49:54 EDT from James J. Hunt Message-ID: <365965.880426.JAR@AI.AI.MIT.EDU> Date: Thu, 14 Apr 88 20:49:54 EDT From: James J. Hunt 1. What is the advantage of having #F and '() not EQ?? In my experience, institutionalizing this pun and makes code harder to understand. Having these objects be distinct encourages better type discipline. 2. Why isn't BOUND? known to Orbit (especially since *BOUND? exists)? It shouldn't be known to anyone. Side effects to environments are meta-operations; the existence of things like BOUND? in the language (as opposed to the meta-language) breaks desirable invariants like order-independence of effectless definitions. 3. Why was VALUES renamed to RETURN? RETURN seems to imply change of the control flow which return does not do! Invoking a continuation is a return. RETURN invokes a continuation. 4. (This is not a design question.) Is there a place where T code may be deposited for the purpose of making it generally available? For example, I have some code: a version of T3 that runs on SUN-2s, a T version of OPS5 (for whatever that's worth), and a DEFINE-FUNCTION macro that accepts all the Common LISP DEFUN bells and whistles, that I would gladly make available if I could (we have no anonymous FTP). In general, I think code sharing amoung T users should be encouraged as much as possible so that we are not all running around recoding simple tools in T. There used to be a "T software exchange". I don't know what became of it. 5. Why not include this [Ellisp's IF] in T? T has COND. 6. Is this really the best way to implement self evaluating keywords in T: (define (read-keyword port ch rt) (let ((keyword (read-atom port rt ch))) (*lset (the-environment) keyword keyword)))? I've tried several things with QUOTE but they all fail in some obscure way, and I don't want to touch EVAL and friends! You could implement keywords as strings or bignums, both of which self-evaluate, and write your own printer that prints them. You can maintain your own table of unique copies so that eq? works. Another solution is to use QUOTE, e.g. (foo ':bar 3) instead of (foo :bar 3). Another approach is to do (define :bar ':bar) for each keyword you use. Actually, in T you can use ordinary symbols instead of keywords, since you don't have to worry about the vagaries of multiple packages: (foo 'bar 3)  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 26 Apr 88 16:15:51 EDT Date: Tue, 26 Apr 88 16:18:41 EDT From: Jonathan A Rees Subject: Naive T Design Questions Addendum To: jjh@LL-VLSI.ARPA cc: T-Discussion@MC.LCS.MIT.EDU In-reply-to: Msg of Thu 14 Apr 88 21:59:49 EDT from James J. Hunt Message-ID: <365967.880426.JAR@AI.AI.MIT.EDU> Date: Thu, 14 Apr 88 21:59:49 EDT From: James J. Hunt 7. Why not separate the concept of () and no entry in tables? (I think you mean #F, not (), since absence of entry is indicated by a false return from table-entry.) This is easily simulated given the existing primitives, so it would be an unnecessary complication. E.g. it would require the addition of something like a TABLE-HAS-ENTRY? predicate, and it would require the addition of a separate procedure for deleting entries (currently you can just store a #F). P.S. The IF THEN ELSE macro would be more efficient if (= 1 (length rest)), is replaced by (not (cdr rest)). You are dealing with lists, not booleans, so I think you want NULL?, not NOT here.  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 27 Apr 88 19:41:56 EDT Received: from oahu.cs.ucla.edu by ELI.CS.YALE.EDU; Wed, 27 Apr 88 18:31:52 EDT Return-Path: Received: from LocalHost by oahu.cs.ucla.edu (Sendmail 5.58.2/2.04) id AA20092; Wed, 27 Apr 88 15:29:34 PDT Message-Id: <8804272229.AA20092@oahu.cs.ucla.edu> To: t3-bugs@YALE.ARPA, t-users@YALE.ARPA Subject: Problems with T3.0 (17) and SR9.7/DN4000's Date: Wed, 27 Apr 88 15:29:31 PDT From: seth@CS.UCLA.EDU It's time for my monthly request for help in resolving the above. Some helpful replies and/or dialog would be nice (there are a few people who always respond). Here's the scoop: Config: DN3xxx or DN4xxx, SR9.7, T3.0 (17) 1. define-foreign interface doesn't seem to work quite right. Some system calls don't return error codes but have no effect and other calls work sometimes and cause errors at other times. An example of the latter is gpr_$text. I call it all over the place and there is one call that always fails that used to work just fine under SR9.5.1. Config: DN4xxx, SR9.7, T3.0 (17) 1. GC breaks to the Z-system level (tell the implementors...) just before it finishes. (RET) sometimes allows one to continue with out any visible problems but eventually this loses. With SR10 around the corner and the requirement that all nodes in the network must be running at least SR9.7 to be compatable these minor annoyances take on great significance. Basically, all our code is about to break and there are no solutions in sight. I'll be happy to provide details for any of the above. I also suspect that part of the problem might go away if we could rebuild T under SR9.7. Any clues on how to do this would also be welcome. Thanks, Seth  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 27 Apr 88 19:44:05 EDT Received: from ifi.uio.no ([128.39.2.2]) by yale-eli.arpa; Wed, 27 Apr 88 08:47:13 EDT Date: Wed, 27 Apr 88 10:02:16 +0200 From: even@ifi.uio.no Message-Id: <8804270802.AA02652@svipall> To: krulwich-bruce@YALE.ARPA Cc: t-discussion@YALE.ARPA In-Reply-To: Bruce Krulwich's message of Tue, 26 Apr 88 12:40:37 EDT <8804261640.AA04884@SUNED.ZOO.CS.YALE.EDU> Subject: Scheme EXTEND-SYNTAX I'm working on it. If I have access to the net when I'm finished I will send a message to t-discussion. -Even.  Received: from CENTRO.SOAR.CS.CMU.EDU (TCP 20000557276) by MC.LCS.MIT.EDU 27 Apr 88 23:13:29 EDT Date: Wed Apr 27 05:35:21 1988 From: Olin.Shivers@CENTRO.SOAR.CS.CMU.EDU To: JAR@AI.AI.MIT.EDU CC: jjh@LL-VLSI.ARPA, T-Discussion@MC.LCS.MIT.EDU In-reply-to: Jonathan A Rees's message of Tue, 26 Apr 88 16:18:00 EDT <365965.880426.JAR@AI.AI.MIT.EDU> Subject: Naive T Design Questions 3. Why was VALUES renamed to RETURN? RETURN seems to imply change of the control flow which return does not do! Invoking a continuation is a return. RETURN invokes a continuation. So do + and CAR. Why don't we rename them RETURN-+ and RETURN-CAR? My point is that invoking continuations is no special distinction -- all primops do it. JJH has a real point -- there is a lot of momentum behind regarding RETURN as something that throws out of the current defun, basically because almost everyone knows either C or CommonLisp. T is flying in the face of at least two major standards by binding this name to this alternate semantics. Now, departing from old standards is a fine thing to do, if there is a good reason for it, but I can't see one in this case. VALUES doesn't have the connotation of throwing out of nested control structure. It does emphasize that multiple-values are being passed. And *that* is exactly what VALUES is -- it is just the MV identity primop. It invokes its continuation in a way that is just like any other primop, modulo the MV property. So the interesting thing about this function is *not* that a continuation is invoked, but that multiple values are passed. VALUES is a better name. 4. (This is not a design question.) Is there a place where T code may be deposited for the purpose of making it generally available? ... In general, I think code sharing amoung T users should be encouraged as much as possible so that we are not all running around recoding simple tools in T. This is an excellent idea. In particular, the tutils software from Yale doesn't come with the distribution. But it is good stuff to provide the user community, particularly since Scheme looping primitives are so... primitive. Could we store such a library of stuff on prep? CMU, alas, does not allow anonymous ftp. Very paranoid facilities folks around here. Actually, in T you can use ordinary symbols instead of keywords, since you don't have to worry about the vagaries of multiple packages: (foo 'bar 3) But you *do* have to worry about multiple packages if you are doing a "real" CommonLisp implementation/translator. Which is useful, not because programming in CL is fun, but because there are a lot of CL programs out there that would be useful tools for Scheme programmers. -Olin (define (fact n) (if (return-= n 0) 1 (return-* n (fact (return- n 1)))))  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 28 Apr 88 02:21:38 EDT Date: Wed, 27 Apr 88 14:49:57 EDT From: Jonathan A Rees Subject: Naive T Design Questions To: Olin.Shivers@CS.CMU.EDU cc: jjh@LL-VLSI.ARPA, T-Discussion@MC.LCS.MIT.EDU In-reply-to: Msg of Wed Apr 27 05:35:21 1988 from Olin.Shivers at CENTRO.SOAR.CS.CMU.EDU Message-ID: <366459.880427.JAR@AI.AI.MIT.EDU> Date: Wed Apr 27 05:35:21 1988 From: Olin.Shivers at CENTRO.SOAR.CS.CMU.EDU VALUES is a better name. OK, I'm sold. I'm glad you didn't say it was a good name. Or how about IDENTITY? Just kidding. Could we store such a library of stuff on prep? Prep will probably be going away, so the AI lab sun file servers would be a better choice. All you need is someone at MIT to volunteer to administer the thing. But you *do* have to worry about multiple packages if you are doing a "real" CommonLisp implementation/translator. Which is useful, not because programming in CL is fun, but because there are a lot of CL programs out there that would be useful tools for Scheme programmers. Implementing Common Lisp in T would be possible --- all the right hooks are there, I think --- but doing enough to allow execution of any but the most trivial programs would be a major undertaking. If someone wants to volunteer, fine, but as usual with this kind of thing, manpower is very limited and other things are higher priority. My highest priority right now is making T support scheme well, which it currently doesn't. For anyone contemplating the task, I have a few suggestions: 1. Take a look at prep:/t/junk/cl/*.t. 2. Talk to the folks working on Butterfly Lisp at BBN. They have implemented Common Lisp on top of MIT's C Scheme, which has many similarities to T (syntax tables and environments work the same way). I heard a rumor that some of their code would become publicly available. 3. Don't try to make packages look like environments; you're bound to lose; too many Common Lisp programs depend on being able to go from a symbol to its value, which is meaningless in T. Common Lisp bindings should all live in a single global environment, just like they do in Common Lisp. Symbols FOO::X and BAR::X must be distinct T symbols. I suggest using different symbols for function bindings, e.g. \#\'FOO::X would be bound in the CL environment to the function binding of X in package FOO. Higher tech of course would be to create a new datatype for CL symbols and teach the compiler about them. There probably ought to be an option in syntax tables to let one change the way combinations are interpreted, but I don't think there is. 4. To do keywords properly you'll need to teach the object file dumper/loader about them. Probably not hard to do. Hacking the evaluator and compiler front end is trivial; just define an appropriate "atom expander" for your syntax table. Look at the sources for the scheme compatibility package. I have just spent more time on this than I wanted to.  Received: from norbo.cs.wisc.edu (TCP 20032201146) by MC.LCS.MIT.EDU 28 Apr 88 03:51:30 EDT Date: Wed, 27 Apr 88 14:23:36 CDT From: wu@cs.wisc.edu (Felix S.-T. Wu) Message-Id: <8804271923.AA03746@norbo.cs.wisc.edu> Received: by norbo.cs.wisc.edu; Wed, 27 Apr 88 14:23:36 CDT To: t-discussion@mc.lcs.mit.edu Subject: GC speed I am running T3.1 on a Vax8550 (~10 MIPS), the garbage collection seems to be a little slow to me. For instance, it took about 4.6 seconds (timed by the provided "time" form) to GC a just started T process (with 4M bytes for each half of the heap). What I would like to know is: Is this GC speed kind of slow or normal (or fast) ? If it is slow, why is it ? Is it inherent because of T's data representation or what ?  Received: from kestrel (TCP 1200600040) by MC.LCS.MIT.EDU 28 Apr 88 06:14:32 EDT Received: by kestrel (5.58/5.17) id AA22785; Thu, 28 Apr 88 03:09:43 PDT Date: Thu, 28 Apr 88 03:09:43 PDT From: gyro@kestrel.ARPA (Scott W. Layson) Message-Id: <8804281009.AA22785@kestrel> To: T-Discussion@MC.LCS.MIT.EDU In-Reply-To: Jonathan A Rees's message of Tue, 26 Apr 88 16:18:00 EDT <365965.880426.JAR@AI.AI.MIT.EDU> Subject: Naive T Design Questions Date: Tue, 26 Apr 88 16:18:00 EDT From: Jonathan A Rees Date: Thu, 14 Apr 88 20:49:54 EDT From: James J. Hunt 3. Why was VALUES renamed to RETURN? RETURN seems to imply change of the control flow which return does not do! Invoking a continuation is a return. RETURN invokes a continuation. Yeah, but continuations get invoked all the time without RETURNs. I think VALUES is a more tasteful name, even independent of any desire I might have not to wrench unnecessarily the thought habits of Common Lisp users. Besides, invoking a continuation isn't exactly a return, in the older sense in which we're used to using the word, although a return in that sense is indeed a particular very common form of invoking a continuation. 6. Is this really the best way to implement self evaluating keywords in T: [...] Actually, in T you can use ordinary symbols instead of keywords, since you don't have to worry about the vagaries of multiple packages: (foo 'bar 3) Right on. If we hadn't had multiple packages, we would never have needed keywords, and "'foo" is the same length as ":foo". You could always define ":" to be the same as "'", if it's that important to you to visually distinguish symbols used as keywords from symbols used in other ways. -- Scott  Received: from kestrel (TCP 1200600040) by MC.LCS.MIT.EDU 28 Apr 88 06:24:08 EDT Received: by kestrel (5.58/5.17) id AA22798; Thu, 28 Apr 88 03:19:16 PDT Date: Thu, 28 Apr 88 03:19:16 PDT From: gyro@kestrel.ARPA (Scott W. Layson) Message-Id: <8804281019.AA22798@kestrel> To: T-Discussion@MC.LCS.MIT.EDU In-Reply-To: Jonathan A Rees's message of Tue, 26 Apr 88 16:18:41 EDT <365967.880426.JAR@AI.AI.MIT.EDU> Subject: Naive T Design Questions Addendum Date: Tue, 26 Apr 88 16:18:41 EDT From: Jonathan A Rees Date: Thu, 14 Apr 88 21:59:49 EDT From: James J. Hunt 7. Why not separate the concept of () and no entry in tables? (I think you mean #F, not (), since absence of entry is indicated by a false return from table-entry.) This is easily simulated given the existing primitives, so it would be an unnecessary complication. E.g. it would require the addition of something like a TABLE-HAS-ENTRY? predicate, and it would require the addition of a separate procedure for deleting entries (currently you can just store a #F). This reminds me, I really liked (at first sight, anyway) the idea of providing a separate failure continuation for things like this (of which I gather there are many). The caller of something like TABLE-ENTRY is almost certainly going to branch based on the returned value anyway, so it seems like the failure-continuation approach would be more efficient. Has this been thought about much? Besides, the failure-continuation approach would be more suitable for a (gasp! heresy) strongly-typed language. I know T will never become one of THOSE, but I'm still curious what the impact would be like... -- Scott  Received: from CENTRO.SOAR.CS.CMU.EDU (TCP 20000557276) by MC.LCS.MIT.EDU 28 Apr 88 07:19:40 EDT Date: Thu Apr 28 07:16:22 1988 From: Olin.Shivers@CENTRO.SOAR.CS.CMU.EDU To: gyro@kestrel.ARPA CC: T-Discussion@MC.LCS.MIT.EDU In-reply-to: Scott W. Layson's message of Thu, 28 Apr 88 03:19:16 PDT <8804281019.AA22798@kestrel> Subject: types Date: Thu, 28 Apr 88 03:19:16 PDT From: gyro@kestrel.ARPA (Scott W. Layson) Besides, the failure-continuation approach would be more suitable for a (gasp! heresy) strongly-typed language. I know T will never become one of THOSE, but I'm still curious what the impact would be like... T might make a nice substrate to build such a system on top of, though. Suppose you defined a T extension that had a type system like ML's or the polymorphic lambda calculus. It would be straightforward to implement a type inferencer (for ML; inferencing polymorphic lambda calculus is probably undecidable), and type checker. This would be trivial to compile into T. It really craps up the code if you have to do all the declarations with Lisp syntax. But if you used ML's type system, you wouldn't have to put declarations in your code -- they could all be inferred. The full blown polymorphic lambda calculus, though, is another matter. Voila. Strictly typed T for those who feel that it's a good thing there are laws requiring people to wear safety belts, without altering the T base level at all. -Olin P.s. Even better than the polymorphic lambda calculus type system is the one in FX -- then you can be a facist about side effects as well.  Received: from shredded-wheat.ai.mit.edu (TCP 20015022041) by MC.LCS.MIT.EDU 28 Apr 88 11:13:24 EDT Received: by shredded-wheat.ai.mit.edu; Thu, 28 Apr 88 11:10:02 EDT Date: Thu, 28 Apr 88 11:10:02 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8804281510.AA08595@shredded-wheat.ai.mit.edu> To: wu@cs.wisc.edu Cc: t-discussion@mc.lcs.mit.edu In-Reply-To: Felix S.-T. Wu's message of Wed, 27 Apr 88 14:23:36 CDT <8804271923.AA03746@norbo.cs.wisc.edu> Subject: GC speed Date: Wed, 27 Apr 88 14:23:36 CDT From: wu@cs.wisc.edu (Felix S.-T. Wu) I am running T3.1 on a Vax8550 (~10 MIPS), the garbage collection seems to be a little slow to me. For instance, it took about 4.6 seconds (timed by the provided "time" form) to GC a just started T process (with 4M bytes for each half of the heap). What I would like to know is: Is this GC speed kind of slow or normal (or fast) ? If it is slow, why is it ? Is it inherent because of T's data representation or what ? I don't know. In general the GC is very slow but on a Sun 3/140 (16Mz 68020) it took 7.2 seconds. I hope that some time someone will make the GC fast. -David  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 28 Apr 88 11:21:12 EDT Received: from amax.NPAC.SYR.EDU ([128.230.1.4]) by ELI.CS.YALE.EDU; Thu, 28 Apr 88 11:03:13 EDT Full-Name: Date: Thu, 28 Apr 88 11:01:58 edt From: jbennett@amax.NPAC.SYR.EDU (James P. Bennett) Received: by amax.NPAC.SYR.EDU (4.12/Northeast-Parallel-Architectures-Center) id AA24725; Thu, 28 Apr 88 11:01:58 edt Message-Id: <8804281501.AA24725@amax.NPAC.SYR.EDU> To: seth@CS.UCLA.EDU, t-users@YALE.ARPA, t3-bugs@YALE.ARPA Subject: Re: Problems with T3.0 (17) and SR9.7/DN4000's I used the address you gave me (with, however, @ and % reversed) long ago. Presumably, all is well now. I should have spotted the error.  Received: from ll-vlsi.arpa (TCP 1200200012) by MC.LCS.MIT.EDU 28 Apr 88 18:46:08 EDT Received: by ll-vlsi.arpa (5.51/3.2.sst.ll) id AA03427; Thu, 28 Apr 88 18:41:46 EDT From: James J. Hunt Received: by sonett.vlsi.ll.mit.edu (3.2/SMI-3.2) id AA29089; Thu, 28 Apr 88 18:41:40 EDT Date: Thu, 28 Apr 88 18:41:40 EDT Message-Id: <8804282241.AA29089@sonett.vlsi.ll.mit.edu> To: jar@ai.ai.mit.edu Cc: T-Discussion@mc.lcs.mit.edu Subject: Clarifications please 2. Why isn't BOUND? known to Orbit (especially since *BOUND? exists)? It shouldn't be known to anyone. Side effects to environments are meta-operations; the existence of things like BOUND? in the language (as opposed to the meta-language) breaks desirable invariants like order-independence of effectless definitions. O.K. but from a more practical view what about BIND. Suppose that I have some variable *GLOBAL* that I need to dynamically bind for some group of procedures: p1, p2, ... pn. Furthermore I know that none of these will be called before I execute some function that binds *GLOBAL*'s value. BIND insists that *GLOBAL* has a value BEFORE BIND of *GLOBAL* is used. However some other module may care about *GLOBAL*'s default value, so I would rather not write something like (lset *GLOBAL* nil), but instead (if (bound? *GLOBAL*) (then (lset *GLOBAL* nil))). Of course, I would rather that BIND did not depend on *GLOBAL* being bound. There is also the case of porting form other LISPs, however I have not YET seen a case where the such code uses BOUNDP and does not also implicity expect that no one else is using the variable in question. In such places it is OK to initialize said variable too either '() or '#f. This does not mean that there aren't any. 5. Why not include this [Ellisp's IF] in T? T has COND. This seems to be a rather weak answer. If that is the reason why does T have if at all. It seems to me that IF is more readable than cons for single test branching. Likewise, (if (test) (then (f1) ... (fn)) (else (g1) ... (gn))) seems to me much more readable then (cond ((test) (f1) ... (fn)) (else (g1) ... (gn))). My point is that if T is going to support IF, why not support THEN and ELSE. I even think (if (test) (then a) (else b)) is often more readable than the more cryptic (if (test) a b). (Though, the macro given defaults the else clause to nil, I am not arguing that T should support that as well. In fact, it is only there because I gave into the local concensus --- at least temporarily.) 7. Why not separate the concept of () and no entry in tables? (I think you mean #F, not (), since absence of entry is indicated by a false return from table-entry.) This is easily simulated given the existing primitives, so it would be an unnecessary complication. E.g. it would require the addition of something like a TABLE-HAS-ENTRY? predicate, and it would require the addition of a separate procedure for deleting entries (currently you can just store a #F). I have two objections to this: 1. It seem rather ugly to have to use two tables to keep track of TABLE-HAS-ENTRY? state and the table values, as is need if you don't plan to modify the source, and 2. (walk-table (lambda (key value) (ignore value) (set (table-entry key) '#f))
) does not work. You must say (clean-table
). Where as this walk does work so long as you are not setting the table value to '#f. This seems to be a gross anomaly! This is especially painfull if the new value is computed from the old one. Thank you for taking the time to respond to my questions. -JJHunt  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 28 Apr 88 20:29:22 EDT Date: Thu, 28 Apr 88 12:26:15 EDT From: Jonathan A Rees Subject: GC speed To: wu@CS.WISC.EDU cc: t-discussion@MC.LCS.MIT.EDU In-reply-to: Msg of Wed 27 Apr 88 14:23:36 CDT from wu at cs.wisc.edu (Felix S.-T. Wu) Message-ID: <367097.880428.JAR@AI.AI.MIT.EDU> Date: Wed, 27 Apr 88 14:23:36 CDT From: wu at cs.wisc.edu (Felix S.-T. Wu) To: t-discussion at mc.lcs.mit.edu Re: GC speed I am running T3.1 on a Vax8550 (~10 MIPS), the garbage collection seems to be a little slow to me. For instance, it took about 4.6 seconds (timed by the provided "time" form) to GC a just started T process (with 4M bytes for each half of the heap). What I would like to know is: Is this GC speed kind of slow or normal (or fast) ? I believe it is slow compared to other lisp implementations. MIT's C Scheme is alleged to GC in a fraction of a second even with a nonempty heap. A few seconds is normal, I think, for Lucid and VAX LISP. If it is slow, why is it? Because there isn't enough manpower to do everything that needs to be done. It was written to be correct first, fast second. It just hasn't been tuned very much. Is it inherent because of T's data representation or what ? I don't think so, but the complexity of the representations doesn't help. I think there may be some hacks in the next release to speed it up.  Received: from MCC.COM (TCP 1200600076) by MC.LCS.MIT.EDU 6 May 88 10:35:06 EDT Received: from obi-wan.aca.mcc.com by MCC.COM with TCP/SMTP; Fri 6 May 88 09:26:05-CDT Date: Fri, 6 May 88 09:25:00 CDT From: mark@mcc.com (Mark Scheevel) Posted-Date: Fri, 6 May 88 09:25:00 CDT Message-Id: <8805061425.AA04604@obi-wan.aca.mcc.com> Received: by obi-wan.aca.mcc.com (3.2/ACAv3.9) id AA04604; Fri, 6 May 88 09:25:00 CDT To: t-discussion@mc.lcs.mit.edu Subject: Test for procedure? Is there a finer-grained test for procedure values than PROCEDURE? ? As it stands, PROCEDURE? answers true to both procedures and operations (and any other object that can be applied). We need to be able to distinguish actual, honest-to-goodness closures created by LAMBDA from these other apply-able entities, and I haven't been able to figure out how to do it by rummaging around in the sources. Is such a distinction even possible after ORBIT finishes its work? Mark Scheevel P.S. I saw a reference to T3.1 the other day; is it actually available?  Received: from icarus.cns.syr.EDU (TCP 20071400461) by MC.LCS.MIT.EDU 6 May 88 12:13:12 EDT Received: by icarus.cns.syr.EDU (5.51/Computing-and-Network-Services) id AA10412; Fri, 6 May 88 12:09:22 EDT Date: Fri, 6 May 88 12:12:59 edt From: jbennett@amax.npac.syr.edu (James P. Bennett) Received: by amax.NPAC.SYR.EDU (4.12/Northeast-Parallel-Architectures-Center) id AA24240; Fri, 6 May 88 12:12:59 edt Message-Id: <8805061612.AA24240@amax.NPAC.SYR.EDU> To: T-Discussion@mc.lcs.mit.edu Subject: environments I've been thinking of expressing Gilles Fauconnier's idea of 'mental spaces,' which he considers to be generated by syntax, as T environments. Does anyone have experience with manipulating locales in a NLP application? The the release notes for 3.0, it is said that a module system to replace locale is being written. Information available on that? In 3.1? Thanks, jim  Received: from shredded-wheat.ai.mit.edu (TCP 20015022041) by MC.LCS.MIT.EDU 6 May 88 12:22:56 EDT Received: by shredded-wheat.ai.mit.edu; Fri, 6 May 88 12:22:54 EDT Date: Fri, 6 May 88 12:22:54 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8805061622.AA13265@shredded-wheat.ai.mit.edu> To: mark@mcc.com Cc: t-discussion@mc.lcs.mit.edu In-Reply-To: Mark Scheevel's message of Fri, 6 May 88 09:25:00 CDT <8805061425.AA04604@obi-wan.aca.mcc.com> Subject: Test for procedure? Date: Fri, 6 May 88 09:25:00 CDT From: mark@mcc.com (Mark Scheevel) Posted-Date: Fri, 6 May 88 09:25:00 CDT Is there a finer-grained test for procedure values than PROCEDURE? ? As it stands, PROCEDURE? answers true to both procedures and operations (and any other object that can be applied). We need to be able to distinguish actual, honest-to-goodness closures created by LAMBDA from these other apply-able entities, and I haven't been able to figure out how to do it by rummaging around in the sources. Is such a distinction even possible after ORBIT finishes its work? Mark Scheevel P.S. I saw a reference to T3.1 the other day; is it actually available? It is not possible to determine what you are asking. In fact, except by looking at the sources, you would not be able to tell that operations are NOT created with lambda. If you say what it is that you are trying to do perhaps we can suggest another way. T3.1 is available by anonymous FTP to wheaties.ai.mit.edu in the pub/t3.1 directory. -David  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 6 May 88 16:10:18 EDT Received: by ELI.CS.YALE.EDU; Fri, 6 May 88 15:25:34 EDT Date: Fri, 6 May 88 15:25:34 EDT Full-Name: Ashwin Ram Message-Id: <8805061925.AA08045@ELI.CS.YALE.EDU> Received: by yale-ring (node-abc3/ABC3) via WIMP-MAIL (Version 1.3/1.5) ; Fri May 6 15:23:46 To: t-discussion@YALE.ARPA (Newsgroups: arpa.t-discussion) From: Ram-Ashwin@YALE.ARPA (Ashwin Ram) Subject: Re: Test for procedure? References: <28600@yale-celray.yale.UUCP> Reply-To: Ram-Ashwin@YALE.ARPA (Ashwin Ram) In-Reply-To: @MC.LCS.MIT.EDU,@MCC.COM:mark@mcc.com Organization: Computer Science, Yale University, New Haven, CT 06520-2158 In article <28600@yale-celray.yale.UUCP>, @MC.LCS.MIT.EDU,@MCC writes: > Is there a finer-grained test for procedure values than PROCEDURE? ? > As it stands, PROCEDURE? answers true to both procedures and > operations (and any other object that can be applied). We need to be > able to distinguish actual, honest-to-goodness closures created by > LAMBDA from these other apply-able entities The predicate OPERATION? will let you distinguish operations from everything else: > (operation? (lambda nil nil)) () > (procedure? (lambda nil nil)) #T However, you should normally not need to rely on this distinction. There is probably a better way to do what you need to do. For example, if you're trying to distinguish closures that you create for some purpose from other procedure-like objects lying around, you might create objects instead that answer #t to a special predicate. -- Ashwin. ARPA: Ram-Ashwin@cs.yale.edu UUCP: {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin BITNET: Ram@yalecs  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 6 May 88 18:13:35 EDT Received: from MCC.COM by ELI.CS.YALE.EDU; Fri, 6 May 88 17:14:29 EDT Received: from obi-wan.aca.mcc.com by MCC.COM with TCP/SMTP; Fri 6 May 88 16:13:22-CDT Date: Fri, 6 May 88 16:13:04 CDT From: mark@mcc.com (Mark Scheevel) Posted-Date: Fri, 6 May 88 16:13:04 CDT Message-Id: <8805062113.AA05027@obi-wan.aca.mcc.com> Received: by obi-wan.aca.mcc.com (3.2/ACAv3.9) id AA05027; Fri, 6 May 88 16:13:04 CDT To: t-discussion@YALE.ARPA In-Reply-To: Ashwin Ram's message of Fri, 6 May 88 15:25:34 EDT <8805061925.AA08045@ELI.CS.YALE.EDU> Subject: Test for procedure? >In article <28600@yale-celray.yale.UUCP>, @MC.LCS.MIT.EDU,@MCC writes: >> Is there a finer-grained test for procedure values than PROCEDURE? ? >> As it stands, PROCEDURE? answers true to both procedures and >> operations (and any other object that can be applied). We need to be >> able to distinguish actual, honest-to-goodness closures created by >> LAMBDA from these other apply-able entities > >The predicate OPERATION? will let you distinguish operations from everything >else: > > > (operation? (lambda nil nil)) > () > > (procedure? (lambda nil nil)) > #T > >However, you should normally not need to rely on this distinction. There is >probably a better way to do what you need to do. For example, if you're >trying to distinguish closures that you create for some purpose from other >procedure-like objects lying around, you might create objects instead that >answer #t to a special predicate. > >-- Ashwin. As is usually the problem in cases like this, I was being sloppy. We're implementing a different system on top of T, and I wanted to use T operations to represent our operations, and T procedures to represent what amount to microcode for the new system. This is just sloppy design, and I should make a clear distinction between these new entities and all previously existing ones. In particular, as David and Ashwin have pointed out, given that I want to directly invoke these "microcode" objects but still be able to identify them, I should do something like (define-predicate microcode?) (define (make-microcode closure) (object closure ((microcode? self) t))) ... (define microcode-add (make-microcode add)) This will allow me to invoke these things with sufficiently little overhead that I should quit worrying about it. Thanks for the kick in the pants:-) By the way, does T3.1 include the fix for proper handling (i.e., no stack buildup) of tail-recursive operation invocation? --Mark  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 6 May 88 19:09:38 EDT Received: by ELI.CS.YALE.EDU; Fri, 6 May 88 18:26:53 EDT From: James Philbin Full-Name: James Philbin Message-Id: <8805062226.AA09229@ELI.CS.YALE.EDU> Received: by yale-ring (node-aac0/AAC0) via WIMP-MAIL (Version 1.3/1.5) ; Fri May 6 18:15:02 Date: Fri, 6 May 88 18:14:55 EDT Subject: [ut-sally!uunet!mcvax!litp!queinnec%harvard.UUCP@YALE.ARPA (Christian QUEINNEC): New Site running T] To: t-discussion@mc.lcs.mit.edu **** Forwarded Message Follows **** Received: by YALE-RING-MAIL-GW via SSMTP ($Revision: 1.19 $) ; Fri May 6 03:52:32 1988 Received: by BULLDOG.CS.YALE.EDU; Fri, 6 May 88 04:01:36 EDT Full-Name: Received: by harvard.harvard.edu; Fri, 6 May 88 04:01:32 EDT Posted-Date: Thu, 5 May 88 10:57:11 +0100 Received: by sally.utexas.edu (5.54/5.51) id AA04445; Fri, 6 May 88 02:20:13 CDT Received: from mcvax.UUCP by uunet.UU.NET (5.54/1.14) with UUCP id AA06394; Fri, 6 May 88 02:08:02 EDT Received: by mcvax.cwi.nl; Fri, 6 May 88 07:07:36 +0200 (MET) Received: by inria.inria.fr; Thu, 5 May 88 19:35:44 +0200 (MET) Received: by litp.unip6-7.fr (5.51/5.17) id AA21664; Thu, 5 May 88 10:57:11 +0100 Date: Thu, 5 May 88 10:57:11 +0100 From: ut-sally!uunet!mcvax!litp!queinnec%harvard.UUCP@YALE.ARPA (Christian QUEINNEC) Message-Id: <8805050957.AA21664@litp.unip6-7.fr> To: t-project@YALE.ARPA Subject: New Site running T We got a copy of T via the University of Delft. Please add us on the forums concerning T. Pr C. Queinnec LITP Universite Pierre et Marie Curie (PARIS VI) 4, Place Jussieu 75252 PARIS Cedex France seismo!mcvax!inria!litp!queinnec **** End of Forwarded Message **** -------  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 6 May 88 21:11:38 EDT Received: from megaron.arizona.edu ([128.196.6.1]) by ELI.CS.YALE.EDU; Fri, 6 May 88 21:02:26 EDT Date: Fri, 6 May 88 18:03:10 MST From: "Mike Coffin" Message-Id: <8805070103.AA06995@megaron.arizona.edu> Received: by megaron.arizona.edu; Fri, 6 May 88 18:03:10 MST To: t-discussion@YALE.ARPA Subject: T3.1 Could someone summarize the differences between 3.0 and 3.1? Is this version mostly bug fixes, mostly enhancements, neither, both... mike  Received: from kestrel (TCP 1200600040) by MC.LCS.MIT.EDU 7 May 88 06:06:32 EDT Received: by kestrel (5.58/5.17) id AA16468; Sat, 7 May 88 03:05:40 PDT Date: Sat, 7 May 88 03:05:40 PDT From: gyro@kestrel.ARPA (Scott W. Layson) Message-Id: <8805071005.AA16468@kestrel> To: T-Discussion@MC.LCS.MIT.EDU Subject: T on Mac II? Also, commercial applications Has anyone ported T to the Mac II under A/UX? If so, how can I get a copy? Preferably Tau 3.1. If not, can anyone give me some idea what might be involved? I haven't looked closely at A/UX, but assume it's a System V derivative. I see that some way is provided for programs to access the Mac Toolbox, so it seems like some hacking could generate a pretty flavorful user interface. As long as I've got your attention -- does anyone know of any commercial outfit that is using T as an internal tool? I would love to find someone willing to pay me to hack on it. If anyone knows of a company that would use T if they could count on it being supported, please put us in touch. -- Scott  Received: from mitre-bedford.ARPA (TCP 3200600102) by MC.LCS.MIT.EDU 9 May 88 08:49:05 EDT Posted-From: The MITRE Corp., Bedford, MA Received: from darwin.sun.uucp by linus.MENET (3.2/4.7) id AA01355; Mon, 9 May 88 08:45:56 EDT From: John D. Ramsdell Posted-Date: Mon, 9 May 88 07:15:52 EDT Received: by darwin.sun.uucp (3.2/SMI-3.0DEV3) id AA10066; Mon, 9 May 88 07:15:52 EDT Date: Mon, 9 May 88 07:15:52 EDT Message-Id: <8805091115.AA10066@darwin.sun.uucp> To: gyro@kestrel.ARPA Cc: T-Discussion@MC.LCS.MIT.EDU In-Reply-To: Scott W. Layson's message of Sat, 7 May 88 03:05:40 PDT <8805071005.AA16468@kestrel> Subject: T on Mac II? Also, commercial applications The MITRE Corporation is a non-profit organization with a small group of people interested in real-time and concurrent implementations of Lisp. Whe plan to work with David Kranz of MIT to help him get a concurrent version of T running, and then I hope to get a real-time version running. Send your resume to John D. Ramsdell The MITRE Corporation / A040 Burlington Road Bedford, MA 01730  Received: from shredded-wheat.ai.mit.edu (TCP 20015022041) by MC.LCS.MIT.EDU 9 May 88 10:12:05 EDT Received: by shredded-wheat.ai.mit.edu; Mon, 9 May 88 10:12:35 EDT Date: Mon, 9 May 88 10:12:35 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8805091412.AA14903@shredded-wheat.ai.mit.edu> To: gyro@kestrel.arpa Cc: T-Discussion@mc.lcs.mit.edu In-Reply-To: Scott W. Layson's message of Sat, 7 May 88 03:05:40 PDT <8805071005.AA16468@kestrel> Subject: T on Mac II? Also, commercial applications Date: Sat, 7 May 88 03:05:40 PDT From: gyro@kestrel.arpa (Scott W. Layson) Has anyone ported T to the Mac II under A/UX? If so, how can I get a copy? Preferably Tau 3.1. If not, can anyone give me some idea what might be involved? I haven't looked closely at A/UX, but assume it's a System V derivative. I see that some way is provided for programs to access the Mac Toolbox, so it seems like some hacking could generate a pretty flavorful user interface. As long as I've got your attention -- does anyone know of any commercial outfit that is using T as an internal tool? I would love to find someone willing to pay me to hack on it. If anyone knows of a company that would use T if they could count on it being supported, please put us in touch. -- Scott I have an undebugged executable for the system you prefer. I have been trying (not very hard) to get access to hardware to debug it. I intend to try harder when I am less busy. -David  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 9 May 88 16:37:53 EDT Received: from shredded-wheat.ai.mit.edu by ELI.CS.YALE.EDU; Mon, 9 May 88 16:18:28 EDT Full-Name: Received: by shredded-wheat.ai.mit.edu; Mon, 9 May 88 10:02:54 EDT Date: Mon, 9 May 88 10:02:54 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8805091402.AA14897@shredded-wheat.ai.mit.edu> To: mark@mcc.com Cc: t-discussion@YALE.ARPA In-Reply-To: Mark Scheevel's message of Fri, 6 May 88 16:13:04 CDT <8805062113.AA05027@obi-wan.aca.mcc.com> Subject: Test for procedure? Date: Fri, 6 May 88 16:13:04 CDT From: mark@mcc.com (Mark Scheevel) Posted-Date: Fri, 6 May 88 16:13:04 CDT By the way, does T3.1 include the fix for proper handling (i.e., no stack buildup) of tail-recursive operation invocation? I believe I have fixed it. -David  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 9 May 88 16:39:04 EDT Received: from shredded-wheat.ai.mit.edu by ELI.CS.YALE.EDU; Mon, 9 May 88 16:20:20 EDT Full-Name: Received: by shredded-wheat.ai.mit.edu; Mon, 9 May 88 10:09:20 EDT Date: Mon, 9 May 88 10:09:20 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8805091409.AA14900@shredded-wheat.ai.mit.edu> To: mike@arizona.edu Cc: t-discussion@YALE.ARPA In-Reply-To: "Mike Coffin"'s message of Fri, 6 May 88 18:03:10 MST <8805070103.AA06995@megaron.arizona.edu> Subject: T3.1 Date: Fri, 6 May 88 18:03:10 MST From: "Mike Coffin" Could someone summarize the differences between 3.0 and 3.1? Is this version mostly bug fixes, mostly enhancements, neither, both... mike Here is a copy of the tentative release notes: Release notes for T3.1 Fixes: All reported bugs in T3.0 have been fixed. In addition the longstanding bugs with shadowing in locales have been fixed. The Scheme bugs have been fixed and the scheme environment is now more complete. See the Scheme documentation for details. Removals: RECKLESSNESS no longer exists. T now runs with the efficiency of better than recklessness high and the safety of recklessness low (almost). Changes in behavior: SET on global variables is no longer expensive. Because of a problem with interrupts and the GC, a keyboard interrupt may not be detected. A second interrupt will cause an immediate break, but if a GC occurs while in the breakloop it will not be possible to continue the interrupted procedure. Generic arithmetic on fixnums is much faster. The object file extension has been changed to two characters. T3.0 object files will not run in T3.1 Additions: (LOAD-OUT-OF-DATE-ACTION) is a switch that controls what the loader does with a filespec without an extension. The options are: (default warn) binary -- load the object file. source -- load the source file. newer -- load the most recent of object and source files. recompile -- recompile the file if the source is newer than the object file. warn -- give a warning if the source is newer than the object file. query -- offer to recompile if the source is newer than the object file. (ORBIT expression . locale) does expression at a time compilation, e.g. (orbit '(define (f x) (+ x 1))) will cause the expression to be compiled and loaded into the (repl-env). (CL expression) prints out assembly code for expression. (TIME expression count) computes expression count times and prints the virtual time used. The count argument is optional. LOAD-FOREIGN is now released for all systems except HP's. Before loading a T object file with a DEFINE-FOREIGN, use (LOAD-FOREIGN file.o) to install the Unix .o files needed. Suspending systems is now documented. A system is suspended as follows: % t -h 8000000 # as big as possible > ;; load stuff > (gc) > ((*value t-implementation-env 'system-suspend) filespec nil) > (exit) If a GC occurs during the suspend it will hang. This means that the heap was not big enough. The binary distributions are a directory called tsystem. In that directory are a bunch of files including a script called linkt which takes a .o file produced by suspend and creates an executable. % cd tsystem % linkt filespec.o newimage If the code to be loaded before suspending a system contains DEFINE-FOREIGN forms, files containing these forms should be loaded inside of: (bind (((*value t-implementation-env 'make-foreign-procedure) (*value t-implementation-env 'make-foreign))) (load file1) ...) In this case the linkt script must be modified to include .o files that are referenced by DEFINE-FOREIGN expressions. System building: It is possible to build a system from the sources. The tsystem directory contains a file, i.e. sunbuild.t which explains how. Installation: As in T3.0 a shell variable TSYSTEM should be defined to be the tsystem directory. If there are fixes to the T3.1 system, there will be a fix file in the same place as this one. Send your email address to t-project@yale.arpa to receive fixes, updates, etc. Bugs: t-version-number doesn't work anymore. additional bugs to kranz@wheaties.ai.mit.edu  Received: from CENTRO.SOAR.CS.CMU.EDU (TCP 20000557276) by MC.LCS.MIT.EDU 9 May 88 21:44:50 EDT Date: Mon May 9 19:03:26 1988 From: Olin.Shivers@CENTRO.SOAR.CS.CMU.EDU To: jjh@ll-vlsi.arpa CC: t-discussion@mc.lcs.mit.edu Subject: IF macro James- You recently posted about your IF macro: (if (foo? x) (then (bar x) (baz y)) (else (quux z))) and asked why T didn't have this as a standard. I don't speak for the Scheme community in general, but I'll tell you where I think this macro clashes with the Scheme language standard: keywords. The syntax of a given special form is generally given by one keyword: the one appearing in the car of the form. All the rest of the syntax is reflected in the list structure of the form. This is a general rule for Scheme special forms. In your macro, the THEN and ELSE keywords are just noise words -- you could remove them, and the information needed to separate the consequent (THEN) clauses from the alternate (ELSE) clauses would still be captured by the extra layer of parens. Now, you could say that the IF form will take extra noise words THEN and ELSE in its grammar for extra readability, but note that IF would now be inconsistent with the low-noise parsimonious style of the entire rest of the language. This is probably not the way to go for a core form like IF. IF, as defined in Scheme, is a very simple beast. It takes exactly three subforms, and has a very simple rule for evaluating them. It is the primitive conditional form. *Your* IF, on the other hand, has a more complicated (sophisticated) syntax and semantics. This might make it more useful, but is inappropriate for *the* primitive conditional form. Primitive forms should be orthogonal. If you want more sophisticated structures, you compose them from your simple primitives (in this case, IF and BLOCK). This approach to primitive forms has helped keep Scheme small and powerful, as opposed to bloated, baroque languages like PL/I, and CommonLisp. Now, I think internal keywords are a fine thing, for hairy, non-primitive syntax. I use a loop package that has internal keywords, and I think it is a model of perspicuity: (loop (incr i from 0) (for x in list1) (for y in list2) (save (list i x y))) Here, INCR, FOR, and SAVE are all keywords special to the loop macro. But, LOOP is *not* a primitive form, part of the T definition. It's a language extension to T, implemented as a macro package. The problem with IF, as you've defined (and named) it, is that it is incompatible with the standard IF form. Your implementation cleverly avoids this by checking for the presence of the internal keywords, and implementing the standard IF semantics if they are not present. Bear in mind, however, that this is not correct, just heuristic. If the poor user happens to have a function named THEN, and he calls it inside an IF, and your macro gets ahold of it, he loses: (if (foo? 3) (then 3)) ; Call function THEN on 3. There are two ways to fix this clash that I can think of: - Change the name of your macro. If T were case-sensitive like franz, you could do what Foderaro did, and call yours "If", not "if". But it isn't. You could call it "iph", which is gross. Better names fail me. - Leave poor IF alone, but define THEN and ELSE to be macros synonymous with BLOCK. John Ellis does this with his lisps. Now your IF is implemented in a manner consistent with the standard IF. Actually, ELSE is a standard T identifier, so maybe you ought to use THEN and ELS. Or something. -Olin  Received: from norbo.cs.wisc.edu (TCP 20032201146) by MC.LCS.MIT.EDU 10 May 88 19:35:45 EDT Date: Tue, 10 May 88 18:35:07 CDT From: wu@cs.wisc.edu (Felix S.-T. Wu) Message-Id: <8805102335.AA00899@norbo.cs.wisc.edu> Received: by norbo.cs.wisc.edu; Tue, 10 May 88 18:35:07 CDT To: t-discussion@mc.lcs.mit.edu Subject: load-foreign problem I am running T3.1 on a Vax. When I tried to do "load-foreign", I got the message "loadpoint shifted". Does anyone know what does that mean ?  Received: from neptune.CS.UCLA.EDU (TCP 20030216011) by MC.LCS.MIT.EDU 11 May 88 02:36:48 EDT Return-Path: Received: by neptune.CS.UCLA.EDU (Sendmail 5.54/2.05) id AA25298; Tue, 10 May 88 22:21:09 PDT Date: Tue, 10 May 88 22:21:09 PDT From: dorab@CS.UCLA.EDU (Dorab Patel) Message-Id: <8805110521.AA25298@neptune.CS.UCLA.EDU> To: t-discussion@mc.lcs.mit.edu Subject: Re: load-foreign problem hmm.... i havent recently tried load-foreign on a vax, but what the error diagnostic means is as follows : load-foreign has to find out where the "end of memory" is. then it runs an "ld -A" command to have ld link the new object file and have it relocated at the "end of memory" (i.e. the load point). next, the relocated file's header is read to get size information. based on that, the system is asked for more memory, but the point at which this extra memory starts had better be the original load point. if it isnt, then the relocation done by ld will be all bogus. so, just before attempting to load the relocated file, load-foreign checks to see if the load point has changed and aborts if it has. under normal working, there is no reason for the loadpoint to shift. do you get this message every time you try to load a .o file ? 'dorab  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 11 May 88 13:34:07 EDT Date: Wed, 11 May 88 13:34:25 EDT From: Jonathan A Rees Subject: Clarifications please To: jjh@LL-VLSI.ARPA cc: T-Discussion@MC.LCS.MIT.EDU In-reply-to: Msg of Thu 28 Apr 88 18:41:40 EDT from James J. Hunt Message-ID: <375558.880511.JAR@AI.AI.MIT.EDU> Date: Thu, 28 Apr 88 18:41:40 EDT From: James J. Hunt Suppose that I have some variable *GLOBAL* that I need to dynamically bind for some group of procedures: p1, p2, ... pn. Furthermore I know that none of these will be called before I execute some function that binds *GLOBAL*'s value. BIND insists that *GLOBAL* has a value BEFORE BIND of *GLOBAL* is used. However some other module may care about *GLOBAL*'s default value, so I would rather not write something like (lset *GLOBAL* nil), but instead (if (bound? *GLOBAL*) (then (lset *GLOBAL* nil))). Of course, I would rather that BIND did not depend on *GLOBAL* being bound. I should apologize about BIND's misleading name -- it doesn't bind the variable (like DEFINE, LAMBDA, and LSET do), it does a temporary assignment. The variable must be bound (with DEFINE or LAMBDA or LSET) before you can do a BIND, since otherwise there would be no location to assign. (Locations can't be created on demand because there's no way to tell in what environment the variable should become bound.) However I think it would be a good idea to have a way to bind a variable without assigning it. MIT Scheme does this with the syntax (define foo) and in T this would want to be written as (lset foo) instead (because SET!, and therefore BIND, is in principle illegal on variables bound with DEFINE -- an unfortunate incompatibility with R^3 Scheme). I know that the SETQ-IF-UNBOUND or DEFVAR style you describe is widespread in Maclisp and its derivatives. (The special form you want in T is not BOUND? but rather ASSIGNED?.) But I have always found this to be a rather questionable practice -- I always prefer for one particular module to be responsible for binding a variable; i.e. multiple LSET's on a variable should be in error just as multiple DEFINE's are. Otherwise conflicts and confusion are very likely. Likewise, (if (test) (then ...) (else ...)) seems to me much more readable than (cond ((test) ...) (else ...)). De gustibus non est disputandum. I needn't add to the existing critiques. If you like your IF, define a macro. 1. It seem rather ugly to have to use two tables to keep track of TABLE-HAS-ENTRY? state and the table values, as is need if you don't plan to modify the source, and No, you don't need two tables, you just need some distinguished object to represent a false entry. And you needn't modify the source if you simply shadow T's definition of TABLE-ENTRY. 2. (walk-table (lambda (key value) (ignore value) (set (table-entry
key) '#f))
) does not work. You must say (clean-table
). Whereas this walk does work so long as you are not setting the table value to '#f. This seems to be a gross anomaly! This is especially painfull if the new value is computed from the old one. I consulted with the person who wrote the table package and it seems that it's an error to modify a table while it is being walked. That it sometimes works is gratuitous. Unfortunately it would be prohibitively expensive to detect this error situation; tables must be fast. And to change this would require that WALK-TABLE in effect copy the table before it starts walking; that would make WALK-TABLE too expensive. This restriction should definitely be documented. I recommend that you create a brand new table when you want to do something like this, and let the old one be gc'ed.  Received: from shredded-wheat.ai.mit.edu (TCP 20015022041) by MC.LCS.MIT.EDU 11 May 88 16:19:02 EDT Received: by shredded-wheat.ai.mit.edu; Wed, 11 May 88 09:41:53 EDT Date: Wed, 11 May 88 09:41:53 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8805111341.AA16114@shredded-wheat.ai.mit.edu> To: wu@cs.wisc.edu Cc: t-discussion@mc.lcs.mit.edu, dorab@cs.ucla.edu In-Reply-To: Felix S.-T. Wu's message of Tue, 10 May 88 18:35:07 CDT <8805102335.AA00899@norbo.cs.wisc.edu> Subject: load-foreign problem Date: Tue, 10 May 88 18:35:07 CDT From: wu@cs.wisc.edu (Felix S.-T. Wu) I am running T3.1 on a Vax. When I tried to do "load-foreign", I got the message "loadpoint shifted". Does anyone know what does that mean ? I know that you are using Ultrix. The foreign stuff works on BSD4.2,4.3. Perhaps Dorab can answer this. -David  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 11 May 88 19:16:18 EDT Received: from shredded-wheat.ai.mit.edu by ELI.CS.YALE.EDU; Wed, 11 May 88 13:08:30 EDT Received: by shredded-wheat.ai.mit.edu; Wed, 11 May 88 13:10:28 EDT Date: Wed, 11 May 88 13:10:28 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8805111710.AA16228@shredded-wheat.ai.mit.edu> To: t-discussion@YALE.ARPA Subject: [mike: T3.1] It seems this didn't make it the first time so.. Release notes for T3.1 Fixes: All reported bugs in T3.0 have been fixed. In addition the longstanding bugs with shadowing in locales have been fixed. The Scheme bugs have been fixed and the scheme environment is now more complete. See the Scheme documentation for details. Removals: RECKLESSNESS no longer exists. T now runs with the efficiency of better than recklessness high and the safety of recklessness low (almost). Changes in behavior: SET on global variables is no longer expensive. Because of a problem with interrupts and the GC, a keyboard interrupt may not be detected. A second interrupt will cause an immediate break, but if a GC occurs while in the breakloop it will not be possible to continue the interrupted procedure. Generic arithmetic on fixnums is much faster. The object file extension has been changed to two characters. T3.0 object files will not run in T3.1 Additions: (LOAD-OUT-OF-DATE-ACTION) is a switch that controls what the loader does with a filespec without an extension. The options are: (default warn) binary -- load the object file. source -- load the source file. newer -- load the most recent of object and source files. recompile -- recompile the file if the source is newer than the object file. warn -- give a warning if the source is newer than the object file. query -- offer to recompile if the source is newer than the object file. (ORBIT expression . locale) does expression at a time compilation, e.g. (orbit '(define (f x) (+ x 1))) will cause the expression to be compiled and loaded into the (repl-env). (CL expression) prints out assembly code for expression. (TIME expression count) computes expression count times and prints the virtual time used. The count argument is optional. LOAD-FOREIGN is now released for all systems except HP's. Before loading a T object file with a DEFINE-FOREIGN, use (LOAD-FOREIGN file.o) to install the Unix .o files needed. Suspending systems is now documented. A system is suspended as follows: % t -h 8000000 # as big as possible > ;; load stuff > (gc) > ((*value t-implementation-env 'system-suspend) filespec nil) > (exit) If a GC occurs during the suspend it will hang. This means that the heap was not big enough. The binary distributions are a directory called tsystem. In that directory are a bunch of files including a script called linkt which takes a .o file produced by suspend and creates an executable. % cd tsystem % linkt filespec.o newimage If the code to be loaded before suspending a system contains DEFINE-FOREIGN forms, files containing these forms should be loaded inside of: (bind (((*value t-implementation-env 'make-foreign-procedure) (*value t-implementation-env 'make-foreign))) (load file1) ...) In this case the linkt script must be modified to include .o files that are referenced by DEFINE-FOREIGN expressions. System building: It is possible to build a system from the sources. The tsystem directory contains a file, i.e. sunbuild.t which explains how. Installation: As in T3.0 a shell variable TSYSTEM should be defined to be the tsystem directory. If there are fixes to the T3.1 system, there will be a fix file in the same place as this one. Send your email address to t-project@yale.arpa to receive fixes, updates, etc. Bugs: t-version-number doesn't work anymore. additional bugs to kranz@wheaties.ai.mit.edu  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 22 May 88 09:45:29 EDT Received: from kestrel (KESTREL.ARPA) by ELI.CS.YALE.EDU; Sun, 22 May 88 09:25:14 EDT Full-Name: Received: by kestrel (5.58/5.17) id AA11590; Sun, 22 May 88 06:25:34 PDT Date: Sun, 22 May 88 06:25:34 PDT From: gyro@kestrel.arpa (Scott W. Layson) Message-Id: <8805221325.AA11590@kestrel> To: t-discussion@YALE.ARPA Subject: Firstclass continuations Well, I *finally* got a little time to start familiarizing myself with T, and discovered the following: -- CATCH creates something called an "escape procedure" whose extent is dynamic (it lives on the stack) but which is, I imagine, extremely efficient to create and invoke. -- CALL-WITH-CURRENT-CONTINUATION creates a different kind of thing, an "upward continuation" it calls itself, with indefinite extent but with more overhead to create and invoke -- creation involves copying the stack into the heap, and invocation requires copying the continuation back into the stack. Now I have some questions and a "wish list". Questions: how do upward continuations (the ones created with CALL-WITH-CURRENT-CONTINUATION), which can be multiply invoked, interact with dynamic binding and UNWIND-PROTECT? E.g., if a continuation is created in the (dynamic) scope of an unwind-protect, do the cleanup forms get executed only the first time the continuation is invoked, or every time, or what? More philosophically, how *should* this work? Seems like, for at least some uses of UNWIND-PROTECT, we want the cleanup forms to be invoked exactly once, not when the continuation is *invoked* but rather when it is *reclaimed* as garbage (in the normal case, of course, these two are closely tied together). Could we arrange for the GC to do any cleanups before reclaiming a continuation? I would greatly prefer that there be only one primitive for grabbing the current continuation. The question, seems to me, is whether the system could be intelligent enough to keep it on the stack (as CATCH does now) in at least the important cases in which that's possible. Well, surely Orbit can verify, for a given CATCH, that its continuation is neither consed with nor passed to a user function which might squirrel it away; this covers the same cases as Common Lisp's BLOCK and RETURN. Would it be acceptable if, in the cases corresponding to CL's CATCH/THROW (where the THROW is not in the lexical scope of the CATCH), the continuation were always heap-consed? And second, I have in mind an application where I want to use continuations to implement multitasking. I expect to have a very large number (hundreds) of little processes, with time slices in the 10 millisecond range (probably with explicit calls to the scheduler rather than timer interrupts). I know that copying memory is very fast on the 68020, but even so, it seems like it would be a win if I didn't have to keep copying all these little continuations into the stack in order to invoke them. Seems like the answer is to implement discontiguous stacks, so the "live" part of the stack can be in the appropriate area of memory (as I gather Unix insists) but the more-or-less permanent part can remain in the heap and be accessed directly. I may be revealing my ignorance here -- does this make any sense in the context of T? -- Scott  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 23 May 88 23:06:46 EDT Received: from chamarti (CHAMARTIN.AI.MIT.EDU) by ELI.CS.YALE.EDU; Mon, 23 May 88 22:55:48 EDT Full-Name: Received: by CHAMARTIN.AI.MIT.EDU; Mon, 23 May 88 22:55:49 edt Date: Mon, 23 May 88 22:55:49 edt From: jinx@CHAMARTIN.AI.MIT.EDU (Guillermo J. Rozas) Message-Id: <8805240255.AA12991@chamarti> To: gyro@kestrel.arpa Cc: t-discussion@YALE.ARPA In-Reply-To: Scott W. Layson's message of Sun, 22 May 88 06:25:34 PDT <8805221325.AA11590@kestrel> Subject: Firstclass continuations Reply-To: jinx@zurich.ai.mit.edu Now I have some questions and a "wish list". Questions: how do upward continuations (the ones created with CALL-WITH-CURRENT-CONTINUATION), which can be multiply invoked, interact with dynamic binding and UNWIND-PROTECT? E.g., if a continuation is created in the (dynamic) scope of an unwind-protect, do the cleanup forms get executed only the first time the continuation is invoked, or every time, or what? MIT Scheme has a procedure (rather than a special form) called DYNAMIC-WIND, which is a generalization of UNWIND-PROTECT. (dynamic-wind (lambda () ) (lambda () ) (lambda () )) is similar to (begin (let ((val )) val)) except that is executed whenever is "escaped", and is executed whenever is (re)entered.  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 24 May 88 07:30:47 EDT Received: from YALEVM.YCC.YALE.EDU by ELI.CS.YALE.EDU; Tue, 24 May 88 06:01:53 EDT Received: from UKACRL.BITNET by YALEVM.YCC.YALE.EDU ; Tue, 24 May 88 06:01:55 EST Received: from RL.IB by UKACRL.BITNET (Mailer X1.25) with BSMTP id 9072; Tue, 24 May 88 10:55:53 BST Via: UK.AC.DUR.EASBY; 24 MAY 88 10:55:47 BST From: Martin Ward Date: Tue, 24 May 88 10:58:15 BST Message-Id: <8805240958.AA00802@ws_mw> To: t-discussion%edu.yale@ac.rl.ARPA I have a simple question for you T buffs: In my work on program transformations I find loops with multiple exits very useful. These are loops which can only be terminated by the execution of an "exit" statement, of the form exit(n) where n is an integer (not a variable or an expression). Execution of such a statement causes immediate termination of the "n" enclosing loops with execution continuing after the nth loop. The statement exit(0) is therefore a null statement. Wishing to implement this in T, I came up with the following syntax: (define-syntax (loop . body) `(let ((tv (catch exit (iterate again () ,@body (again))))) (if (= 1 tv) T (exit (-1+ tv))))) The iterate statement implements the loop by tail recursion of the parameterless procedure "again". This is enclosed in a "catch" form which catches the execution of any exit and records the "terminal value" in variable tv. If tv > 1 then we must terminate the next enclosing loop also, and this is achieved by executing (exit -1+ tv) - which will presumably be caught by another enclosing loop. This implementation works (apart from (exit 0) which is not ignored). Exiting with a larger value of n than there are enclosing loops is an error, with this implementation it causes termination of the invokation of T (there is a certain logic about that!) since that is the normal effect of an (exit) call. I am wondering how efficient this is in practice, normally one would translate an exit into a simple goto, there seems to be a problem with generating the labels and deciding which label to jump to. How would you define this? Martin. My ARPANET address is: martin%EASBY.DUR.AC.UK@CUNYVM.CUNY.EDU JANET: martin@uk.ac.dur.easby BITNET: martin%dur.easby@ac.uk UUCP: ...!mcvax!ukc!easby!martin  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 25 May 88 23:56:02 EDT Received: from AI.AI.MIT.EDU by ELI.CS.YALE.EDU; Wed, 25 May 88 23:09:07 EDT Date: Wed, 25 May 88 23:10:12 EDT From: Jonathan A Rees Subject: Firstclass continuations To: jinx@ZURICH.AI.MIT.EDU Cc: gyro@kestrel.arpa, t-discussion@YALE.ARPA In-Reply-To: Msg of Mon 23 May 88 22:55:49 edt from jinx at CHAMARTIN.AI.MIT.EDU (Guillermo J. Rozas) Message-Id: <385494.880525.JAR@AI.AI.MIT.EDU> Date: Mon, 23 May 88 22:55:49 edt From: jinx at CHAMARTIN.AI.MIT.EDU (Guillermo J. Rozas) MIT Scheme has a procedure (rather than a special form) called DYNAMIC-WIND, which is a generalization of UNWIND-PROTECT. (dynamic-wind (lambda () ) (lambda () ) (lambda () )) is similar to (begin (let ((val )) val)) except that is executed whenever is "escaped", and is executed whenever is (re)entered. T has this too; it's called BIND-HANDLER, and behaves the same way. (UNWIND-PROTECT body . exit) is sugar for (BIND-HANDLER FALSE (LAMBDA () body) (LAMBDA () . exit)). The BIND macro is also sugar for a use of BIND-HANDLER, thus the name.  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 26 May 88 13:13:13 EDT Received: by ELI.CS.YALE.EDU; Thu, 26 May 88 12:50:54 EDT Date: Thu, 26 May 88 12:50:54 EDT Full-Name: Ashwin Ram Message-Id: <8805261650.AA09842@ELI.CS.YALE.EDU> Received: by yale-ring (node-abc3/ABC3) via WIMP-MAIL (Version 1.3/1.5) ; Thu May 26 12:48:22 To: t-discussion@YALE.ARPA Cc: net%tub.BITNET@YALE.ARPA From: Ram-Ashwin@YALE.ARPA (Ashwin Ram) Subject: Re: Macros; lexcial scope References: <8805251659.AA00682@tub.UUCP> Reply-To: Ram-Ashwin@YALE.ARPA (Ashwin Ram) In-Reply-To: net@TUB.BITNET (Oliver Laumann) Organization: Computer Science, Yale University, New Haven, CT 06520-2158 In article <8805251659.AA00682@tub.UUCP> in comp.lang.scheme, net@tub.bitnet (Oliver Laumann) discusses the scoping of macros in Scheme and lexically scoped Lisps: > (define x 1) > (define-macro (m) x) > > (let ((x 2)) > (m)) > > Would you expect that (m) evaluates to 1 or to 2? This evaluates (correctly) to 1 in T. > Now consider a slighly more complex example: > > (define x 1) > > (let ((x 2)) > (define-macro (m) x) > (let ((x 3)) > (m))) > > In both Common Lisp and C-Scheme, this evaluates to 1. My mind boggles. This evaluates (correctly) to 2 if you use DEFINE-SYNTAX in T, but if you use DEFINE-LOCAL-SYNTAX this evaluates to 1. Is this a bug, or am I missing something? -- Ashwin. ARPA: Ram-Ashwin@cs.yale.edu UUCP: {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin BITNET: Ram@yalecs  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 26 May 88 15:12:50 EDT Received: from AI.AI.MIT.EDU by ELI.CS.YALE.EDU; Thu, 26 May 88 14:42:24 EDT Full-Name: Date: Thu, 26 May 88 14:44:10 EDT From: Jonathan A Rees Subject: Macros; lexcial scope To: Ram-Ashwin@YALE.ARPA Cc: net%tub.BITNET@YALE.ARPA, t-discussion@YALE.ARPA In-Reply-To: Msg of Thu 26 May 88 12:50:54 EDT from Ram-Ashwin@YALE.ARPA (Ashwin Ram) Message-Id: <386018.880526.JAR@AI.AI.MIT.EDU> Date: Thu, 26 May 88 12:50:54 EDT From: Ram-Ashwin@YALE.ARPA (Ashwin Ram) > (define x 1) > (define-macro (m) x) > > (let ((x 2)) > (m)) > > Would you expect that (m) evaluates to 1 or to 2? This evaluates (correctly) to 1 in T. > Now consider a slighly more complex example: > > (define x 1) > > (let ((x 2)) > (define-macro (m) x) > (let ((x 3)) > (m))) > > In both Common Lisp and C-Scheme, this evaluates to 1. My mind boggles. This evaluates (correctly) to 2 if you use DEFINE-SYNTAX in T, but if you use DEFINE-LOCAL-SYNTAX this evaluates to 1. Is this a bug, or am I missing something? Wait a minute, you are using your own definition of "correct." I would say that T's behavior in both cases is incorrect (I designed T macros, so I get to say). You are also wrong about what happens; the behavior you describe is true of interpreted code, but not for compiled code. If you compile the file first, you'll get "X unbound variable" for the first case, and "M unbound variable" in the second. It was always a goal in T to have interpreted and compiled code behave the same (except when errors happen), but in the case of macros I failed. The fix is to change the semantics of LOAD to more closely resemble the semantics of the compiler. In particular, the environment in which DEFINE-LOCAL-SYNTAX bodies are closed (you might call this the "compile-time" environment) should be disjoint from that in which the file in which the DEFINE-LOCAL-SYNTAX form occurs (the "run-time" environment). (DEFINE-MACRO is a combination of DEFINE-LOCAL-SYNTAX, which defines a macro for compilation of the current file, and DEFINE-SYNTAX, which causes a side-effect on some syntax table when the file is loaded.) This would correspond to the situation with, say, a C compiler, where compilation takes place in a different address space from execution; this is a desirable an option for T as well. Also, when a file is loaded by the interpreter, all macros should be expanded before any of the forms are evaluated, in order to reduce sensitivity to side-effects on the compile-time environment that the file itself may perform. I.e. (load "foo.t" env) ought to mimic (block (compile-file "foo.t") (load "foo.obj")) as closely as possible. I have considered making these changes for the next version of T, but they really ought to be done in conjunction with the addition of a module system, so that values can get from one environment to another more gracefully (e.g., from the run-time environment to the compile-time environment) than they do now.  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 26 May 88 16:01:43 EDT Received: by ATHENA.CS.YALE.EDU; Thu, 26 May 88 15:23:04 EDT Date: Thu, 26 May 88 15:23:04 EDT From: Ashwin Ram Full-Name: Ashwin Ram Message-Id: <8805261923.AA10901@ATHENA.CS.YALE.EDU> Received: by yale-ring (node-abc3/ABC3) via WIMP-MAIL (Version 1.3/1.5) ; Thu May 26 15:26:02 To: JAR@AI.AI.MIT.EDU Cc: net%tub.BITNET@YALE.ARPA, t-discussion@YALE.ARPA In-Reply-To: Jonathan A Rees's message <386018.880526.JAR@AI.AI.MIT.EDU> of Thu, 26 May 88 14:44:10 EDT Subject: Re: Macros; lexcial scope > Wait a minute, you are using your own definition of "correct." I would > say that T's behavior in both cases is incorrect (I designed T macros, > so I get to say). Sorry, I meant "correct" as per the discussion, i.e., "correct if macros are defined by evaluating their bodies in the lexical environment of the define-macro". I should have provided more of the context. > You are also wrong about what happens; the behavior > you describe is true of interpreted code, but not for compiled code. If > you compile the file first, you'll get "X unbound variable" for the > first case, and "M unbound variable" in the second. Just to make sure I understand you, since "X unbound variable" is the desired behavior for the first case, that means that the macro body isn't evaluated (at compile-time) in the lexical environment of the define-macro. So the compile-time environment of the macro isn't the lexical environment of the define-macro. I realize that one might want this on occasion, but I guess I don't understand why this shouldn't be so by default for a vanilla definition in a vanilla file. In the second case, M is indeed unbound inside the LET, but the macro M gets defined at top-level: it returns 2 when you type (M), which seems inconsistent with the "X unbound variable" error in the first case (i.e., it seems that the lexical environment of the define-macro, the LET, is also its compile-time environment). -- Ashwin.  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 28 May 88 20:58:34 EDT Received: from kestrel (KESTREL.ARPA) by ELI.CS.YALE.EDU; Sat, 28 May 88 20:42:39 EDT Full-Name: Received: by kestrel (5.58/5.17) id AA12556; Sat, 28 May 88 00:54:53 PDT Date: Sat, 28 May 88 00:54:53 PDT From: gyro@kestrel.arpa (Scott W. Layson) Message-Id: <8805280754.AA12556@kestrel> To: t-discussion@YALE.ARPA In-Reply-To: Jonathan A Rees's message of Wed, 25 May 88 23:10:12 EDT <385494.880525.JAR@AI.AI.MIT.EDU> Subject: Firstclass continuations Date: Wed, 25 May 88 23:10:12 EDT From: Jonathan A Rees Date: Mon, 23 May 88 22:55:49 edt From: jinx at CHAMARTIN.AI.MIT.EDU (Guillermo J. Rozas) MIT Scheme has a procedure (rather than a special form) called DYNAMIC-WIND, which is a generalization of UNWIND-PROTECT. T has this too; it's called BIND-HANDLER, and behaves the same way. (UNWIND-PROTECT body . exit) is sugar for (BIND-HANDLER FALSE (LAMBDA () body) (LAMBDA () . exit)). The BIND macro is also sugar for a use of BIND-HANDLER, thus the name. Okay, well, that's certainly a reasonable approach. To those who aren't sure what we're talking about, consider the following example (which I just ran in T 3.1): > (define *x* 3) 3 > (define *saved-cont* 'nil) NIL > (define (test1) (bind ((*x* 4)) (call-with-current-continuation (lambda (c) (set *saved-cont* c))) (print *x* (terminal-output)))) #{Procedure nn TEST1} > (test1) 4 ;; printed by PRINT ;no value > *x* 3 ;; as you'd expect > (*saved-cont*) 4 ;; printed by PRINT ;no value That is, the dynamic binding of *X* is restored when the continuation saved in *saved-cont* is invoked. I did a further experiment that verified that if more than one BIND-HANDLER is in force at the time a continuation is gotten hold of, then when that continuation is reinvoked, the entry-functions are called in the same order in which they were called originally. ----- Okay, well, it's nice to know how that works, and I agree it's pretty sensible, but I want to say I have little inclination to use it, especially in light of the fact that T specials are shallow-bound, so that invoking a continuation which has lots of BINDs in it starts to be a lot like a Zetalisp stack group switch. Yuck. Also, this only answered one of my questions, and not the most interesting one either, I think. What I would really like to hear about is people's thoughts about eliminating the distinction between CATCH and CALL-WITH-CURRENT-CONTINUATION (aka CALL/CC). -- Scott  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 28 May 88 21:00:13 EDT Received: from kestrel (KESTREL.ARPA) by ELI.CS.YALE.EDU; Sat, 28 May 88 20:42:06 EDT Full-Name: Received: by kestrel (5.58/5.17) id AA12600; Sat, 28 May 88 01:28:32 PDT Date: Sat, 28 May 88 01:28:32 PDT From: gyro@kestrel.arpa (Scott W. Layson) Message-Id: <8805280828.AA12600@kestrel> To: t-discussion@YALE.ARPA In-Reply-To: Jonathan A Rees's message of Wed, 25 May 88 23:10:12 EDT <385494.880525.JAR@AI.AI.MIT.EDU> Subject: Continuation objects: a proposal Gee, seeing how BIND-HANDLER works reminds me of an idea I had a few years ago, and suggests that it might be easier to implement than I would have guessed. It's simply stated: I want to make continuations behave like objects in the T sense: so they have a default behavior that happens when you funcall them directly, but there is also a provision for the user to define operations on them. It might look something like this: (define (foo) (catch top-level (with-continuation-operations ((punt (top-level))) (... hairy expression that calls BAR ...)))) (define (bar) ... (if something-or-other (catch c (punt c))) ...) This is to be read as follows: PUNT is defined as an operation on the continuation passed to the hairy expression (and, by inheritance, as it were, to all continuations whose default continuation is that one, just as BIND-HANDLER entry functions are inherited). Then BAR calls PUNT on such a continuation, in turn causing TOP-LEVEL to be invoked, which immediately returns from FOO. This use of a continuation operation is a lot like a dynamically-bound signal handler. Note that in fact it has just the properties that you want in such a thing: the continuation passed to the call to PUNT inside BAR will have visible any operations BAR may have defined (in Common Lisp terms, "PUNT will be invoked in the dynamic environment in force at the point of invocation"), and PUNT could choose to invoke that continuation rather than TOP-LEVEL (which would be like a condition handler returning rather than THROWing). Continuation operations could almost be used to implement dynamic binding, except for one thing: either the syntax for referencing dynamically-bound "variables" would be different from that for referencing normal variables -- this would be my preference -- or else a variable that one wanted to use as a special variable would have to be defined as something like a "symbol macro" (yuck), so that *FOO* would expand into something like (CATCH C (*FOO* C)). Personally, I would like to see these continuation operations implemented and BIND thrown out, or at least relegated to those very few instances when what you really need is literally a SET with an UNWIND-PROTECT to undo it. By the way, I don't intend the syntax and naming of the example above to be a formal proposal. WITH-CONTINUATION-OPERATIONS might plausibly be called just HANDLING or some such. And the cliche (CATCH C (op C)) might well be packaged up into (SIGNAL op). Or maybe PROVIDING and REQUEST respectively. -- Scott  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 3 Jun 88 14:58:59 EDT Received: from megaron.arizona.edu by ELI.CS.YALE.EDU; Fri, 3 Jun 88 14:40:31 EDT Full-Name: Date: Fri, 3 Jun 88 11:19:31 MST From: "Mike Coffin" Message-Id: <8806031819.AA02907@megaron.arizona.edu> Received: by megaron.arizona.edu; Fri, 3 Jun 88 11:19:31 MST To: t-discussion@YALE.ARPA Subject: extend-syntax I've got extend-syntax working in T. Now I'm wondering how it ought to be packaged. Should there be extend-syntax and extend-local-syntax, in analogy to define-syntax and define-local-syntax? Mike Coffin mike@arizona.edu Univ. of Ariz. Dept. of Comp. Sci. {allegra,cmcl2,ihnp4}!arizona!mike Tucson, AZ 85721 (602)621-4252  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 4 Jun 88 12:15:02 EDT Date: Sat, 4 Jun 88 12:14:15 EDT From: Jonathan A Rees Subject: extend-syntax To: mike@ARIZONA.EDU cc: t-discussion@MC.LCS.MIT.EDU In-reply-to: Msg of Fri 3 Jun 88 11:19:31 MST from "Mike Coffin" Message-ID: <391861.880604.JAR@AI.AI.MIT.EDU> Date: Fri, 3 Jun 88 11:19:31 MST From: "Mike Coffin" To: t-discussion@YALE.ARPA Re: extend-syntax I've got extend-syntax working in T. Now I'm wondering how it ought to be packaged. Should there be extend-syntax and extend-local-syntax, in analogy to define-syntax and define-local-syntax? You can avoid the question entirely defining a form that evaluates to a syntax descriptor, similar to T's MACRO-EXPANDER macro (at least I think that's what it's called), and not defining any defining forms at all. Suppose you call it EXTENDED-SYNTAX: then you would do (define-syntax foo (extended-syntax pat1 pat2 ...)) and (define-local-syntax foo (extended-syntax pat1 pat2 ...)). This would be much more orthogonal than having two (or more) defining forms. By the way, for all you fans of T's macro system, I think that the DEFINE-SYNTAX form was a mistake. If there is to be any explicit support for definition of macros as a side-effect of loading a file, there ought to be a special form (TARGET-SYNTAX-TABLE) that returns the syntax table into which DEFINE-SYNTAX would store the expander; then one would write (set (syntax-table-entry (target-syntax-table) 'foo) (macro-expander (foo x y) ...)). Better would be to use an ordinary variable instead of (target-syntax-table), but that would have the problem of how the name for that variable is chosen (by the HERALD form perhaps?) and how it becomes bound (by LOAD?). Best would probably be to force the programmer to decide for himself into what syntax table the macro should go. Any of these would drive home the point that many people (especially MacFranzCommon hackers) find confusing, that DEFINE-SYNTAX is a load time phenomenon. Coupled with a fix to the file loader whereby the entire file is macroexpanded before any of it is executed, I think the danger of compiled/interpreted code incompatibility would be greatly reduced. Flushing DEFINE-SYNTAX would also have the benefit of freeing up the name for some better purpose, e.g. that now served by DEFINE-LOCAL-SYNTAX.  Received: from uunet.UU.NET (TCP 30003106601) by MC.LCS.MIT.EDU 8 Jun 88 11:45:23 EDT Received: from unido.UUCP by uunet.UU.NET (5.54/1.14) with UUCP id AA01272; Wed, 8 Jun 88 10:37:10 EDT Received: by unido.uucp with uucp; Wed, 8 Jun 88 15:34:11 +0100 Received: by tumult.informatik.tu-muenchen.de (1.2/4.81) id AA10425; Wed, 8 Jun 88 16:33:56 -0200 Date: Wed, 8 Jun 88 16:33:56 -0200 From: "Anton Hartl" Message-Id: <8806081433.AA10425@tumult.informatik.tu-muenchen.de> To: t-discussion@mc.lcs.mit.edu Subject: T sources and manual Cc: danher@uunet.UU.NET I have some questions and suggestions concerning the distribution of T. 1. Is it possible to build a T system without having a running one? We recently obtained the *sources* for T3.1 from wheaties.ai.mit.edu, and realized that it is not possible to build a T system solely from the sources. So we had to get the vax-specific image to get a running T system. Is this a bug or a feature? However, there are other non-{vax,appollo,sun}-sites here in Germany (and certainly elsewhere) interested in getting T and it would be nice to be able to build the system from sources. Bootstrapping is a fine thing, but you have to start somewhere! Where did the implementors of T start? I assume there must be some kind of T interpreter written in some high level language like C (and NOT T); this interpreter could be ported more easily to different kinds of CPUs as a starting point for the complete T system. Is it possible to make this interpreter available? 2. The second problem concerns the T manual. The manuals we obtained are almost all in scribe format, a format we unfortunately are not able to deal with. Are there T manuals in TeX format? We tried the scribe2latex translator, but it catches only 90% of scribe directives. Would you like to wade through 330KB of text to fix the remaining 10%? Perhaps the T manual of the distribution itself could be transformed to TeX format, since TeX is probably more likely available than scribe. Anton Hartl ...!uunet!unido!tumult!hartl hartl%tumult@unido.uucp  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 8 Jun 88 13:09:23 EDT Received: from megaron.arizona.edu ([128.196.6.1]) by ELI.CS.YALE.EDU; Wed, 8 Jun 88 12:10:17 EDT Date: Wed, 8 Jun 88 09:13:22 MST From: "Mike Coffin" Message-Id: <8806081613.AA04989@megaron.arizona.edu> Received: by megaron.arizona.edu; Wed, 8 Jun 88 09:13:22 MST To: t-discussion@YALE.ARPA Subject: extend-syntax for T I've gotten quite a few requests for this, so here it is. ------------------------------------------------------------------------ (herald extend) ;;; ;;; Extend-syntax for T ;;; ;;; The port from MacScheme to T was done by ;;; Mike Coffin (mike@arizona.edu) ;;; ;;; When loaded, this file defines two functions, SYNTAX-MATCH? and ;;; EXTEND-SYNTAX->MACRO-EXPANDER, and also installs two macros, ;;; EXTENDED-SYNTAX and EXTEND-SYNTAX. ;;; ;;; SYNTAX-MATCH? is used by EXTEND-SYNTAX->MACRO-EXPANDER to choose ;;; among clauses and check for syntactic errors; it is also available ;;; to the user. ;;; ;;; EXTEND-SYNTAX->MACRO-EXPANDER is the basic function. ;;; It translates an argument that looks like ;;; ((key1 key2 ...) clause ...) ;;; --- i.e., the cdr of an extend-syntax form --- into unEVALed code ;;; for a macro-expander. For example, ;;; (extend-syntax->macro-expander '((foo) ((foo a b) (+ a b)))) ;;; ==> ;;; (MACRO-EXPANDER (FOO . X.72) ;;; (LET ((X.72 (CONS 'FOO X.72))) ;;; (COND ((SYNTAX-MATCH? '(FOO) '(FOO A B) X.72) ;;; `(+ ,(CADR X.72) ,(CADDR X.72))) ;;; (ELSE (ERROR "extend-syntax: invalid syntax: ~a~%" ;;; X.72))))) ;;; ;;; EXTENDED-SYNTAX is a macro that returns the actual macro-expander. ;;; This is most useful as an argument to DEFINE-SYNTAX or ;;; DEFINE-LOCAL-SYNTAX. E.g., ;;; (define-local-syntax add+1 ;;; (extended-syntax (add+1) ;;; ((add+1 x y ...) ;;; (+ 1 x y ...)))) ;;; ;;; And finally, the macro EXTEND-SYNTAX, which creates a macro-expander ;;; and then installs it with DEFINE-SYNTAX. Nice looking but not as ;;; flexible as one might like. ;;; ;;; The original header follows. ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; extend.sch ;;; Copyright (C) 1987 Cadence Research Systems ;;; Permission to copy this software, in whole or in part, to use this ;;; software for any lawful noncommercial purpose, and to redistribute ;;; this software is granted subject to the restriction that all copies ;;; made of this software must include this copyright notice in full. ;;; Cadence makes no warranties or representations of any kind, either ;;; express or implied, including but not limited to implied warranties ;;; of merchantability or fitness for any particular purpose. ;;; The basic design of extend-syntax is due to Eugene Kohlbecker. See ;;; "E. Kohlbecker: Syntactic Extensions in the Programming Language Lisp", ;;; Ph.D. Dissertation, Indiana University, 1986." The structure of "with" ;;; pattern/value clauses, the method for compiling extend-syntax into ;;; Scheme code, and the actual implementation are due to Kent Dybvig. ;;; Made available courtesy R. Kent Dybvig ;;; MacScheme conversion by Jeff De Vries ;;; note: requires the use of MacScheme Version 1.2 or greater ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; these routines are provided for compatibility with other Schemes. (define-local-syntax (when condition . actions) `(if ,condition (block ,@actions) nil) ) (define-local-syntax (unless condition . actions) `(if ,condition t (block ,@actions)) ) (labels ( ( (andmap p . args) ;; use "first-finish" rule (iterate andmap ((args args) (value t)) (if (iterate any-at-end? ((ls args)) (and (pair? ls) (or (not (pair? (car ls))) (any-at-end? (cdr ls))))) value (let ((value (apply p (map car args)))) (and value (andmap (map cdr args) value)))))) ;; constuctor and access functions for id's. ( (id name access control) (list name access control)) ( id-name car) ( id-access cadr) ( id-control caddr) ;; constuctor and access functions for loop's ( (loop) (list '())) ( loop-ids car) ( loop-ids! (setter car)) ;; alist used to add one more car or cdr to an access chain. ( c...rs `((car caar . cdar) (cdr cadr . cddr) (caar caaar . cdaar) (cadr caadr . cdadr) (cdar cadar . cddar) (cddr caddr . cdddr) (caaar caaaar . cdaaar) (caadr caaadr . cdaadr) (cadar caadar . cdadar) (caddr caaddr . cdaddr) (cdaar cadaar . cddaar) (cdadr cadadr . cddadr) (cddar caddar . cdddar) (cdddr cadddr . cddddr))) ;; optimized versions of `(car ,access) ( (add-car access) (let ((x (and (pair? access) (assq (car access) c...rs)))) (if (null? x) `(car ,access) `(,(cadr x) ,@(cdr access))))) ;; optimized version of `(cdr ,access) ( (add-cdr access) (let ((x (and (pair? access) (assq (car access) c...rs)))) (if (null? x) `(cdr ,access) `(,(cddr x) ,@(cdr access))))) ( (parse keys pat acc cntl ids) (cong- ((symbol? pat) (if (memq pat keys) ids (cons (id pat acc cntl) ids))) ((pair? pat) (if (equal? (cdr pat) '(...)) (let ((x (generate-symbol "X"))) (parse keys (car pat) x (id x acc cntl) ids)) (parse keys (car pat) (add-car acc) cntl (parse keys (cdr pat) (add-cdr acc) cntl ids)))) (else ids))) ( (gen keys exp ids loops) (cond ((symbol? exp) (let ((id (lookup exp ids))) (if (null? id) exp (block (add-control! (id-control id) loops) (list 'unquote (id-access id)))))) ((pair? exp) (cond ((eq? (car exp) 'with) (unless (syntax-match? '(with) '(with ((p x) ...) e) exp) (error "extend-syntax: invalid 'with' form~a" exp)) (list 'unquote (gen-with keys (map car (cadr exp)) (map cadr (cadr exp)) (caddr exp) ids loops))) ((and (pair? (cdr exp)) (eq? (cadr exp) '...)) (let ((x (loop))) (make-loop x (gen keys (car exp) ids (cons x loops)) (gen keys (cddr exp) ids loops)))) (else (let ((a (gen keys (car exp) ids loops)) (d (gen keys (cdr exp) ids loops))) (if (and (pair? d) (eq? (car d) 'unquote)) (list a (list 'unquote-splicing (cadr d))) (cons a d)))))) (else exp))) ( (gen-with keys pats exps body ids loops) (if (null? pats) (make-quasi (gen keys body ids loops)) (let ((p (car pats)) (e (car exps)) (g (generate-symbol "X"))) `(let ((,g ,(gen-quotes keys e ids loops))) (if (syntax-match? '() ',p ,g) ,(gen-with keys (cdr pats) (cdr exps) body (parse '() p g '() ids) loops) (error "extend-syntax: ~a does not fit with pattern ~a, ~a" ',(car keys) ,g ,p) ))))) ( (gen-quotes keys exp ids loops) (cond ((syntax-match? '(quote) '(quote x) exp) (make-quasi (gen keys (cadr exp) ids loops))) ((pair? exp) (cons (gen-quotes keys (car exp) ids loops) (gen-quotes keys (cdr exp) ids loops))) (else exp))) ( (lookup sym ids) (iterate loop ((ls ids)) (cond ((null? ls) nil) ((eq? (id-name (car ls)) sym) (car ls)) (else (loop (cdr ls)))))) ( (add-control! id loops) (unless (null? id) (when (null? loops) (error "extend-syntax: missing ellipsis in expansion")) (let ((x (loop-ids (car loops)))) (unless (memq id x) (loop-ids! (car loops) (cons id x)))) (add-control! (id-control id) (cdr loops)))) ( (make-loop loop body tail) (let ((ids (loop-ids loop))) (when (null? ids) (error "extend-syntax: extra ellipsis in expansion")) (cond ((equal? body (list 'unquote (id-name (car ids)))) (if (null? tail) (list 'unquote (id-access (car ids))) (cons (list 'unquote-splicing (id-access (car ids))) tail))) ((and (null? (cdr ids)) (syntax-match? '(unquote) '(unquote (f x)) body) (eq? (cadadr body) (id-name (car ids)))) (let ((x `(map ,(caadr body) ,(id-access (car ids))))) (if (null? tail) (list 'unquote x) (cons (list 'unquote-splicing x) tail)))) (else (let ((x `(map (lambda ,(map id-name ids) ,(make-quasi body)) ,@(map id-access ids)))) (if (null? tail) (list 'unquote x) (cons (list 'unquote-splicing x) tail))))))) ;; return `exp. As an optimization, if exp looks like ,expx we just ;; return expx instead of `,expx. ( (make-quasi exp) (if (and (pair? exp) (eq? (car exp) 'unquote)) (cadr exp) (list 'quasiquote exp))) ;; return a cond clause to compare clause cl with the form x and ;; return the appropriate EVALuable form. ( (make-clause keys cl x) (cond ((syntax-match? '() '(pat fender exp) cl) (let ((pat (car cl)) (fender (cadr cl)) (exp (caddr cl))) (let ((ids (parse keys pat x '() '()))) `((and (syntax-match? ',keys ',pat ,x) ,(gen-quotes keys fender ids '())) ,(make-quasi (gen keys exp ids '())))))) ((syntax-match? '() '(pat exp) cl) (let ((pat (car cl)) (exp (cadr cl))) (let ((ids (parse keys pat x '() '()))) `((syntax-match? ',keys ',pat ,x) ,(make-quasi (gen keys exp ids '())))))) (else (error "extend-syntax: invalid clause ~a~%" cl)))) ( make-syntax (let ((x (generate-symbol "X"))) (lambda (keys clauses) `(macro-expander (,(car keys) . ,x) (let ((,x (cons ',(car keys) ,x))) (cond ,@(map (lambda (cl) (make-clause keys cl x)) clauses) (else (error "extend-syntax: invalid syntax: ~a~%" ,x) )))) ))) );; end of label functions; beginning of labels body ;;; syntax-match? is used by extend-syntax to choose among clauses and ;;; to check for syntactic errors. It is also available to the user. (define syntax-match? (lambda (keys pat exp) (cond ((symbol? pat) (if (memq pat keys) (eq? exp pat) t)) ((pair? pat) (if (equal? (cdr pat) '(...)) (iterate f ((lst exp)) (or (null? lst) (and (pair? lst) (syntax-match? keys (car pat) (car lst)) (f (cdr lst))))) (and (pair? exp) (syntax-match? keys (car pat) (car exp)) (syntax-match? keys (cdr pat) (cdr exp))))) (else (equal? exp pat))))) ;; ;; This is the fundamental function. It translates an argument ;; that looks like ((key1 key2 ...) clause ...) --- i.e., the cdr ;; of an extend-syntax form --- into unEVALed code for a ;; macro-expander. E.g., ;; (ext-syn->macro-exp '((foo) ((foo a b) (+ a b)))) ;; ==> ;; (MACRO-EXPANDER (FOO . X.72) ;; (LET ((X.72 (CONS 'FOO X.72))) ;; (COND ((SYNTAX-MATCH? '(FOO) '(FOO A B) X.72) ;; `(+ ,(CADR X.72) ,(CADDR X.72))) ;; (ELSE (ERROR "extend-syntax: invalid syntax: ~a~%" ;; X.72))))) ;; (define (extend-syntax->macro-expander x) (cond ((and (syntax-match? '() '( (key1 key2 ...) clause ...) x) (andmap symbol? (car x) )) (let ((f (make-syntax (car x) (cdr x)))) (if (syntax-match? '() 'proc f) f (error "extend-syntax: does not fit 'with' pattern: ~a, ~a" f 'proc)))) (else (error "extend-syntax:: invalid syntax: ~a" x)))) ;; return a macro expander that corresponds to the extend-syntax ;; form x. This is useful as an argument to define-syntax or ;; define-local-syntax. E.g., ;; ;; (define-local-syntax add+1 ;; (extended-syntax (add+1) ;; ((add+1 x y ...) ;; (+ 1 x y ...)))) (define-syntax (extended-syntax . x) (extend-syntax->macro-expander x)) ;; The nicest looking but least general form. (define-syntax (extend-syntax . x) `(define-syntax ,(caar x) ,(extend-syntax->macro-expander x))) );; end of labels ;;; end of extend.t  Received: from ll-vlsi.arpa (TCP 1200200012) by MC.LCS.MIT.EDU 10 Jun 88 00:28:19 EDT Received: by ll-vlsi.arpa (5.51/3.2.sst.ll) id AA12366; Fri, 10 Jun 88 00:27:18 EDT From: James J. Hunt Received: by sonett.vlsi.ll.mit.edu (3.2/SMI-3.2) id AA10970; Fri, 10 Jun 88 00:27:17 EDT Date: Fri, 10 Jun 88 00:27:17 EDT Message-Id: <8806100427.AA10970@sonett.vlsi.ll.mit.edu> To: JAR@ai.ai.mit.edu, Olin.Shivers@centro.soar.cs.cmu.edu Cc: t-discussion@mc.lcs.mit.edu, JJH@ll-vlsi.arpa Subject: Slow response about if, bind and tables IF Olin: > this [if] macro clashes with the Scheme language standard: keywords This is a clear design principle, case closed. But what about => in cond? I do not wish to complain. It's a usefull feature that I use often, and I do not have a better idea. Anyone care to give a rational? Olin: > There are two ways to fix this clash that I can think of: > - Change the name of your macro. If T were case-sensitive like franz, > you could do what Foderaro did, and call yours "If", not "if". > But it isn't. You could call it "iph", which is gross. Better > names fail me. > - Leave poor IF alone, but define THEN and ELSE to be macros synonymous > with BLOCK. John Ellis does this with his lisps. Now your IF is > implemented in a manner consistent with the standard IF. > > Actually, ELSE is a standard T identifier, so maybe you ought to > use THEN and ELS. Or something. Stylistic point: I think it is a bad idea to use case or non-standard spelling to differentiate variables. This is very error prone. It is to easy to type ELSE when meaning ELS, etc. Don't forget, that variable names used in T are based on English sematics. The closer the argeement, the less the confusion. I did consider the Ellisp approach, but I opted for a bit restiction on the use of THEN and ELSE. Note that the Ellisp approach does not get around the function named THEN problem. Try defining a function called ELSE. It is too bad that T chose ELSE instead of OTHERWISE. BIND JAR: > I should apologize about BIND's misleading name -- it doesn't bind the > variable (like DEFINE, LAMBDA, and LSET do), it does a temporary assignment. T's BIND could be renamed SHADOW. JAR: > However I think it would be a good idea to have a way to bind a variable > without assigning it. MIT Scheme does this with the syntax > (define foo) > and in T this would want to be written as > (lset foo) > instead (because SET!, and therefore BIND, is in principle illegal on > variables bound with DEFINE -- an unfortunate incompatibility with R^3 > Scheme). If I Could then write (define foo) and not undo the effects of a previous assignment to foo, this would be just fine. TABLES: JAR: > No, you don't need two tables, you just need some distinguished object to > represent a false entry. And you needn't modify the source if you > simply shadow T's definition of TABLE-ENTRY. OK, I could use the symbol NIL for (), or better yet when #f and () are nolonger the same I can usually map on to the other. But wait, did we separate these concepts for a reason? Sorry, I'm being facetious, but you still have to check everything going into or coming out of the table for this "distinguished object" or #f and convert it to the other. "Modify the source" was a bad choice of words; read "reimplement table stuff". JAR: > I consulted with the person who wrote the table package and it seems > that it's an error to modify a table while it is being walked. That it > sometimes works is gratuitous. Unfortunately it would be prohibitively > expensive to detect this error situation; tables must be fast. And to > change this would require that WALK-TABLE in effect copy the table > before it starts walking; that would make WALK-TABLE too expensive. > > This restriction should definitely be documented. > > I recommend that you create a brand new table when you want to do > something like this, and let the old one be gc'ed. I am writing an interactive graphics program and shudder to think of letting anything just be gc'ed! Besides, copying the table is overkill. Let me suggest that the reasonable thing to do is retrict table modifications to the following: 1) changing the value of the current key, and 2) deleting the current key from the table. Changing the current key works as is because the table size doesn't change. (I do not consider (set (table-entry foo) nil) to be in this case because it is really a remove-table-entry in disguise.) Deleting the current key can be done by BINDing REMOVE-TABLE-ENTRY or in this case the SETTER of TABLE-ENTRY to a function that puts a distinguished undefined value in the value position for the current key and delete them all at the end or adjusts the current position in the array to account for the deleted key. In this way almost no overhead is incured for walks that don't use these features. Supporting both of the above is independent of how entries are delete. If, however only 1) is really needed, it comes for free if (set (table-entry foo) nil) does not really mean REMOVE-TABLE-ENTRY. For whatever it's worth, CL supports both and no more. OBJECTS: Are methods in a object really found using SELECT or is this just for interpreted code? Is there any performace penalty for listing a method last in an object instead of first? All my draw methods are listed last! -JJHunt  Received: from ll-vlsi.arpa (TCP 1200200012) by MC.LCS.MIT.EDU 10 Jun 88 19:17:25 EDT Received: by ll-vlsi.arpa (5.51/3.2.sst.ll) id AA18043; Fri, 10 Jun 88 14:47:16 EDT From: James J. Hunt Received: by sonett.vlsi.ll.mit.edu (3.2/SMI-3.2) id AA11575; Fri, 10 Jun 88 14:47:14 EDT Date: Fri, 10 Jun 88 14:47:14 EDT Message-Id: <8806101847.AA11575@sonett.vlsi.ll.mit.edu> To: JAR@ai.ai.mit.edu Cc: t-discussion@mc.lcs.mit.edu Subject: lset not define Sorry, I want to write (lset foo) not (define foo). But are all these bind forms (set, lset, define, define-constant, and define-integrable) really necessary? For instance (define-constant alpha 60) could be replaced by (define-integrable alpha 60). -JJHunt  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 13 Jun 88 11:08:53 EDT Date: Mon, 13 Jun 88 11:08:07 EDT From: Jonathan A Rees Subject: lset not define To: jjh@LL-VLSI.ARPA cc: t-discussion@MC.LCS.MIT.EDU In-reply-to: Msg of Fri 10 Jun 88 14:47:14 EDT from James J. Hunt Message-ID: <396518.880613.JAR@AI.AI.MIT.EDU> Date: Fri, 10 Jun 88 14:47:14 EDT From: James J. Hunt Sorry, I want to write (lset foo) not (define foo). But are all these bind forms (set, lset, define, define-constant, and define-integrable) really necessary? For instance (define-constant alpha 60) could be replaced by (define-integrable alpha 60). SET is not a binding form, just as := is not a binding form in Algol. It doesn't know a priori in what environment the assignment should take place. PL/1 and Common Lisp assume some default environment for assignments, but that seems unclean. The other binding forms are the same except in how they declare the use's confidence that the value won't change. LSET says the variable can be freely mutated with SET; DEFINE says it won't be SET, but may be redefined during debugging -- this allows optimizations such as beta-reduction of (let ((x global)) (unknown) x); DEFINE-CONSTANT and DEFINE-INTEGRABLE both say that global beta-reduction is permitted, and differ only in what they say about the advisability it in the case that the value is a procedure. In the best of possible languages this advisory information might be provided by declarations, and these forms would be macros (actually this change may have already been made?). Also in the case of DEFINE-INTEGRABLE, the compiler, not the user, should be deciding whether integration is a good idea, assuming it's to be permitted.  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 13 Jun 88 11:09:57 EDT Date: Mon, 13 Jun 88 11:09:20 EDT From: Jonathan A Rees Subject: lset not define To: jjh@LL-VLSI.ARPA cc: t-discussion@MC.LCS.MIT.EDU Message-ID: <396519.880613.JAR@AI.AI.MIT.EDU> Oops, I meant to say "the other forms", not "the other binding forms". I've just been doing some Common Lisp hacking, that must explain the slip.  Received: from labrea.stanford.edu (TCP 4402000057) by MC.LCS.MIT.EDU 13 Jun 88 12:31:37 EDT Received: by labrea.stanford.edu; Mon, 13 Jun 88 09:29:50 PDT Received: from blacksox.lucid.com by edsel id AA01770g; Mon, 13 Jun 88 09:23:32 PDT Received: by blacksox id AA01436g; Mon, 13 Jun 88 09:22:23 pdt Date: Mon, 13 Jun 88 09:22:23 pdt From: Eric Benson Message-Id: <8806131622.AA01436@blacksox.lucid.com> To: JAR@ai.ai.mit.edu Cc: jjh@ll-vlsi.arpa, t-discussion@mc.lcs.mit.edu In-Reply-To: Jonathan A Rees's message of Mon, 13 Jun 88 11:08:07 EDT <396518.880613.JAR@AI.AI.MIT.EDU> Subject: lset not define Date: Mon, 13 Jun 88 11:08:07 EDT From: Jonathan A Rees SET is not a binding form, just as := is not a binding form in Algol. It doesn't know a priori in what environment the assignment should take place. PL/1 and Common Lisp assume some default environment for assignments, but that seems unclean. I don't think Common Lisp assumes some default environment for assignments. There is no mention in the book of what (SETQ FOO 1) means if FOO is not - visible in a lexical binding, - proclaimed special (possibly via DEFVAR or DEFPARAMETER), or - declared special. It is true that every Common Lisp implementation of which I know assumes FOO is special in such a case, but I don't believe it is required by the book. Another reasonable interpretation would be that such assignments (and corresponding references) are illegal.  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 13 Jun 88 18:27:29 EDT Date: Mon, 13 Jun 88 18:26:23 EDT From: Jonathan A Rees Subject: T sources and manual To: unido!tumult!hartl@UUNET.UU.NET cc: danher@UUNET.UU.NET, t-discussion@MC.LCS.MIT.EDU In-reply-to: Msg of Wed 8 Jun 88 16:33:56 -0200 from "Anton Hartl" Message-ID: <396862.880613.JAR@AI.AI.MIT.EDU> Date: Wed, 8 Jun 88 16:33:56 -0200 From: "Anton Hartl" 1. Is it possible to build a T system without having a running one? Is it possible to build, say, a GNU C compiler or PCC without a having a running C compiler? We recently obtained the *sources* for T3.1 from wheaties.ai.mit.edu, and realized that it is not possible to build a T system solely from the sources. So we had to get the vax-specific image to get a running T system. Is this a bug or a feature? Feature. It means we didn't have to waste time writing an interpreter in some low-level language like C. We knew a native code compiler was going to be needed in any case, so we bootstrapped using that. Where did the implementors of T start? We started from PDP-10 Maclisp. The T-in-Maclisp emulation probably only exists now on DUMPER tapes in my office (and possibly Norman Adams's), since Yale has discarded its TOPS-20 machines. And it wouldn't do you much good, since it only ran old versions of the old T compiler (2.3?) which as far as I know were discarded long ago. The compiler for T 3.0 is a total rewrite. So the whole process would probably take you four or five iterations, even if you had all the hardware and sources. I assume there must be some kind of T interpreter written in some high level language like C (and NOT T); this interpreter could be ported more easily to different kinds of CPUs as a starting point for the complete T system. Is it possible to make this interpreter available? No such beast; I agree that the situation is lamentable. I have often considered doing a T emulation for MIT Scheme or Common Lisp, but never felt motivated enough. It probably wouldn't be too hard (although some people at Cognitive Systems, Inc. tried and couldn't get reasonable performance). T in MIT Scheme (as a macro package plus runtime library) would be particularly useful since the dialects are very compatible and MIT Scheme has an interpreter written in C. 2. The second problem concerns the T manual. The manuals we obtained are almost all in scribe format, a format we unfortunately are not able to deal with. Are there T manuals in TeX format? We tried the scribe2latex translator, but it catches only 90% of scribe directives. Would you like to wade through 330KB of text to fix the remaining 10%? Perhaps the T manual of the distribution itself could be transformed to TeX format, since TeX is probably more likely available than scribe. Any volunteers? This would be a service. I don't know of anyone who has the time. Sorry... you get what you pay for...  Received: from ll-vlsi.arpa (TCP 1200200012) by MC.LCS.MIT.EDU 22 Jun 88 14:01:03 EDT Received: by ll-vlsi.arpa (5.51/3.2.sst.ll) id AA05056; Wed, 22 Jun 88 13:59:22 EDT From: James J. Hunt Received: by sonett.vlsi.ll.mit.edu (3.2/SMI-3.2) id AA28706; Wed, 22 Jun 88 14:00:18 EDT Date: Wed, 22 Jun 88 14:00:18 EDT Message-Id: <8806221800.AA28706@sonett.vlsi.ll.mit.edu> To: t-discussion@mc.lcs.mit.edu Cc: jjh@ll-vlsi.arpa Subject: force and delay Why don't these work with multiple values? For example, > (lset foo (delay (return 1 2 3))) #{Delayed 1} > (receive-values (lambda (x y z) (list x y z)) (force foo)) ** Error: returned 3 values when 1 was expected - ** (#{Continuation 2} 1 2 3) 1> casues and error instead of returning (1 2 3). -JJHunt  Received: from AI.AI.MIT.EDU (CHAOS 3130) by MC.LCS.MIT.EDU 22 Jun 88 19:29:16 EDT Date: Wed, 22 Jun 88 19:28:47 EDT From: Jonathan A Rees Subject: force and delay To: jjh@LL-VLSI.ARPA cc: t-discussion@MC.LCS.MIT.EDU In-reply-to: Msg of Wed 22 Jun 88 14:00:18 EDT from James J. Hunt Message-ID: <401899.880622.JAR@AI.AI.MIT.EDU> Date: Wed, 22 Jun 88 14:00:18 EDT From: James J. Hunt Why don't these work with multiple values? > (lset foo (delay (return 1 2 3))) #{Delayed 1} > (receive-values (lambda (x y z) (list x y z)) (force foo)) ** Error: returned 3 values when 1 was expected - ** (#{Continuation 2} 1 2 3) I hope you have access to the source code. The answer lies in the fact that no change was made to the code for FORCE when multiple value returns were added to T. That code probably looks something like (if forced-yet? the-value (let ((value (thunk))) (set the-value value) (set forced-yet? t) the-value)) which will clearly lose if the call to thunk returns fewer or more than one value. A fix (using RECEIVE-VALUES) which conses is straightforward, but I would think twice before changing T so that FORCE conses. Probably the right thing though, to the extent multiple value returns are the right thing. Send us the fix if/when you produce one.  Received: from ll-vlsi.arpa (TCP 1200200012) by MC.LCS.MIT.EDU 22 Jun 88 21:58:08 EDT Received: by ll-vlsi.arpa (5.51/3.2.sst.ll) id AA09766; Wed, 22 Jun 88 21:56:45 EDT From: James J. Hunt Received: by sonett.vlsi.ll.mit.edu (3.2/SMI-3.2) id AA28988; Wed, 22 Jun 88 21:57:43 EDT Date: Wed, 22 Jun 88 21:57:43 EDT Message-Id: <8806230157.AA28988@sonett.vlsi.ll.mit.edu> To: JAR@ai.ai.mit.edu, t-discussion@mc.lcs.mit.edu Cc: jjh@ll-vlsi.arpa Subject: force and delay fix for multiple values Here is a modified version of location.t that extends force and delay to work with multiple values. This is based on the 3.0 sources, so any changes made for 3.1 will need to be included (I doubt there are any though). I only changed the function make-delay and made the global variable %unforced local to the closure of make-delay. -JJHunt ********************************* (herald locative (env tsys)) ;;; Copyright (c) 1985 Yale University ;;; Authors: N Adams, R Kelsey, D Kranz, J Philbin, J Rees. ;;; Modified by James J Hunt jjh@vlsi.ll.mit.edu 6/22/88 ;;; to work with multiple values. ;;; This material was developed by the T Project at the Yale University ;;; Computer Science Department. Permission to copy this software, to ;;; redistribute it, and to use it for any purpose is granted, subject to ;;; the following restric- tions and understandings. ;;; 1. Any copy made of this software must include this copyright notice in ;;; full. ;;; 2. Users of this software agree to make their best efforts (a) to return ;;; to the T Project at Yale any improvements or extensions that they make, ;;; so that these may be included in future releases; and (b) to inform ;;; the T Project of noteworthy uses of this software. ;;; 3. All materials developed as a consequence of the use of this software ;;; shall duly acknowledge such use, in accordance with the usual standards ;;; of acknowledging credit in academic research. ;;; 4. Yale has made no warrantee or representation that the operation of ;;; this software will be error-free, and Yale is under no obligation to ;;; provide any services, by way of maintenance, update, or otherwise. ;;; 5. In conjunction with products arising from the use of this material, ;;; there shall be no use of the name of the Yale University nor of any ;;; adaptation thereof in any advertising, promotional, or sales literature ;;; without prior written consent from Yale in each case. ;;; (define-settable-operation (contents loc)) (define set-contents (setter contents)) (define-operation (define-contents loc value)) (define-predicate locative?) ;;; Other locatives are made using the MAKE-LOCATIVE operation. (define-operation (make-locative proc . args) (object nil ((contents self) (apply proc args)) ((set-contents self val) (apply (setter proc) (append args (list val)))); choke! ((locative? self) t) ((print-type-string self) "Locative"))) ;;; Delays (define-predicate delay?) (define-operation (force obj) obj) (define make-delay (let ((%unforced (undefined-value 'unforced-delay))) (lambda (proc) (labels ((results %unforced) ((get-delayed) (receive new-results (proc) (set results new-results) (set get-value get-forced) (apply return results))) ((get-forced) (apply return results)) (get-value nil)) (set get-value get-delayed) (object (lambda () (get-value)) ((force self) (get-value)) ((delay? self) t) ((print-type-string self) (if (eq? results %unforced) "Delayed" "Forced")))))))  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 24 Jun 88 16:57:01 EDT Received: from MCC.COM by ELI.CS.YALE.EDU; Fri, 24 Jun 88 16:45:22 EDT Full-Name: Received: from obi-wan.aca.mcc.com by MCC.COM with TCP/SMTP; Fri 24 Jun 88 15:42:59-CDT Date: Fri, 24 Jun 88 15:42:49 CDT From: mark@mcc.com (Mark Scheevel) Posted-Date: Fri, 24 Jun 88 15:42:49 CDT Message-Id: <8806242042.AA05605@obi-wan.aca.mcc.com> Received: by obi-wan.aca.mcc.com (3.2/ACAv3.9) id AA05605; Fri, 24 Jun 88 15:42:49 CDT To: t-discussion@YALE.ARPA Subject: T without 68881? We cannot get T to run on our Sun 3/50 machines because they do not have 68881 co-processors. I tried the simple-minded approach of recompiling tsystem/float.c with the -fsoft option and then re-linking (i.e., system-suspend of the existing system followed by linkt with the new float.o), but that didn't do the trick. Do I have to rebuild the entire system (shudder!) just to get a version with soft floating-point? Or is there some simpler way? --Mark  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 27 Jun 88 10:23:29 EDT Received: from shredded-wheat.ai.mit.edu by ELI.CS.YALE.EDU; Mon, 27 Jun 88 10:18:23 EDT Full-Name: Received: by shredded-wheat.ai.mit.edu; Mon, 27 Jun 88 10:18:10 EDT Date: Mon, 27 Jun 88 10:18:10 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8806271418.AA26946@shredded-wheat.ai.mit.edu> To: mark@mcc.com Cc: t-discussion@YALE.ARPA In-Reply-To: Mark Scheevel's message of Fri, 24 Jun 88 15:42:49 CDT <8806242042.AA05605@obi-wan.aca.mcc.com> Subject: T without 68881? Date: Fri, 24 Jun 88 15:42:49 CDT From: mark@mcc.com (Mark Scheevel) Posted-Date: Fri, 24 Jun 88 15:42:49 CDT We cannot get T to run on our Sun 3/50 machines because they do not have 68881 co-processors. I tried the simple-minded approach of recompiling tsystem/float.c with the -fsoft option and then re-linking (i.e., system-suspend of the existing system followed by linkt with the new float.o), but that didn't do the trick. Do I have to rebuild the entire system (shudder!) just to get a version with soft floating-point? Or is there some simpler way? --Mark I don't know why this would not work. How did it fail? In any event, it should not be a big deal to rebuild the system using the sunbuild.t script. I assume you have t3.1? -David  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 27 Jun 88 18:02:15 EDT Received: from MCC.COM by ELI.CS.YALE.EDU; Mon, 27 Jun 88 17:46:47 EDT Full-Name: Received: from obi-wan.aca.mcc.com by MCC.COM with TCP/SMTP; Mon 27 Jun 88 16:40:17-CDT Date: Mon, 27 Jun 88 16:40:08 CDT From: mark@mcc.com (Mark Scheevel) Posted-Date: Mon, 27 Jun 88 16:40:08 CDT Message-Id: <8806272140.AA00727@obi-wan.aca.mcc.com> Received: by obi-wan.aca.mcc.com (3.2/ACAv3.9) id AA00727; Mon, 27 Jun 88 16:40:08 CDT To: kranz@wheaties.ai.mit.edu Cc: t-discussion@YALE.ARPA In-Reply-To: David Kranz's message of Mon, 27 Jun 88 10:18:10 EDT <8806271418.AA26946@shredded-wheat.ai.mit.edu> Subject: T without 68881? > I don't know why this would not work. How did it fail? In any event, it > should not be a big deal to rebuild the system using the sunbuild.t script. > I assume you have t3.1? > > -David The simple-minded approach was to recompile float.o with the -fsoft option (I'm using a Sun 3/110, SunOS 3.2 [don't ask me why we're so far behind the times]): obi-wan# cd t3.1/tsystem obi-wan# mv float.o hard-float.o obi-wan# cc float.c -c -fsoft -o float.o obi-wan# xt -h 11000000 > ((*value t-implementation-env 'system-suspend) 'new nil) > (exit) obi-wan# linkt new.o new An attempt to run the resulting executable on a Sun 3/50 produces a message like MC68881 floating-point not available -- program requires it Since I didn't (and still don't!) know when in the build process floating-point dependencies are introduced, I tried this morning to use sunbuild.t and build a new version from the ground up (again using the float.o produced with the -fsoft option). Unfortunately, this new system still fails the same way. Some simple timing comparisons on my 3/110 indicate that the old (hard fp) system and the new (soft fp) system differ, and that the new system is somewhat slower, although not as much slower as I expected (maybe 20% to 40%). (By the way, division is *faster* than multiplication on both systems; does it do less type-testing or something?) Is my compiler doing something funny and still emitting 68881 code, or is there a magic option that I need to supply to ld, or am I simply out of luck? And while I have your attention... I've also been playing with the foreign code interface. I have been able to get my simple examples to work, *as long as* I run the load-foreign expression interactively. If I try to bury the load-foreign inside a file such as (herald test) (load-foreign 'junk.o) ;; defines foo, say (define-foreign foreign-foo (foo (in rep/integer)) rep/integer) the compiled file breaks during loading with this message: ** Error: foreign procedure "_foo" does not exist in file "/nfs/users/st/mark/t3.1/tsystem/xt" If I run the load-foreign "by hand" before loading a compiled file without the load-foreign in it, everything works fine. Is this a bug, or do I have an incorrect model of how load-foreign and define-foreign interact with the compiler? --Mark  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 27 Jun 88 20:15:24 EDT Received: from ll-vlsi.arpa by ELI.CS.YALE.EDU; Mon, 27 Jun 88 20:01:20 EDT Full-Name: Received: by ll-vlsi.arpa (5.51/3.2.sst.ll) id AA19830; Mon, 27 Jun 88 19:57:54 EDT From: James J. Hunt Received: by sonett.vlsi.ll.mit.edu (3.2/SMI-3.2) id AA08340; Mon, 27 Jun 88 19:58:47 EDT Date: Mon, 27 Jun 88 19:58:47 EDT Message-Id: <8806272358.AA08340@sonett.vlsi.ll.mit.edu> To: mark@mcc.com Cc: kranz@wheaties.ai.mit.edu, t-discussion@YALE.ARPA, jjh@ll-vlsi.arpa In-Reply-To: Mark Scheevel's message of Mon, 27 Jun 88 16:40:08 CDT <8806272140.AA00727@obi-wan.aca.mcc.com> Subject: Re: T without 68881? I've built a T for sun2's, which don't have 68881's. Here is the part of my make file for linking both types. T-sun3 : t.o $(TOBJS3) /bin/ld -e start -o T-sun3 t.o $(TOBJS3A) /lib/Mcrt1.o /lib/crt0.o \ $(TOBJS3B) -lsunwindow -lm -lc T-sun2 : t.o $(TOBJS2) /bin/ld -e start -o T-sun2 t.o $(TOBJS2A) /lib/crt0.o $(TOBJS2B) \ -lsunwindow -lm -lc Notice that the sun2 stuff does not include /lib/Mcrt1.o. I suspect that you are linking this in and it is causing the OS to think that an MC68881 is required (I beleive this initializes the MC68881). Hope this helps. JJHunt  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 28 Jun 88 09:53:10 EDT Received: from shredded-wheat.ai.mit.edu by ELI.CS.YALE.EDU; Tue, 28 Jun 88 09:39:46 EDT Full-Name: Received: by shredded-wheat.ai.mit.edu; Tue, 28 Jun 88 09:39:10 EDT Date: Tue, 28 Jun 88 09:39:10 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8806281339.AA27541@shredded-wheat.ai.mit.edu> To: mark@mcc.com Cc: t-discussion@YALE.ARPA In-Reply-To: Mark Scheevel's message of Mon, 27 Jun 88 16:40:08 CDT <8806272140.AA00727@obi-wan.aca.mcc.com> Subject: T without 68881? Date: Mon, 27 Jun 88 16:40:08 CDT From: mark@mcc.com (Mark Scheevel) Posted-Date: Mon, 27 Jun 88 16:40:08 CDT An attempt to run the resulting executable on a Sun 3/50 produces a message like MC68881 floating-point not available -- program requires it Since I didn't (and still don't!) know when in the build process floating-point dependencies are introduced, I tried this morning to use sunbuild.t and build a new version from the ground up (again using the float.o produced with the -fsoft option). Unfortunately, this new system still fails the same way. Some simple timing comparisons on my 3/110 indicate that the old (hard fp) system and the new (soft fp) system differ, and that the new system is somewhat slower, although not as much slower as I expected (maybe 20% to 40%). (By the way, division is *faster* than multiplication on both systems; does it do less type-testing or something?) Is my compiler doing something funny and still emitting 68881 code, or is there a magic option that I need to supply to ld, or am I simply out of luck? I think doing what Jim Hunt suggested should do the trick. The soft floating point is not that much slower because T floating point is painfully slow anyway. This is because it is not open-coded. It may be fixed in the next release. As for division being faster than multiplication, you'll have to ask Sun about that. Any difference is is the code from float.c. And while I have your attention... I've also been playing with the foreign code interface. I have been able to get my simple examples to work, *as long as* I run the load-foreign expression interactively. If I try to bury the load-foreign inside a file such as (herald test) (load-foreign 'junk.o) ;; defines foo, say (define-foreign foreign-foo (foo (in rep/integer)) rep/integer) the compiled file breaks during loading with this message: ** Error: foreign procedure "_foo" does not exist in file "/nfs/users/st/mark/t3.1/tsystem/xt" If I run the load-foreign "by hand" before loading a compiled file without the load-foreign in it, everything works fine. Is this a bug, or do I have an incorrect model of how load-foreign and define-foreign interact with the compiler? The problem is that names from define-foreign are looked up as the file is being loaded, before the top-level forms are executed. You will have to put the load-foreign elsewhere. -David  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 28 Jun 88 12:22:24 EDT Received: from MCC.COM by ELI.CS.YALE.EDU; Tue, 28 Jun 88 12:00:51 EDT Full-Name: Received: from obi-wan.aca.mcc.com by MCC.COM with TCP/SMTP; Tue 28 Jun 88 10:57:28-CDT Date: Tue, 28 Jun 88 10:57:16 CDT From: mark@mcc.com (Mark Scheevel) Posted-Date: Tue, 28 Jun 88 10:57:16 CDT Message-Id: <8806281557.AA00708@obi-wan.aca.mcc.com> Received: by obi-wan.aca.mcc.com (3.2/ACAv3.9) id AA00708; Tue, 28 Jun 88 10:57:16 CDT To: t-discussion@YALE.ARPA In-Reply-To: James J. Hunt's message of Mon, 27 Jun 88 19:58:47 EDT <8806272358.AA08340@sonett.vlsi.ll.mit.edu> Subject: T without 68881? > I've built a T for sun2's, which don't have 68881's. Here is the part of my > make file for linking both types. > > [scripts deleted] > > Notice that the sun2 stuff does not include /lib/Mcrt1.o. I suspect that > you are linking this in and it is causing the OS to think that an MC68881 is > required (I beleive this initializes the MC68881). Hope this helps. Yup, that did the trick. In fact, I went back and tried the simple solution again: just launching T, executing ((*value t-implementation-env 'system-suspend) 'new nil) and then relinking sans /lib/Mcrt1.o (and with the soft float.o), and that produces a system that runs fine on the 3/50, so it isn't necessary to rebuild from the ground up. Thanks to Jim and David for all the help, --Mark  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 29 Jun 88 17:17:11 EDT Received: by ATHENA.CS.YALE.EDU; Wed, 29 Jun 88 15:44:24 EDT From: James Philbin Full-Name: James Philbin Message-Id: <8806291944.AA00305@ATHENA.CS.YALE.EDU> Received: by yale-ring (node-aac0/AAC0) via WIMP-MAIL (Version 1.3/1.5) ; Wed Jun 29 15:48:39 Date: Wed, 29 Jun 88 15:48:36 EDT Subject: [mcvax!dutesta!brouw@uunet.UU.NET ( ): email address adition] To: t-users@mc.lcs.mit.edu **** Forwarded Message Follows **** Received: by YALE-RING-MAIL-GW via SSMTP ($Revision: 1.19 $) ; Tue May 17 18:11:17 1988 Received: from uunet.UU.NET by ELI.CS.YALE.EDU; Tue, 17 May 88 18:21:29 EDT Full-Name: Received: from mcvax.UUCP by uunet.UU.NET (5.54/1.14) with UUCP id AA26760; Tue, 17 May 88 18:21:09 EDT Received: by mcvax.cwi.nl; Wed, 18 May 88 00:02:25 +0200 (MET) Received: by dutrun (1.2/1.10) id AA08425; Wed, 11 May 88 21:18:36 -0200 (MET) Received: by dutesta (4.12/1.10) id AA27022; Wed May 11 17:34:11 1988 MET Message-Id: <8805111534.AA27022@dutesta> Date: Wed, 11 May 88 17:34:11 -0200 From: mcvax!dutesta!brouw@uunet.UU.NET ( ) Organisation: Delft University of Technology, Faculty of Electrical Engineering, The Netherlands. To: t-project@YALE.ARPA Subject: email address adition Please can you put my email address on your list Name : Gerard Brouwer email: mcvax!dutesta!brouw **** End of Forwarded Message **** -------  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 29 Jun 88 17:18:31 EDT Received: by ELI.CS.YALE.EDU; Wed, 29 Jun 88 15:51:57 EDT From: James Philbin Full-Name: James Philbin Message-Id: <8806291951.AA14705@ELI.CS.YALE.EDU> Received: by yale-ring (node-aac0/AAC0) via WIMP-MAIL (Version 1.3/1.5) ; Wed Jun 29 15:47:40 Date: Wed, 29 Jun 88 15:47:28 EDT Subject: [mcvax!dutesta!brouw@uunet.UU.NET ( ): add email address] To: t-users@mc.lcs.mit.edu **** Forwarded Message Follows **** Received: by YALE-RING-MAIL-GW via SSMTP ($Revision: 1.19 $) ; Tue May 17 18:03:43 1988 Received: from uunet.UU.NET by ELI.CS.YALE.EDU; Tue, 17 May 88 18:10:34 EDT Full-Name: Received: from mcvax.UUCP by uunet.UU.NET (5.54/1.14) with UUCP id AA25920; Tue, 17 May 88 18:10:46 EDT Received: by mcvax.cwi.nl; Tue, 17 May 88 20:42:24 +0200 (MET) Received: by dutrun (1.2/1.10) id AA08418; Wed, 11 May 88 21:18:28 -0200 (MET) Received: by dutesta (4.12/1.10) id AA27009; Wed May 11 17:33:01 1988 MET Message-Id: <8805111533.AA27009@dutesta> Date: Wed, 11 May 88 17:33:01 -0200 From: mcvax!dutesta!brouw@uunet.UU.NET ( ) Organisation: Delft University of Technology, Faculty of Electrical Engineering, The Netherlands. To: t-project@YALE.ARPA Subject: add email address Please can you put my email address in your t-project list Name: Henk Corporaal (technical univ. delft, the netherlands) email: mcvax!dutesta!heco thanks. **** End of Forwarded Message **** -------  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 2 Jul 88 13:17:49 EDT Received: by ATHENA.CS.YALE.EDU; Sat, 2 Jul 88 13:00:06 EDT Date: Sat, 2 Jul 88 13:00:06 EDT Full-Name: Ashwin Ram Message-Id: <8807021700.AA08303@ATHENA.CS.YALE.EDU> Received: by yale-ring (node-abc3/ABC3) via WIMP-MAIL (Version 1.3/1.5) ; Sat Jul 2 13:03:12 To: t-discussion@YALE.ARPA (Newsgroups: arpa.t-discussion) From: Ram-Ashwin@YALE.ARPA (Ashwin Ram) Subject: Heap size smaller than requested Reply-To: Ram-Ashwin@YALE.ARPA (Ashwin Ram) Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Keywords: heap size On occasion I get the following message from T3.0: ;Heap allocated smaller than requested. ;2818048 bytes per heap, 524288 bytes reserved This particular message occurred when I was trying to start T3.0 with a heap size of 8 Meg. The Apollo node on which I did this had 52 Meg free, so it couldn't have been a shortage of memory. Why does this happen, and how can I get around it? -- Ashwin.  Received: from SUNED.ZOO.CS.YALE.EDU (TCP 20011000023) by MC.LCS.MIT.EDU 8 Jul 88 18:51:41 EDT Received: by SUNED.ZOO.CS.YALE.EDU; Fri, 8 Jul 88 16:45:23 EDT From: Bruce Krulwich Full-Name: Bruce Krulwich Message-Id: <8807082045.AA25712@SUNED.ZOO.CS.YALE.EDU> Received: by yale-zoo-suned (yale-zoo-suned) via WIMP-MAIL (Version 1.3/1.5) ; Fri Jul 8 16:45:20 Date: Fri, 8 Jul 88 16:45:18 EDT Subject: Object mathod inheritance To: t-discussion@YALE.ARPA In old versions of T is was possible to specify in an object's method list another object (or rather, a handler) to default to for calls to methods not defined for the object. For example, (object nil ((print self port) (format port "zowie")) (=> default-handler)) would use DEFAULT-HANDLER's method clauses for all methods other than PRINT. Does this functionality still exist?? JOIN will accomplish a similar thing, but (1) I would prefer to do it at object definition time, and (2) I want to do this will structures, which are not (yet) supported by JOIN. Bruce Krulwich -------  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 11 Jul 88 09:58:58 EDT Received: from shredded-wheat.ai.mit.edu ([128.52.36.33]) by ELI.CS.YALE.EDU; Mon, 11 Jul 88 09:54:51 EDT Full-Name: Received: by shredded-wheat.ai.mit.edu; Mon, 11 Jul 88 09:55:04 EDT Date: Mon, 11 Jul 88 09:55:04 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8807111355.AA05182@shredded-wheat.ai.mit.edu> To: krulwich-bruce@YALE.ARPA Cc: t-discussion@YALE.ARPA In-Reply-To: Bruce Krulwich's message of Fri, 8 Jul 88 16:45:18 EDT <8807082045.AA25712@SUNED.ZOO.CS.YALE.EDU> Subject: Object mathod inheritance From: Bruce Krulwich Date: Fri, 8 Jul 88 16:45:18 EDT In old versions of T is was possible to specify in an object's method list another object (or rather, a handler) to default to for calls to methods not defined for the object. For example, (object nil ((print self port) (format port "zowie")) (=> default-handler)) would use DEFAULT-HANDLER's method clauses for all methods other than PRINT. Does this functionality still exist?? JOIN will accomplish a similar thing, but (1) I would prefer to do it at object definition time, and (2) I want to do this will structures, which are not (yet) supported by JOIN. Bruce Krulwich ------- The (never released) syntax you refer to is not supported in T3. As for the example you give, nothing says that (object nil ((print self port) (format port "zowie")) (=> default-handler)) won't be implemented as (or even macro-expand into) (join (object nil ((print self port) (format port "zowie"))) default-handler) so I'm not sure what you mean by 'do it at object definition time'. Also, as far as I know join works on structures. Please report a bug if it doesn't. -David  Received: from SUNED.ZOO.CS.YALE.EDU (TCP 20011000023) by MC.LCS.MIT.EDU 11 Jul 88 10:41:44 EDT Received: by SUNED.ZOO.CS.YALE.EDU; Mon, 11 Jul 88 10:24:16 EDT From: Bruce Krulwich Full-Name: Bruce Krulwich Message-Id: <8807111424.AA09399@SUNED.ZOO.CS.YALE.EDU> Received: by yale-zoo-suned (yale-zoo-suned) via WIMP-MAIL (Version 1.3/1.5) ; Mon Jul 11 10:24:11 Date: Mon, 11 Jul 88 10:24:08 EDT Subject: Re: Object method inheritance To: kranz@wheaties.ai.mit.edu (David Kranz) Cc: t-discussion@YALE.ARPA In-Reply-To: kranz@wheaties.ai.mit.edu (David Kranz), Mon, 11 Jul 88 09:55:04 EDT In old versions of T is was possible to specify in an object's method list another object (or rather, a handler) to default to for calls to methods not defined for the object. [Example and discussion deleted] The (never released) syntax you refer to is not supported in T3. As for the example you give, nothing says that (object nil ((print self port) (format port "zowie")) (=> default-handler)) won't be implemented as (or even macro-expand into) (join (object nil ((print self port) (format port "zowie"))) default-handler) Yes, but I would thought that it could be compiled much more efficiently. Also, as far as I know join works on structures. Please report a bug if it doesn't. JOIN works on structures in the sense that it will return an object that correctly dispatches to the methods handled by the two structures, but the resulting object cannot handle any slot manipulation defined by either of the two original structures. If JOIN on structures would be defined to handle even just one of the structure's slot definitions it would be a useful thing, but as of now it's fairly useless to JOIN structures. [Note: the T3.0 release notes say "JOIN now works on procedures and objects created by the object special form. It does not yet work on structures or primitive objects...] Bruce Krulwich -------  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 22 Jul 88 19:07:35 EDT Received: from RELAY.CS.NET by ELI.CS.YALE.EDU; Fri, 22 Jul 88 19:02:55 EDT Full-Name: Received: from relay2.cs.net by RELAY.CS.NET id aq10192; 22 Jul 88 13:27 EDT Received: from tektronix.tek.com by RELAY.CS.NET id aa11867; 22 Jul 88 13:10 EDT Received: by tektronix.TEK.COM (5.51/6.24) id AA19806; Fri, 22 Jul 88 09:21:29 PDT Received: by tekadg.TEK.COM (5.51/6.23) id AA14722; Fri, 22 Jul 88 09:21:13 PDT Message-Id: <8807221621.AA14722@tekadg.TEK.COM> To: t-discussion@YALE.ARPA Subject: Customized T Date: 22 Jul 88 09:21:07 PDT (Fri) From: tims%tekadg.tek.com@RELAY.CS.NET Friends, I am running T3.1 on a VAX/750 under Unix 4.3bsd. I have written an application in (the Scheme subset of) T. Now I would like to make a version of T that has my code loaded into it already, and that comes up and calls my top level. So far I have tried to imitate the load-and-suspend-system procedure, but my imitation was not good enough. I'd appreciate any comments or advice. Tim  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 28 Jul 88 11:26:30 EDT Received: from shredded-wheat.ai.mit.edu by ELI.CS.YALE.EDU; Thu, 28 Jul 88 11:12:33 EDT Full-Name: Received: by shredded-wheat.ai.mit.edu; Thu, 28 Jul 88 11:10:23 EDT Date: Thu, 28 Jul 88 11:10:23 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8807281510.AA00230@shredded-wheat.ai.mit.edu> To: tims%tekadg.tek.com@relay.cs.net Cc: t-discussion@YALE.ARPA In-Reply-To: tims%tekadg.tek.com@relay.cs.net's message of 22 Jul 88 09:21:07 PDT (Fri) <8807221621.AA14722@tekadg.TEK.COM> Subject: Customized T Date: 22 Jul 88 09:21:07 PDT (Fri) From: tims%tekadg.tek.com@relay.cs.net Friends, I am running T3.1 on a VAX/750 under Unix 4.3bsd. I have written an application in (the Scheme subset of) T. Now I would like to make a version of T that has my code loaded into it already, and that comes up and calls my top level. So far I have tried to imitate the load-and-suspend-system procedure, but my imitation was not good enough. I'd appreciate any comments or advice. Tim As it says in the T3.1 release notes: A system is suspended as follows: % t -h 8000000 # as big as possible > ;; load stuff > (gc) > ((*value t-implementation-env 'system-suspend) filespec nil) > (exit) If a GC occurs during the suspend it will hang. This means that the heap was not big enough. In sys/tsystem.t there is a definition of STANDARD-TOP-LEVEL which eventually gets called when a system starts up. You can redefine this in t-implementation-env. Also, there was a bug in the Vax version on wheaties before June 17. It showed itself as a random error that sometimes ocurred after a GC. The fix is: Change the source file v_dispatch.t so that the fifth instruction in *operation-template* is pushl instead of pushal. To patch the executable: adb -w xt 28a?w 8fdd $q -David  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 5 Aug 88 13:03:33 EDT Received: from ATHENA (ATHENA.MIT.EDU) by ELI.CS.YALE.EDU; Fri, 5 Aug 88 12:41:07 EDT From: Full-Name: Received: by ATHENA.MIT.EDU (5.45/4.7) id AA01413; Fri, 5 Aug 88 12:34:09 EDT Received: by M1-142-3.MIT.EDU (5.45/4.7) id AA15293; Fri, 5 Aug 88 12:33:33 EDT Date: Fri, 5 Aug 88 12:33:33 EDT Message-Id: <8808051633.AA15293@M1-142-3.MIT.EDU> To: t-users@YALE.ARPA Subject: T Xlib interface: What level of interest exists? I have a foreign function T interface to Xlib in sortof alpha stage. Am deciding whether to proceed. What degree of interest is there in having such? (go/nogo decision to be made on reply number and content) mcharity@athena.mit.edu ...!mit-eddie!mit-athena!mcharity  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 24 Aug 88 18:14:17 EDT Received: from AI.AI.MIT.EDU by ELI.CS.YALE.EDU; Wed, 24 Aug 88 18:09:11 EDT Full-Name: Date: Wed, 24 Aug 88 18:09:11 EDT From: Devon Sean McCullough To: t-discussion@YALE.ARPA Message-Id: <432399.880824.DEVON@AI.AI.MIT.EDU> Where can I get a tape of T for a Sun, or do I have to port it myself? Also, could someone add Devon-Junk@ai.ai.mit.edu to this list?  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 2 Sep 88 18:18:11 EDT Received: from gargoyle.uchicago.edu by ELI.CS.YALE.EDU; Fri, 2 Sep 88 17:58:08 EDT Full-Name: Received: by gargoyle.uchicago.edu from tartarus.uchicago.edu (5.59/1.14) id AA18090; Fri, 2 Sep 88 16:56:34 CDT Received: by tartarus.uchicago.edu (3.2/4.7) id AA12319; Fri, 2 Sep 88 16:56:25 CDT Date: Fri, 2 Sep 88 16:56:25 CDT From: mitchell%tartarus@gargoyle.uchicago.edu (Mitchell Marks) Message-Id: <8809022156.AA12319@tartarus.uchicago.edu> To: t-discussion@YALE.ARPA Subject: Limit on number of arguments. Any way around this? Cc: ai@tartarus.ARPA There seems to be an inherent limit on the maximum number of arguments that can be passed to a procedure (obviously, I mean one that allows variable number of arguments in the first place). It's about 64. Can anyone suggest a way to get around this? We are running T 3.0 on Apollo 3000's (fix 17). Sample behaviors: >>> (apply polygon (iota 64)) ;;; This is from Jim Firby's windows package ;0 Calling POLYGON with arguments (64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ;0 Returned from POLYGON with values (#{Picture 26 POLYGON}) #{Picture 26 POLYGON} >>> (apply polygon (iota 66)) ** Error: exceeded maximum number of arguments while applying #{Traced 24 #{Procedure 23 POLYGON}} >>>>> (apply + (iota 75)) ** Error: exceeded maximum number of arguments while applying #{Procedure 27 ADD} >>>>>> (apply + (iota 64)) 2080 It's not connected with the explicit APPLY:: >>>> (ADD 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) 2080 >>>> (ADD 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ** Error: exceeded maximum number of arguments while applying #{Procedure 27 ADD} Thanks for any information or suggestions. Mitch Marks  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 6 Sep 88 11:00:57 EDT Received: from shredded-wheat.ai.mit.edu by ELI.CS.YALE.EDU; Tue, 6 Sep 88 10:45:45 EDT Full-Name: Received: by shredded-wheat.ai.mit.edu; Tue, 6 Sep 88 10:45:46 EDT Date: Tue, 6 Sep 88 10:45:46 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8809061445.AA23987@shredded-wheat.ai.mit.edu> To: DEVON@ai.ai.mit.edu Cc: t-discussion@YALE.ARPA In-Reply-To: Devon Sean McCullough's message of Wed, 24 Aug 88 18:09:11 EDT <432399.880824.DEVON@AI.AI.MIT.EDU> Date: Wed, 24 Aug 88 18:09:11 EDT From: Devon Sean McCullough Where can I get a tape of T for a Sun, or do I have to port it myself? Also, could someone add Devon-Junk@ai.ai.mit.edu to this list? Sun t3.1 is on wheaties.ai.mit.edu in the pub/t3.1 directory from anonymous ftp. -David  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 14 Sep 88 14:30:11 EDT Received: from shredded-wheat.ai.mit.edu by ELI.CS.YALE.EDU; Wed, 14 Sep 88 14:14:08 EDT Full-Name: Received: by shredded-wheat.ai.mit.edu; Wed, 14 Sep 88 14:15:43 EDT Date: Wed, 14 Sep 88 14:15:43 EDT From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8809141815.AA04821@shredded-wheat.ai.mit.edu> To: t-discussion@YALE.ARPA Cc: ballance@unmvax.unm.edu Subject: manual As a temporary measure, there is now a lineprinter version of the T manual. It is on wheaties.ai.mit.edu in pub/t3.1/manual.Z.  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 20 Sep 88 12:54:40 EDT Received: by ELI.CS.YALE.EDU; Tue, 20 Sep 88 12:36:17 EDT From: Stephen Slade Full-Name: Stephen Slade Message-Id: <8809201636.AA01373@ELI.CS.YALE.EDU> Received: by yale-hp-crown (naples) via WIMP-MAIL (Version 1.3/1.5) ; Tue Sep 20 12:42:08 Date: Tue, 20 Sep 88 12:42:04 EDT Subject: T Book Errata To: t-discussion@YALE.ARPA Gentle readers: It's dirty laundry time. Here is a list of errata for the book: "The T Programming Language: A Dialect of LISP" Stephen Slade, 1987, Prentice-Hall. I am confident that the diligent reader can uncover additional egregious errors. Please let me know of same. --Stephen * * * * * * * * * * * Copyright page. The scroll design used on the front cover should be attributed to Anni Albers. chapter 1 p 4 line 5 "several other LISP dialects" should read "Common LISP" chapter 2 p 11 line 5 extra prompt ">" should be deleted chapter 3 p 51 first example "top-level list..." should read "first top-level list..." p 53 bottom of page second "(define x ... 'd)" should be "(define y ... 'd)" chapter 4 p 60 epigraph "(1986)" should read "(1987)" chapter 9 p 152 middle of page remove the "whale" of type "fish" (this does not affect the execution of the code, but may be confusing) p 157 middle of page "There are no iteration arguments in this example." should read "count is the single iteration argument in this example." p 164 "'error-in-sub-binary" should read "'error-in-process-node" chapter 11 (macros) p 211 This definition of my-block0 has a hole in it: >(lset rest 6) 6 >(my-block0 rest 4 5) #{procedure 4} See answers to this exercise for better solutions. chapter 12 (structures) p 225 middle third of page "T" should read "#t" (3 occurrences) chapter 13 (objects) p 239 insert following line before definition of make-person (define-operation (name-of self) (self)) p 239 middle of page (format port "#Person ~A ~A Age: ~A" should read (format port "#{Person ~A ~A Age: ~A}" pp 239, 250, 252 object examples have print methods which use "stream" as an identifier for a "port". This is not wrong, merely confusing. ((print self stream) (format stream ... should read ((print self port) (format port ... p 245 4 lines from bottom of page (set plist '((())))) should read (set plist (copy-tree '((()))))) chapter 14 p 266 middle of page "last digit is 4" should read "last digit is 6" p 266 lower half of page "no longer find Jane" should read "no longer find Hank" p 276 bottom line of page "T" should read "#t" p 296 near bottom of page "Reagan is President" should read "Washington is President" chapter 16 p 323 bottom line of page "T" should read "#t" p 324 second line of page "T" should read "#t" p 324 bottom third of page "explicit coercion outines" should read "explicit coercion routines" chapter 17 p 341 bottom of page "dead-code limination." should read "dead-code elimination." p 342 bottom of third paragraph "kernal" should read "kernel" appendix a p 359 bottom third of page "(define charn= char)~" should read "(define charn= char/=)" p 359 add definition of T's last (define (t-last list) (car (last list))) appendix c p 371 answer to no-zeros uses "equiv?" which has not been introduced. should use "equal?" instead p 374 answer to exercise 4.7.6. "See the definition of append2, in section refappend-def, on page pagerefappend-def." should read "See the definition of append2, in section 8.3, on page 136." p 391 definitions of "enter" and "ppp" indentation screwy (tabs problem) appendix d p 409 citation 2 "To appear in SIGPLAN Notices" should read "Also in SIGPLAN Notices, 21/12, December (1986)." -------  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 22 Sep 88 13:43:39 EDT Received: from sonoma.Stanford.EDU by ELI.CS.YALE.EDU; Thu, 22 Sep 88 12:59:40 EDT Received: from dolores.Stanford.EDU by sonoma.Stanford.EDU (5.59/inc-1.0) id AA27663; Thu, 22 Sep 88 09:53:30 PDT Message-Id: <8809221653.AA27663@sonoma.Stanford.EDU> Received: by dolores; Thu, 22 Sep 88 09:53:57 pdt Date: Thu, 22 Sep 88 09:53:57 pdt From: Erik Ruf To: t-discussion@YALE.ARPA Subject: wanted: interrupt mechanism I would like to know if it is possible to write an "interrupt" procedure in T; that is, is there a mechanism which will invoke a T procedure based on some external event like a timer tick? The motivation for this is to allow limited "background" processing; in my case, allowing a window to catch its X events while the user is running some other T code from the REPL prompt. In the past, I have used such a mechanism in MIT C-Scheme, and now I'm trying to port my code. Does T have support for such a feature, or does anyone out there have code that adds it? Erik Ruf Stanford University  Received: from gwusun (TCP 20051001001) by MC.LCS.MIT.EDU 23 Sep 88 00:28:03 EDT Received: by gwusun (4.0/25-eef) id AA11826; Fri, 23 Sep 88 00:25:24 EDT Date: Fri, 23 Sep 88 00:25:24 EDT From: tyan@gwusun.gwu.edu (Tyan Sheng) Message-Id: <8809230425.AA11826@gwusun> To: t-discussion@mc.lcs.mit.edu Would you please send us some instructions about how to install CScheme into our ATT system 5, and if there were other institutes who had successed in doing so, please give us their mail address, so we can ask for their experiences.  Received: from cmx.npac.syr.edu (TCP 20071403410) by MC.LCS.MIT.EDU 4 Oct 88 17:28:04 EDT Received: by cmx.npac.syr.edu (5.51/2.1-cmx at NPAC) id AA06905; Tue, 4 Oct 88 17:06:51 EDT Date: Tue, 4 Oct 88 17:07:39 edt From: jbennett@amax.npac.syr.edu (James P. Bennett) Received: by amax.npac.syr.edu (4.12/Northeast-Parallel-Architectures-Center) id AA20117; Tue, 4 Oct 88 17:07:39 edt Message-Id: <8810042107.AA20117@amax.npac.syr.edu> To: T-Discussion@mc.lcs.mit.edu In The T Manual, 4th ed., make-stype takes two arguments. In T3.0 and 3.1, it requires a third. I've clearly missed some post-l984 development. Can someone fill me in?  Received: from void (TCP 2206400236) by MC.LCS.MIT.EDU 5 Oct 88 20:30:51 EDT Received: by VOID.AI.MIT.EDU; Wed, 5 Oct 88 19:40:11 edt Date: Wed, 5 Oct 88 19:40:11 edt From: jar@VOID.AI.MIT.EDU (Jonathan Rees) Message-Id: <8810052340.AA02234@void> To: jbennett@amax.npac.syr.edu Cc: T-Discussion@mc.lcs.mit.edu In-Reply-To: James P. Bennett's message of Tue, 4 Oct 88 17:07:39 edt <8810042107.AA20117@amax.npac.syr.edu> Reply-To: jar@zurich.ai.mit.edu Date: Tue, 4 Oct 88 17:07:39 edt From: jbennett@amax.npac.syr.edu (James P. Bennett) In The T Manual, 4th ed., make-stype takes two arguments. In T3.0 and 3.1, it requires a third. I've clearly missed some post-l984 development. Can someone fill me in? Ordinarily you should consult the T 3.0 and 3.1 release notes to find out about changes like this. However, I don't think this particular change was documented. I think the third argument has something to do with making structures handle generic operations. The source code for DEFINE-STRUCTURE-TYPE (in macros.t, I think) might be of some use in figuring out what's going on. Or perhaps someone else on this list will volunteer the information.  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 7 Oct 88 16:44:40 EDT Received: by ATHENA.CS.YALE.EDU; Thu, 6 Oct 88 12:31:40 EDT Date: Thu, 6 Oct 88 12:31:40 EDT From: Ashwin Ram Full-Name: Ashwin Ram Message-Id: <8810061631.AA17762@ATHENA.CS.YALE.EDU> Received: by yale-ring (node-abc3/ABC3) via WIMP-MAIL (Version 1.3/1.5) ; Thu Oct 6 12:22:32 To: t-discussion@YALE.ARPA Subject: Re: (none) Newsgroups: arpa.t-discussion In-Reply-To: <39665@yale-celray.yale.UUCP> Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Reply-To: Ram-Ashwin@YALE.ARPA (Ashwin Ram) > From: jar@VOID.AI.MIT.EDU (Jonathan Rees) > > Date: Tue, 4 Oct 88 17:07:39 edt > From: jbennett@amax.npac.syr.edu (James P. Bennett) > > In The T Manual, 4th ed., make-stype takes two arguments. In T3.0 and 3.1, > it requires a third. I've clearly missed some post-l984 development. Can > someone fill me in? > > I think the third argument has something to do > with making structures handle generic operations. The source code for > DEFINE-STRUCTURE-TYPE (in macros.t, I think) might be of some use in > figuring out what's going on. Or perhaps someone else on this list > will volunteer the information. The third argument to make-stype is a handler (this can be nil, oops, '#f, if you don't want to specify one). If specified, the handler is joined with the default stype handler. (See struct.t and macros.t). For example: > (define-structure-type ship x y) #{Structure-type SHIP} > (make-ship) #{Structure SHIP 1} > (define-structure-type ship x y (((print self stream) (format stream "#{Ship ~a}" (object-hash self))))) #{Structure-type SHIP} > (make-ship) #{Ship 2} -- Ashwin. ARPA: Ram-Ashwin@cs.yale.edu UUCP: {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin BITNET: Ram@yalecs  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 2 Nov 88 16:31:08 EST Received: by ATHENA.CS.YALE.EDU; Wed, 2 Nov 88 16:14:55 EST From: Bruce Krulwich Full-Name: Bruce Krulwich Message-Id: <8811022114.AA24435@ATHENA.CS.YALE.EDU> Received: by yale-hp-crown (szechuan) via WIMP-MAIL (Version 1.3/1.5) ; Wed Nov 2 16:17:06 Date: Wed, 2 Nov 88 16:16:57 EST Subject: Weak pointers and GC To: t-discussion@YALE.ARPA I have a question about something that's not specified in T that people on T-DISCUSSION might want to think about. The question is what GC does to entries in the weak pointer table (ie, the OBJECT-HASH table) that are NOT GC'ed. Objects in the table that are GC'ed obviously go away (that's the whole point of the table). As of now (T3.1) it seems that the table is cleared upon GC. For example, when I enter (let ((x (object-unhash 69))) (gc)) the object that was in (OBJECT-UNHASH 69) will not be GC'ed (because it is referenced in the current lexical context by X), but it will no longer be accessable through OBJECT-UNHASH. Is there any reason for this?? Keeping them in the table makes more sense to me. Bruce Krulwich -------  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 2 Nov 88 17:31:19 EST Received: from shredded-wheat.ai.mit.edu ([128.52.36.33]) by ELI.CS.YALE.EDU; Wed, 2 Nov 88 17:19:00 EST Full-Name: Received: by shredded-wheat.ai.mit.edu; Wed, 2 Nov 88 17:19:50 EST Date: Wed, 2 Nov 88 17:19:50 EST From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8811022219.AA09563@shredded-wheat.ai.mit.edu> To: krulwich-bruce@YALE.ARPA Cc: t-discussion@YALE.ARPA In-Reply-To: Bruce Krulwich's message of Wed, 2 Nov 88 16:16:57 EST <8811022114.AA24435@ATHENA.CS.YALE.EDU> Subject: Weak pointers and GC From: Bruce Krulwich Date: Wed, 2 Nov 88 16:16:57 EST I have a question about something that's not specified in T that people on T-DISCUSSION might want to think about. The question is what GC does to entries in the weak pointer table (ie, the OBJECT-HASH table) that are NOT GC'ed. Objects in the table that are GC'ed obviously go away (that's the whole point of the table). As of now (T3.1) it seems that the table is cleared upon GC. For example, when I enter (let ((x (object-unhash 69))) (gc)) the object that was in (OBJECT-UNHASH 69) will not be GC'ed (because it is referenced in the current lexical context by X), but it will no longer be accessable through OBJECT-UNHASH. Is there any reason for this?? Keeping them in the table makes more sense to me. Your explanation is not correct. You are calling GC tail-recursively and so the environment containing x is not seen by the gc. Try: (let ((x (object-unhash 69))) (gc) t) -David  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 2 Nov 88 17:32:00 EST Received: from shredded-wheat.ai.mit.edu ([128.52.36.33]) by ELI.CS.YALE.EDU; Wed, 2 Nov 88 17:19:00 EST Full-Name: Received: by shredded-wheat.ai.mit.edu; Wed, 2 Nov 88 17:19:42 EST Date: Wed, 2 Nov 88 17:19:42 EST From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8811022219.AA09560@shredded-wheat.ai.mit.edu> To: krulwich-bruce@YALE.ARPA Cc: t-discussion@YALE.ARPA In-Reply-To: Bruce Krulwich's message of Wed, 2 Nov 88 16:16:57 EST <8811022114.AA24435@ATHENA.CS.YALE.EDU> Subject: Weak pointers and GC From: Bruce Krulwich Date: Wed, 2 Nov 88 16:16:57 EST I have a question about something that's not specified in T that people on T-DISCUSSION might want to think about. The question is what GC does to entries in the weak pointer table (ie, the OBJECT-HASH table) that are NOT GC'ed. Objects in the table that are GC'ed obviously go away (that's the whole point of the table). As of now (T3.1) it seems that the table is cleared upon GC. For example, when I enter (let ((x (object-unhash 69))) (gc)) the object that was in (OBJECT-UNHASH 69) will not be GC'ed (because it is referenced in the current lexical context by X), but it will no longer be accessable through OBJECT-UNHASH. Is there any reason for this?? Keeping them in the table makes more sense to me. Your explanation is not correct. You are calling GC tail-recursively and so the environment containing x is not seen by the gc. Try: (let ((x (object-unhash 69))) (gc) t) -David  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 3 Nov 88 13:40:42 EST Received: by ELI.CS.YALE.EDU; Thu, 3 Nov 88 13:23:33 EST Date: Thu, 3 Nov 88 13:23:33 EST From: Bruce Krulwich Full-Name: Bruce Krulwich Message-Id: <8811031823.AA10169@ELI.CS.YALE.EDU> Received: by yale-hp-crown (szechuan) via WIMP-MAIL (Version 1.3/1.5) ; Thu Nov 3 13:27:13 To: kranz@wheaties.ai.mit.edu, t-discussion@YALE.ARPA Subject: Re: Weak pointers and GC Newsgroups: arpa.t-discussion In-Reply-To: <42049@yale-celray.yale.UUCP> Organization: Computer Science, Yale University, New Haven, CT 06520-2158 I wrote: > I have a question about something that's not specified in T that people on > T-DISCUSSION might want to think about. The question is what GC does to > entries in the weak pointer table (ie, the OBJECT-HASH table) that are NOT > GC'ed. Objects in the table that are GC'ed obviously go away (that's the > whole point of the table). > > As of now (T3.1) it seems that the table is cleared upon GC. For example, > when I enter > > (let ((x (object-unhash 69))) (gc)) > > the object that was in (OBJECT-UNHASH 69) will not be GC'ed (because it is > referenced in the current lexical context by X), but it will no longer be > accessable through OBJECT-UNHASH. David Kranz wrote: >Your explanation is not correct. You are calling GC tail-recursively and so >the environment containing x is not seen by the gc. Try: > > (let ((x (object-unhash 69))) (gc) t) Yep, that works. I guess the compiler was too smart for my own good. Sorry for the premature post. Bruce Krulwich  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 18 Nov 88 06:41:55 EST Received: from RELAY.CS.NET by ELI.CS.YALE.EDU; Fri, 18 Nov 88 06:28:27 EST Full-Name: Received: from relay2.cs.net by RELAY.CS.NET id af18118; 18 Nov 88 1:13 EST Received: from tektronix.tek.com by RELAY.CS.NET id aa02834; 17 Nov 88 16:21 EST Received: by tektronix.TEK.COM (5.51/6.24) id AA08831; Thu, 17 Nov 88 12:48:27 PST Received: by tekchips.CRL.TEK.COM (5.51/6.24) id AA03584; Thu, 17 Nov 88 12:49:12 PST Message-Id: <8811172049.AA03584@tekchips.CRL.TEK.COM> To: kranz@WHEATIES.AI.MIT.EDU Cc: adams@tekchips.crl.ARPA, t-discussion@YALE.ARPA Subject: Problems withs T3.1 build on VaxStation Date: 17 Nov 88 12:49:10 PST (Thu) From: kend@tekchips.crl.ARPA I am having a problem building t3.1 on a VaxStation. the T binary runs just fine on VaxStations, but there are 2 problems with the build. [1] The machine-type of the local-machine is 'vax/unix, so the load-linker function in tsystem/unvaxbuild.t needs this added to the vax system case. [2] The compilation process seems to go fine, but the link gets into an infinite loop which fills the disk nicely: ;*POST-GC-AGENDA* done ; 57044 objects copied ;Space Remaining: 1014943 left out of 1249998 (81% free) ;GC done Linking (TSYSTEM NEW) ... resolving modules ;** Warning: VAX-BIG-BANG multiply defined ;** Warning: CLEAR-EXTRA-REGISTERS multiply defined ;** Warning: CURRENT-TASK multiply defined ;** Warning: \@@ multiply defined ;** Warning: GC_INTERRUPT multiply defined ;** Warning: CRAWL-EXHIBIT-FAULT-FRAME multiply defined ;** Warning: TRACE-FAULT-FRAME multiply defined ;** Warning: LAP-RELOCATE multiply defined ;** Warning: RELOCATE-RANDOM-CODE multiply defined ;** Warning: MAKE-LINK-SNAPPER multiply defined ;** Warning: *LINK-SNAPPER-TEMPLATE* multiply defined ;** Warning: VAX-BIG-BANG multiply defined ... and repeat ... I don't have enough internals knowledge to determine whether the environment is properly set up or if there is a bootstrap problem in going from Unix to Ultrix. The system identifies itself as Ultrix 2.0-1. Any help is appreciated. Thanks, -Ken Dickey --------------------------------------------------- CSnet : kend%tekchips.tek.com@relay.cs.net ARPAnet: kend%tekchips%tektronix@csnet-relay UUCP : kend%tekchips@tektronix.TEK.COM ---------------------------------------------------  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 18 Nov 88 11:53:19 EST Received: from shredded-wheat.ai.mit.edu by ELI.CS.YALE.EDU; Fri, 18 Nov 88 11:40:47 EST Full-Name: Received: by shredded-wheat.ai.mit.edu; Fri, 18 Nov 88 11:38:36 EST Date: Fri, 18 Nov 88 11:38:36 EST From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8811181638.AA02521@shredded-wheat.ai.mit.edu> To: kend%tekchips.tek.com@relay.cs.net Cc: adams@tekchips.tek.com@relay.cs.net, t-discussion@YALE.ARPA In-Reply-To: kend@tekchips.crl's message of 17 Nov 88 12:49:10 PST (Thu) <8811172049.AA03584@tekchips.CRL.TEK.COM> Subject: Problems withs T3.1 build on VaxStation I think you don't have the compiler fix file. It turns out that one of the fixed bugs causes the linker to be compiled incorrectly! Here is the fix file ofix5.t to be loaded into the orbit-env (you can compile it): (herald ofix5 (syntax-table (env-syntax-table orbit-env))) ;;; from $BACK_END/closure.t (define (close-analyze-label node heapenv heapvia) (let* ((live (lambda-live node)) (need-contour? (eq? (lambda-env node) 'needs-link)) (b (variable-binder heapvia)) (via (if (or (lambda-live b) (known-lambda? b) (neq? (lambda-strategy b) strategy/heap)) *top-level-lambda* heapvia))) (set (lambda-env node) (create-join-point live via need-contour?)) (walk (lambda (var) (set (variable-definition var) 'many)) live) (close-analyze-body (lambda-body node) '() via '() via))) ;;; from $BACK_END/lookup.t (define (access-value node value) (cond ((and (variable? value) (not (variable-binder value)) (var-is-vcell? value)) (let ((acc (lookup node (get-lvalue value) nil))) (let ((reg (get-register 'pointer node '*))) (generate-move acc reg) (set (reg-node reg) -1) (reg-offset reg 2)))) (else (really-access-value node value)))) ;;; from $BACK_END/parassign.t (define (do-assignment movers node) (iterate loop1 ((movers movers) (targets (map arg-mover-to movers)) (temp nil)) (cond ((null? movers)) (else (iterate loop2 ((candidates targets)) (cond ((null? candidates) (let ((mover (car movers))) (generate-move (arg-mover-to mover) (reg-offset TASK (if (eq? (reg-type (arg-mover-to mover)) 'pointer) task/extra-pointer task/extra-scratch))) (really-rep-convert node (arg-mover-from mover) (arg-mover-from-rep mover) (arg-mover-to mover) (arg-mover-to-rep mover)) (loop1 (cdr movers) (delq (arg-mover-to mover) targets) (arg-mover-to mover)))) ((not (mem? from-reg-eq? (car candidates) movers)) (let ((mover (car (mem to-reg-eq? (car candidates) movers)))) (really-rep-convert node (cond ((eq? (arg-mover-from mover) temp) (if (eq? (reg-type (arg-mover-from mover)) 'pointer) (reg-offset TASK task/extra-pointer) (reg-offset TASK task/extra-scratch))) (else (arg-mover-from mover))) (arg-mover-from-rep mover) (arg-mover-to mover) (arg-mover-to-rep mover)) (loop1 (delq mover movers) (delq (arg-mover-to mover) targets) temp))) (else (loop2 (cdr candidates))))))))) ;;; from $BACK_END/bookkeep.t (define (kill-if-dead node where) (cond ((lambda-node? node) (walk (lambda (var) (if (not (or (memq? var (lambda-live where)) (fx= (variable-number var) 0))) (kill var))) (lambda-live node))) (else (let ((var (leaf-value node))) (cond ((not (variable? var)) (kill var)) (else (let ((var (cond ((variable-known var) => lambda-self-var) (else var)))) (if (not (memq? var (lambda-live where))) (kill var))))))))) ;;; from $FRONT_END/fixup.t send to hunt (define (fix-exit-reference var node value) (let ((proc (call-proc (node-parent node)))) (cond ((eq? node proc) (return)) ((not (primop-node? proc)) (introduce-exit-lambda var node value '#t)) ((eq? primop/y (primop-value proc)) (introduce-exit-lambda var node value '#t)) (else (replace-with-lambda node (primop.values-returned (primop-value (call-proc (node-parent node))))))))) ;;; from $BACK_END/reg.t (define (allocate-location node prim) (let ((c (cont node))) (if (and (lambda-node? c) (let ((refs (variable-refs (car (lambda-variables c))))) (and refs (null? (cdr refs)) (eq? c (node-parent (node-parent (car refs)))) (let ((proc (call-proc (lambda-body c)))) (and (primop-node? proc) (neq? (primop-value proc) primop/make-cell))) (reps-compatable? (primop.rep-wants (leaf-value ((call-arg 2) node))) (variable-rep (car (lambda-variables c))))))) (generate-location-access node) (really-allocate-primop-call node prim)))) (define (introduce-cell var) (let ((node (variable-binder var)) (new-var (create-variable (variable-name var)))) (hack-references var new-var) (let-nodes ((call (($ primop/make-cell) 1 (^ cont1))) (cont1 (() (v new-var)) (($ primop/set-location) 1 (^ cont2) ($ primop/cell-value) (* var) (* new-var))) (cont2 (#f) ())) (cond ((primop-ref? (call-proc (lambda-body node)) primop/remove-state-object) (insert-call call cont2 (car (call-args (lambda-body node))))) (else (insert-call call cont2 node)))))) (define (add-side-effects name) (let* ((def (base-early-binding-env name)) (primop (vref (definition-value def) 0)) (mask (table-entry primop-predicate-table 'primop.side-effects?))) (modify (%primop-bitv primop) (lambda (x) (fixnum-logior x 2))))) (add-side-effects 'receive-values) #| ;Real Fix - change this in DECLARE.T in the front-end: (define-declaration (simplifier name exp) (shape) (cond ((new-env-definition shape name) => (lambda (def) (let* ((clauses `(((primop.simplify self node) (,exp node)) ((primop.side-effects? self) '#t) ((primop.integrate? self node) nil))) (primop (eval (primop-code name '() clauses) orbit-env))) (set (primop.source primop) clauses) (add-new-primop shape primop) (set (definition-value def) (node->vector (create-primop-node primop)))))) (else (missing-declaration-variable-warning name 'simplifier)))) |#  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 23 Nov 88 09:47:58 EST Received: from shredded-wheat.ai.mit.edu ([128.52.36.33]) by ELI.CS.YALE.EDU; Wed, 23 Nov 88 09:34:08 EST Full-Name: Received: by shredded-wheat.ai.mit.edu; Wed, 23 Nov 88 09:33:42 EST Date: Wed, 23 Nov 88 09:33:42 EST From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8811231433.AA05252@shredded-wheat.ai.mit.edu> To: t-users@YALE.ARPA Subject: wilson%uicbert@uxc.cso.uiuc.edu Date: 21 Nov 88 21:27:00 GMT From: uxg.cso.uiuc.edu!uicbert.eecs.uic.edu!wilson@uxc.cso.uiuc.edu Subject: large or long-running T pgms? Message-Id: <82000003@uicbert.eecs.uic.edu> I am trying to figure out how large and varied a body of T programs there is, for the purpose of gathering dynamic statistics. (These statistics would be useful in designing garbage collectors, among other things.) I am particularly looking for programs that are large and/or long-running, especially those that allocate more than about 5 megabytes of data over the course of a run. Real, heavily-used programs are somewhat preferable to throwaway prototypes, but all kinds would be helpful. The point of this is that I may want to implement a special garbage collector, instrumented to gather statistics on survival, locality of reference, and locality of state changes. This empirical data would be useful for designing garbage collectors, among other things. If there is not a large body of *varied* programs, that weighs against T and for a Common Lisp such as Kyoto. Anyway, if you have large programs that you would be willing to send me (hopefully with easy startup instructions), please drop me a note with a short description of what the program does, how long it runs, and (if possible) a guess at how much memory it uses. Thanks prematurely, Paul Paul R. Wilson Human-Computer Interaction Laboratory U. of Illin. at C. EECS Dept. (M/C 154) wilson%uicbert@uxc.cso.uiuc.edu Box 4348 Chicago,IL 60680  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 1 Dec 88 22:37:44 EST Received: from ll-vlsi.arpa by ELI.CS.YALE.EDU; Thu, 1 Dec 88 22:15:08 EST Full-Name: Received: by ll-vlsi.arpa (5.51/3.2.sst.ll) id AA14082; Thu, 1 Dec 88 22:15:26 EST From: James J. Hunt Received: by sonett.vlsi.ll.mit.edu (3.2/SMI-3.2) id AA21102; Thu, 1 Dec 88 22:15:24 EST Date: Thu, 1 Dec 88 22:15:24 EST Message-Id: <8812020315.AA21102@sonett.vlsi.ll.mit.edu> To: T-Discussion@YALE.ARPA Subject: accessing bytev elements I am passing a structure (bytev) to a foreign routine (C). Is there a way to pack and unpack that structure in T for elements of types other than numbers? I would like to write (bref-string ) and (bref-extend ) along with the analogous setters. Another possibility would be conversion functions such as string->rep/string. This latter could be faked with a call to a dummy c routine of one argument that returns that arument and use define foreign to do the conversions, but this doesn't seem to efficient. This is for a T interface to the Berkeley CAD database Oct. Thanks, JJHunt  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 2 Dec 88 10:02:36 EST Received: from shredded-wheat.ai.mit.edu by ELI.CS.YALE.EDU; Fri, 2 Dec 88 09:56:28 EST Full-Name: Received: by shredded-wheat.ai.mit.edu; Fri, 2 Dec 88 09:55:18 EST Date: Fri, 2 Dec 88 09:55:18 EST From: kranz@wheaties.ai.mit.edu (David Kranz) Message-Id: <8812021455.AA10268@shredded-wheat.ai.mit.edu> To: jjh@ll-vlsi.arpa Cc: T-Discussion@YALE.ARPA In-Reply-To: James J. Hunt's message of Thu, 1 Dec 88 22:15:24 EST <8812020315.AA21102@sonett.vlsi.ll.mit.edu> Subject: accessing bytev elements I'm not sure what the problem is. I assume that it will be side-effected by the C routine. Why can't you pass in a string using rep/string? What is bref-extend supposed to do?  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 2 Dec 88 13:32:50 EST Received: from ll-vlsi.arpa by ELI.CS.YALE.EDU; Fri, 2 Dec 88 13:12:58 EST Full-Name: Received: by ll-vlsi.arpa (5.51/3.2.sst.ll) id AA21520; Fri, 2 Dec 88 13:13:12 EST From: James J. Hunt Received: by sonett.vlsi.ll.mit.edu (3.2/SMI-3.2) id AA21654; Fri, 2 Dec 88 13:13:09 EST Date: Fri, 2 Dec 88 13:13:09 EST Message-Id: <8812021813.AA21654@sonett.vlsi.ll.mit.edu> To: kranz@wheaties.ai.mit.edu Cc: T-Discussion@YALE.ARPA In-Reply-To: David Kranz's message of Fri, 2 Dec 88 09:55:18 EST <8812021455.AA10268@shredded-wheat.ai.mit.edu> Subject: accessing bytev elements The problem is I need to pass in a structure, some of whose elements are strings. Bref-extend would be for accessing an element of the structure that is declared (struct *) in C, just as bref-string would be for accessing an element of a structure that is declared (char *). Bref-extend would return another bytev. This could also be used for C arrays. In addition I need a bref-float. I suppose bref-extend should be called bref-bytev. JJHunt  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 19 Jan 89 17:17:58 EST Received: by ATHENA.CS.YALE.EDU; Thu, 19 Jan 89 17:01:06 EST From: James Firby Full-Name: James Firby Message-Id: <8901192201.AA20607@ATHENA.CS.YALE.EDU> Received: by yale-ring (node-ad56/AD56) via WIMP-MAIL (Version 1.3/1.5) ; Thu Jan 19 16:56:22 Date: Thu, 19 Jan 89 16:56:19 EST Subject: Informal talk on Graphics in T To: department@YALE.ARPA, t-discussion@YALE.ARPA Informal talk: THE T GRAPHICS SYSTEM Speaker: Jim Firby Time: Monday, January 23, at 4:00 PM Place: Watson Room 400 The T graphics system integrates 2-D interactive graphics into the T programming language. The basic concept is that of a device independent PICTURE. Pictures are first class T objects that can be created and combined in various ways without regard to the hardware they will (or are) displayed on. Pictures can be assigned EVENT-TABLES that allow them to capture and respond to interactive events whenever they are displayed on an interactive device (like a workstation display). Pictures are connected to displays through WINDOWs which can be interactive workstation windows or files to printed as hardcopy later. The talk will be VERY informal and describe the basic concepts behind the system, its capabilities and its limitations. The purpose of the talk is primarily to introduce the system and encourage its use. I look forward to serious discussion of the released interface. The system currently runs on the Apollos, the Suns and the HPs running X11. Hardcopy can be generated for the Imagens and files can be generated for use in TeX and with DRAW on the Apollos. A demonstration may be possible after the talk. -------  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 22 Jan 89 14:24:30 EST Received: from cmx.npac.syr.edu by ELI.CS.YALE.EDU; Sun, 22 Jan 89 13:40:26 EST Received: by cmx.npac.syr.edu (5.51/2.1-cmx at NPAC) id AA03888; Sun, 22 Jan 89 13:43:19 EST Date: Sun, 22 Jan 89 13:46:56 est From: jbennett@amax.npac.syr.edu (James P. Bennett) Received: by amax.npac.syr.edu (4.12/Northeast-Parallel-Architectures-Center) id AA17673; Sun, 22 Jan 89 13:46:56 est Message-Id: <8901221846.AA17673@amax.npac.syr.edu> To: department@YALE.ARPA, firby-james@YALE.ARPA, t-discussion@YALE.ARPA Subject: Re: Informal talk on Graphics in T I'll miss your talk Monday, since we have a job candidate in and I can't leave Syracuse. If there's a handout or other documentation, I'd appreciate a copy. Will the graphics interface be available thru ftp soon? (We have a new sun LAN in 2 months, pending completion of a building.) Thanks, OCjim  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 25 Jan 89 08:01:25 EST Received: from YALEVM.YCC.YALE.EDU by ELI.CS.YALE.EDU; Wed, 25 Jan 89 07:55:12 EST Full-Name: Received: from UKACRL.BITNET by YALEVM.YCC.YALE.EDU (IBM VM SMTP R1.2) with BSMTP id 0240; Wed, 25 Jan 89 07:55:14 EST Received: from RL.IB by UKACRL.BITNET (Mailer X1.25) with BSMTP id 2999; Wed, 25 Jan 89 12:51:45 GMT Via: UK.AC.DUR.EASBY; 25 JAN 89 12:51:37 GMT From: Martin Ward Date: Wed, 25 Jan 89 12:34:01 GMT Message-Id: <7511.8901251234@easby.durham.ac.uk> To: t-discussion@YALE.ARPA Subject: T documentation. Does anyone have a Scribe to LaTeX (or Tex or Troff or PostScript) convertor which I could use to turn my copy of the T manuals into something I can print and read? Martin. My ARPANET address is: martin%EASBY.DUR.AC.UK@CUNYVM.CUNY.EDU JANET: martin@uk.ac.dur.easby BITNET: martin%dur.easby@ac.uk UUCP: ...!mcvax!ukc!easby!martin  Received: from SH.CS.NET (TCP 30007663403) by MC.LCS.MIT.EDU 25 Jan 89 09:02:11 EST Received: from [128.148.128.55] by SH.CS.NET id aa20883; 25 Jan 89 9:01 EST Received: from cs.brown.edu (doorknob.ARPA) by cs-brunix.brown.edu (1.2/1.00) id AA01899; Wed, 25 Jan 89 08:59:50 est Received: from RELAY.CS.NET by cs.brown.edu (4.1/SMI-4.0) id AA06605; Wed, 25 Jan 89 08:57:49 EST Received: from mc.lcs.mit.edu by RELAY.CS.NET id aa07424; 25 Jan 89 8:52 EST Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 25 Jan 89 08:01:25 EST Received: from YALEVM.YCC.YALE.EDU by ELI.CS.YALE.EDU; Wed, 25 Jan 89 07:55:12 EST Received: from UKACRL.BITNET by YALEVM.YCC.YALE.EDU (IBM VM SMTP R1.2) with BSMTP id 0240; Wed, 25 Jan 89 07:55:14 EST Received: from RL.IB by UKACRL.BITNET (Mailer X1.25) with BSMTP id 2999; Wed, 25 Jan 89 12:51:45 GMT Via: UK.AC.DUR.EASBY; 25 JAN 89 12:51:37 GMT From: Martin Ward Date: Wed, 25 Jan 89 12:34:01 GMT Message-Id: <7511.8901251234@easby.durham.ac.uk> To: t-discussion@yale.arpa Subject: T documentation. Does anyone have a Scribe to LaTeX (or Tex or Troff or PostScript) convertor which I could use to turn my copy of the T manuals into something I can print and read? Martin. My ARPANET address is: martin%EASBY.DUR.AC.UK@CUNYVM.CUNY.EDU JANET: martin@uk.ac.dur.easby BITNET: martin%dur.easby@ac.uk UUCP: ...!mcvax!ukc!easby!martin  Received: from SH.CS.NET (TCP 30007663403) by MC.LCS.MIT.EDU 25 Jan 89 09:50:02 EST Received: from [128.148.128.55] by SH.CS.NET id aa21911; 25 Jan 89 9:49 EST Received: from cs.brown.edu (doorknob.ARPA) by cs-brunix.brown.edu (1.2/1.00) id AA03218; Wed, 25 Jan 89 09:48:02 est Received: from RELAY.CS.NET by cs.brown.edu (4.1/SMI-4.0) id AA07361; Wed, 25 Jan 89 09:46:15 EST Received: from mc.lcs.mit.edu by RELAY.CS.NET id aa07908; 25 Jan 89 9:24 EST Received: from SH.CS.NET (TCP 30007663403) by MC.LCS.MIT.EDU 25 Jan 89 09:02:11 EST Received: from [128.148.128.55] by SH.CS.NET id aa20883; 25 Jan 89 9:01 EST Received: from cs.brown.edu (doorknob.ARPA) by cs-brunix.brown.edu (1.2/1.00) id AA01899; Wed, 25 Jan 89 08:59:50 est Received: from RELAY.CS.NET by cs.brown.edu (4.1/SMI-4.0) id AA06605; Wed, 25 Jan 89 08:57:49 EST Received: from mc.lcs.mit.edu by RELAY.CS.NET id aa07424; 25 Jan 89 8:52 EST Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 25 Jan 89 08:01:25 EST Received: from YALEVM.YCC.YALE.EDU by ELI.CS.YALE.EDU; Wed, 25 Jan 89 07:55:12 EST Received: from UKACRL.BITNET by YALEVM.YCC.YALE.EDU (IBM VM SMTP R1.2) with BSMTP id 0240; Wed, 25 Jan 89 07:55:14 EST Received: from RL.IB by UKACRL.BITNET (Mailer X1.25) with BSMTP id 2999; Wed, 25 Jan 89 12:51:45 GMT Via: UK.AC.DUR.EASBY; 25 JAN 89 12:51:37 GMT From: Martin Ward Date: Wed, 25 Jan 89 12:34:01 GMT Message-Id: <7511.8901251234@easby.durham.ac.uk> To: t-discussion@yale.arpa Subject: T documentation. Does anyone have a Scribe to LaTeX (or Tex or Troff or PostScript) convertor which I could use to turn my copy of the T manuals into something I can print and read? Martin. My ARPANET address is: martin%EASBY.DUR.AC.UK@CUNYVM.CUNY.EDU JANET: martin@uk.ac.dur.easby BITNET: martin%dur.easby@ac.uk UUCP: ...!mcvax!ukc!easby!martin  Received: from SH.CS.NET (TCP 30007663403) by MC.LCS.MIT.EDU 25 Jan 89 11:41:25 EST Received: from [128.148.128.55] by SH.CS.NET id aa24796; 25 Jan 89 11:40 EST Received: from cs.brown.edu (doorknob.ARPA) by cs-brunix.brown.edu (1.2/1.00) id AA03581; Wed, 25 Jan 89 11:11:56 est Received: from RELAY.CS.NET by cs.brown.edu (4.1/SMI-4.0) id AA08579; Wed, 25 Jan 89 11:09:50 EST Received: from mc.lcs.mit.edu by RELAY.CS.NET id aa08787; 25 Jan 89 10:23 EST Received: from SH.CS.NET (TCP 30007663403) by MC.LCS.MIT.EDU 25 Jan 89 09:50:02 EST Received: from [128.148.128.55] by SH.CS.NET id aa21911; 25 Jan 89 9:49 EST Received: from cs.brown.edu (doorknob.ARPA) by cs-brunix.brown.edu (1.2/1.00) id AA03218; Wed, 25 Jan 89 09:48:02 est Received: from RELAY.CS.NET by cs.brown.edu (4.1/SMI-4.0) id AA07361; Wed, 25 Jan 89 09:46:15 EST Received: from mc.lcs.mit.edu by RELAY.CS.NET id aa07908; 25 Jan 89 9:24 EST Received: from SH.CS.NET (TCP 30007663403) by MC.LCS.MIT.EDU 25 Jan 89 09:02:11 EST Received: from [128.148.128.55] by SH.CS.NET id aa20883; 25 Jan 89 9:01 EST Received: from cs.brown.edu (doorknob.ARPA) by cs-brunix.brown.edu (1.2/1.00) id AA01899; Wed, 25 Jan 89 08:59:50 est Received: from RELAY.CS.NET by cs.brown.edu (4.1/SMI-4.0) id AA06605; Wed, 25 Jan 89 08:57:49 EST Received: from mc.lcs.mit.edu by RELAY.CS.NET id aa07424; 25 Jan 89 8:52 EST Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 25 Jan 89 08:01:25 EST Received: from YALEVM.YCC.YALE.EDU by ELI.CS.YALE.EDU; Wed, 25 Jan 89 07:55:12 EST Received: from UKACRL.BITNET by YALEVM.YCC.YALE.EDU (IBM VM SMTP R1.2) with BSMTP id 0240; Wed, 25 Jan 89 07:55:14 EST Received: from RL.IB by UKACRL.BITNET (Mailer X1.25) with BSMTP id 2999; Wed, 25 Jan 89 12:51:45 GMT Via: UK.AC.DUR.EASBY; 25 JAN 89 12:51:37 GMT From: Martin Ward Date: Wed, 25 Jan 89 12:34:01 GMT Message-Id: <7511.8901251234@easby.durham.ac.uk> To: t-discussion@yale.arpa Subject: T documentation. Does anyone have a Scribe to LaTeX (or Tex or Troff or PostScript) convertor which I could use to turn my copy of the T manuals into something I can print and read? Martin. My ARPANET address is: martin%EASBY.DUR.AC.UK@CUNYVM.CUNY.EDU JANET: martin@uk.ac.dur.easby BITNET: martin%dur.easby@ac.uk UUCP: ...!mcvax!ukc!easby!martin  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 1 Feb 89 15:14:15 EST Received: from HOKUSAI.THEORY.CS.CMU.EDU by ELI.CS.YALE.EDU; Wed, 1 Feb 89 14:27:16 EST Received: from Messages.7.2.N.CUILIB.3.45.SNAP.NOT.LINKED.HOKUSAI.THEORY.CS.CMU.EDU.rt.r3 via MS.5.6.HOKUSAI.THEORY.CS.CMU.EDU.rt_r3; Wed, 1 Feb 89 14:18:56 -0500 (EST) Message-Id: Date: Wed, 1 Feb 89 14:18:56 -0500 (EST) From: Derek Beatty To: t-users@YALE.ARPA Subject: define-foreign & C structs I've found the following useful in dealing with C code. Olin Shivers suggested I share it: (herald c-struct) ; C-compatible structures for T. ;;; This file defines one form, (DEFINE-C-STRUCT-TYPE type-id . specs), ;;; which defines a structure object whose underlying data ;;; representation is a bytev suitable for passing to procedures ;;; written in the C language and made accessible via DEFINE-FOREIGN. ;;; Evaluating a DEFINE-C-STRUCT-TYPE form results in the definition ;;; of a constructor function, a type predicate, and settable ;;; component accessor functions. Applying the operation C-REP returns ;;; the underlying bytev, suitable for passing as REP/EXTEND. ;;; For example, the form: (define-c-struct-type writer ;;; (char coal) ;;; (double trouble) ;;; (short life) ;;; (unsigned-short love-letter) ;;; (pointer bird-dog) ;;; (unsigned hate-mail)) ;;; expands to (block (define (make-writer) ;;; (let ((storage (make-bytev 21))) ;;; (object nil ;;; ((c-rep self) storage) ;;; ((writer? self) '#t) ;;; ((print self strm) ;;; (format strm "#{C-struct ~s ~s}" ;;; 'writer (object-hash self))) ;;; (((setter writer-coal) self val) ;;; (set (bref-8 storage 0) val)) ;;; ((writer-coal self) (bref-8 storage 0)) ;;; (((setter writer-trouble) self val) ;;; (set (inaccessable storage 1) val)) ;;; ((writer-trouble self) (inaccessable storage 1)) ;;; (((setter writer-life) self val) ;;; (set (bref-16 storage 9) val)) ;;; ((writer-life self) (bref-16 storage 9)) ;;; (((setter writer-love-letter) self val) ;;; (set (bref-16-u storage 11) val)) ;;; ((writer-love-letter self) (bref-16-u storage 11)) ;;; (((setter writer-bird-dog) self val) ;;; (set (bref-32 storage 13) val)) ;;; ((writer-bird-dog self) (bref-32 storage 13)) ;;; (((setter writer-hate-mail) self val) ;;; (set (bref-32 storage 17) val)) ;;; ((writer-hate-mail self) (bref-32 storage 17))))) ;;; (define-predicate writer?) ;;; (define-settable-operation writer-coal) ;;; (define-settable-operation writer-trouble) ;;; (define-settable-operation writer-life) ;;; (define-settable-operation writer-love-letter) ;;; (define-settable-operation writer-bird-dog) ;;; (define-settable-operation writer-hate-mail)) ;;; Many improvements are possible. First, it might be convenient if more type ;;; information were preserved: for example, a structure field of C type ;;; 'char*' should perhaps be manipulated as a T string, a field of C type ;;; 'char' as a T character, and a field of C type 'double' as a T flonum. ;;; This macro isn't quite as parameterized as I'd like it to be: it should be ;;; trivial to add new T-accessible representations for the underlying C types ;;; as just mentioned. It should allow for 'empty space' in a structure, for C ;;; compilers that pad fields to longword boundaries. There should be a ;;; companion C program to automatically generate the basic C type information. ;;; It should be easy to add new abstract T types corresponding to "abstract" C ;;; types. (Should the c-type-table be accessible to the user?) Finally, ;;; support for C unions is imperative, and support for C embedded structures ;;; is desirable. ;;; -- Derek Beatty 2-December-1988 (let ((c-type-table (make-symbol-table))) (walk (lambda (lst) (set (table-entry c-type-table (car lst)) (cdr lst))) '((char 1 . bref-8) (short 2 . bref-16) (int 4 . bref-32) (long 4 . bref-32) (unsigned 4 . bref-32) (float 4 . bref-32) (double 8 . inaccessable) (short-int 2 . bref-16) (long-int 4 . bref-32) (long-float 8 . inaccessable) (unsigned-char 1 . bref-8-u) (unsigned-short 2 . bref-16-u) (unsigned-int 4 . bref-32) (unsigned-long 4 . bref-32) (unsigned-short-int 2 . bref-16-u) (unsigned-long-int 4 . bref-32) (pointer 4 . bref-32))) (define-syntax (define-c-struct-type type-id . specs) (let ((struct-size (do ((s specs (cdr s)) (i 0 (+ i (let ((te (table-entry c-type-table (caar s)))) (if (not (null? te)) (car te) (error "invalid spec in C-STRUCT form")))))) ((null? s) i)))) `(block (define (,(concatenate-symbol 'make- type-id)) (let ((storage (make-bytev ,struct-size))) (object nil ((c-rep self) storage) ((,(concatenate-symbol type-id '?) self) '#t) ((print self strm) (format strm "#{C-struct ~s ~s}" (quote ,type-id) (object-hash self))) ,@(do ((s specs (cdr s)) (spec-info (table-entry c-type-table (caar specs)) (table-entry c-type-table (caadr s))) (offset 0 (fx+ offset (car spec-info))) (z '() (cons `((,(concatenate-symbol type-id '- (cadar s)) self) (,(cdr spec-info) storage ,offset)) (cons `(((setter ,(concatenate-symbol type-id '- (cadar s))) self val) (set (,(cdr spec-info) storage ,offset) val)) z)))) ((null? s) (reverse! z)))))) (define-predicate ,(concatenate-symbol type-id '?)) ,@(do ((s specs (cdr s)) (z '() (cons `(define-settable-operation ,(concatenate-symbol type-id '- (cadar s))) z))) ((null? s) (reverse! z))))))) (define-operation c-rep) (lset *c-struct-syntax-table* (make-syntax-table (env-syntax-table (repl-env))))  Received: from LCS.MIT.EDU (CHAOS 2420) by MC.LCS.MIT.EDU 1 Feb 89 18:31:37 EST Received: from ELI.CS.YALE.EDU (CS-GW.CS.YALE.EDU) by XX.LCS.MIT.EDU with TCP/SMTP; Wed 1 Feb 89 18:01:04-EST Received: from maui.cs.ucla.edu by ELI.CS.YALE.EDU; Wed, 1 Feb 89 17:29:48 EST Full-Name: Return-Path: Received: by maui.cs.ucla.edu (Sendmail 5.59/2.15) id AA16697; Wed, 1 Feb 89 14:30:57 PST Date: Wed, 1 Feb 89 14:30:57 PST From: dorab@CS.UCLA.EDU (Dorab Patel) Message-Id: <8902012230.AA16697@maui.cs.ucla.edu> To: Derek Beatty , t-users@YALE.ARPA Subject: Re: define-foreign & C structs here is my version of the same thing ---- doesnt support the "print" "cref" and "typename" operations as derek's does, but allows structure components that are arrays. also, appears to do more syntax error checking. enjoy! 'dorab (herald cstruct) ;;; Copyleft (l) 1989, Dorab Patel ;;; make a T (bytev) version of a C structure ;;; typically called as ;;; ;;; (define-cstruct struct-name (c-type component-name opt-array)...) ;;; ;;; for example ... ;;; ;;; (define-cstruct foo (int x) (char y 4) (short z)) ;;; ;;; which defines ;;; ;;; (lset sym (make-foo)) ==> returns a 10 byte bytev ;;; (foo-x sym) ==> accesses the x component (settable) ;;; (foo-y sym i) ==> accesses the i'th element of the y component (settable) ;;; (foo-z sym) ==> accesses the z component (settable) ;;; ;;; ;;; the C types that can be specified are: ;;; ;;; int 30 bits signed ;;; long 30 bits signed ;;; ulong 32 bits unsigned ; supported via local UCLA hack ;;; short 16 bits signed ;;; ushort 16 bits unsigned ;;; char 8 bits signed ;;; uchar 8 bits unsigned (define-syntax (define-cstruct structName . componentList) (labels ( ;; check the type of the argument ((badtype? x) (not (and (pair? x) (let ((y (car x))) (if (pair? y) (let ((l (length y))) (or (fx= l 2) (fx= l 3))) '#f))))) ;; check to see if there is a third value and if ;; the array length seems reasonable ;; returns array length if ok, else 0 ((ArrayLength x) (if (pair? (cddr x)) (let ((y (caddr x))) (if (and (fixnum? y) (fx> y 0)) y 0)) 0)) ;; returns the total length of the structure (bytev) ;; and the list of definitions of the accessors ((makeDefList sName cList) (iterate loop ((componentType (caar cList)) (componentName (cadar cList)) (componentArrayLength (ArrayLength (car cList))) (structSize 0) ; current offset into structure (defList nil) ; definition list so far (componentNames nil) ; list of component names so far (rest (cdr cList))) ; input still to be looked at (receive-values (lambda (componentAccessor componentSize) (let* ((isArray? (not (fixnum-zero? componentArrayLength))) (totalSize (fx+ structSize (if isArray? (fx* componentArrayLength componentSize) componentSize))) (thisComponentDef `(define ,(concatenate-symbol sName '- componentName) (operation (lambda (x ,@(if isArray? '(i) nil)) (,componentAccessor x ,(if isArray? `(fx+ (fx* i ,componentSize) ,structSize) structSize))) ((setter self) (lambda (x ,@(if isArray? '(i) nil) val) (set (,componentAccessor x ,(if isArray? `(fx+ (fx* i ,componentSize) ,structSize) structSize)) val))))))) ;; the order of these cond clauses is IMPORTANT (cond ((mem? equiv? componentName componentNames) (syntax-error "define-cstruct: Multiple components ~a in structure ~a~%" componentName sName)) ((null? rest) (return totalSize (cons thisComponentDef defList))) ((badtype? rest) (syntax-error "define-cstruct: Bad component specification in structure ~a~%" sName)) (else (loop (caar rest) (cadar rest) (ArrayLength (car rest)) totalSize (cons thisComponentDef defList) (cons componentName componentNames) (cdr rest)))))) ;; return componentAccessor and componentSize ;; based on componentType (lambda () (case componentType ((int long) (return 'bref-32 4)) ((ulong) (return 'bref-32-u 4)) ((short) (return 'bref-16-s 2)) ((ushort) (return 'bref-16-u 2)) ((char) (return 'bref-8-s 1)) ((uchar) (return 'bref-8-u 1)) (else (syntax-error "define-cstruct: Unknown type: ~a in structure ~a~%" componentType sName))))))) ) ;; beginning of define-cstruct (cond ((not (atom? structName)) (syntax-error "define-cstruct: Struct name ~a must be atom~%" structName)) ((badtype? componentList) (syntax-error "define-cstruct: Bad component specification in structure ~a~%" structName)) (else (receive-values (lambda (totalLength defList) `(block (define (,(concatenate-symbol 'make- structName)) (make-bytev ,totalLength)) ,@defList)) (lambda () (makeDefList structName componentList)))))))  Received: from LCS.MIT.EDU (CHAOS 2420) by MC.LCS.MIT.EDU 7 Feb 89 19:03:04 EST Received: from ELI.CS.YALE.EDU (CS-GW.CS.YALE.EDU) by XX.LCS.MIT.EDU with TCP/SMTP; Tue 7 Feb 89 12:00:18-EST Received: by ELI.CS.YALE.EDU; Tue, 7 Feb 89 11:15:16 EST Date: Tue, 7 Feb 89 11:15:16 EST From: Bruce Krulwich Full-Name: Bruce Krulwich Message-Id: <8902071615.AA15599@ELI.CS.YALE.EDU> Received: by yale-hp-crown (szechuan) via WIMP-MAIL (Version 1.3/1.5) ; Tue Feb 7 11:17:26 To: t-discussion@YALE.ARPA Subject: Re: define-constant and define-integrable Newsgroups: arpa.t-discussion In-Reply-To: <49864@yale-celray.yale.UUCP> Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Cc: briscoe-duke@YALE.ARPA (Duke Briscoe) Duke Briscoe asks: >I have a question about the effect of the "early binding" forms on >compilation. What do the following two forms do, and how would they >differ in their effects? > >(define-integrable (%%div x y) > (if (and (integer? x) > (integer? y)) > (quotient x y) > (/ x y) )) > >compared to > >(define-constant %%div > (lambda (x y) > (if (and (integer? x) > (integer? y)) > (quotient x y) > (/ x y) ))) Expanding forms similar to these shows the following: > (pp (fully-expand-macro '(define-integrable (foo x) (+ x 5)))) (BLOCK (DECLARE CONSTANT FOO) (DEFINE-VARIABLE-VALUE FOO (NAMED-LAMBDA FOO (X) (+ X 5)))) > (pp (fully-expand-macro '(define-constant foo (lambda (x) (+ x 5))))) (BLOCK (DECLARE CONSTANT FOO) (DEFINE-VARIABLE-VALUE FOO (LAMBDA (X) (+ X 5)))) There seems to be no difference between the two other than the name being given to the LAMBDA in the DEFINE-INTEGRABLE case. In fact, looking at the source (MACROS.T) shows that DEFINE-INTEGRABLE is defined to be the same as DEFINE-CONSTANT, so the only difference in the cases above is from defining a symbol to be a LAMBDA vs. defining a function of arguments to be a body (ie, the second uses NAMED-LAMBDA instead of LAMBDA). Bruce  Received: from LCS.MIT.EDU (CHAOS 2420) by MC.LCS.MIT.EDU 7 Feb 89 19:03:04 EST Received: from ELI.CS.YALE.EDU (CS-GW.CS.YALE.EDU) by XX.LCS.MIT.EDU with TCP/SMTP; Tue 7 Feb 89 12:00:18-EST Received: by ELI.CS.YALE.EDU; Tue, 7 Feb 89 11:15:16 EST Date: Tue, 7 Feb 89 11:15:16 EST From: Bruce Krulwich Full-Name: Bruce Krulwich Message-Id: <8902071615.AA15599@ELI.CS.YALE.EDU> Received: by yale-hp-crown (szechuan) via WIMP-MAIL (Version 1.3/1.5) ; Tue Feb 7 11:17:26 To: t-discussion@YALE.ARPA Subject: Re: define-constant and define-integrable Newsgroups: arpa.t-discussion In-Reply-To: <49864@yale-celray.yale.UUCP> Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Cc: briscoe-duke@YALE.ARPA (Duke Briscoe) Duke Briscoe asks: >I have a question about the effect of the "early binding" forms on >compilation. What do the following two forms do, and how would they >differ in their effects? > >(define-integrable (%%div x y) > (if (and (integer? x) > (integer? y)) > (quotient x y) > (/ x y) )) > >compared to > >(define-constant %%div > (lambda (x y) > (if (and (integer? x) > (integer? y)) > (quotient x y) > (/ x y) ))) Expanding forms similar to these shows the following: > (pp (fully-expand-macro '(define-integrable (foo x) (+ x 5)))) (BLOCK (DECLARE CONSTANT FOO) (DEFINE-VARIABLE-VALUE FOO (NAMED-LAMBDA FOO (X) (+ X 5)))) > (pp (fully-expand-macro '(define-constant foo (lambda (x) (+ x 5))))) (BLOCK (DECLARE CONSTANT FOO) (DEFINE-VARIABLE-VALUE FOO (LAMBDA (X) (+ X 5)))) There seems to be no difference between the two other than the name being given to the LAMBDA in the DEFINE-INTEGRABLE case. In fact, looking at the source (MACROS.T) shows that DEFINE-INTEGRABLE is defined to be the same as DEFINE-CONSTANT, so the only difference in the cases above is from defining a symbol to be a LAMBDA vs. defining a function of arguments to be a body (ie, the second uses NAMED-LAMBDA instead of LAMBDA). Bruce  Received: from LCS.MIT.EDU (CHAOS 2420) by MC.LCS.MIT.EDU 8 Feb 89 20:31:58 EST Received: from ELI.CS.YALE.EDU (CS-GW.CS.YALE.EDU) by XX.LCS.MIT.EDU with TCP/SMTP; Wed 8 Feb 89 16:36:37-EST Received: by ELI.CS.YALE.EDU; Wed, 8 Feb 89 16:17:34 EST From: Bruce Krulwich Full-Name: Bruce Krulwich Message-Id: <8902082117.AA01310@ELI.CS.YALE.EDU> Received: by yale-hp-crown (szechuan) via WIMP-MAIL (Version 1.3/1.5) ; Wed Feb 8 16:19:47 Date: Wed, 8 Feb 89 16:19:43 EST Subject: Expanding macros To: t-discussion@YALE.ARPA It was pointed out to me that my recent T-DISCUSSION message used the procedure FULLY-EXPAND-MACRO without saying what it is. I've given its definition below. It's a brute-force definition without alot of hackery, but it will only really be used at top-level anyway. (lset user-syntax-table (env-syntax-table user-env)) (define (fully-expand-macro orig-exp . syntax-table) (let ((syn-tab (cond (syntax-table => car) (else user-syntax-table))) ) (iterate zowie ((prev-exp orig-exp)) (let ((exp (macro-expand prev-exp syn-tab))) (cond ((neq? exp prev-exp) (zowie exp)) ((not (pair? exp)) exp) ((or (eq? (car exp) 'lambda) (eq? (car exp) (syntax-table-entry syn-tab 'lambda))) (cons* (car exp) (cadr exp) (map (lambda (x) (fully-expand-macro x syn-tab)) (cddr exp)))) ((or (eq? (car exp) 'labels) (eq? (car exp) (syntax-table-entry syn-tab 'labels))) (list (car exp) (map (lambda (spec) (list (car spec) (fully-expand-macro (cadr spec) syn-tab))) (cadr exp)) (fully-expand-macro (caddr exp) syn-tab))) ((pair? exp) (let ((mapped-exp (map (lambda (x) (fully-expand-macro x syn-tab)) exp))) (if (equal? mapped-exp exp) exp (zowie mapped-exp)))) (else exp) ) )))) Enjoy. Bruce Krulwich -------  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 9 Feb 89 16:54:57 EST Received: from acf3.NYU.EDU by ELI.CS.YALE.EDU; Thu, 9 Feb 89 16:01:27 EST Received: by acf3.NYU.EDU (5.54/25-eef) id AA28722; Thu, 9 Feb 89 16:01:07 EST Date: Thu, 9 Feb 89 16:01:07 EST From: Alex Gulyansky Message-Id: <8902092101.AA28722@acf3.NYU.EDU> To: T-Users@YALE.ARPA Subject: Mailing list Would you please add my name to your mailing lists. My electronic address is: GULYANSK@NYU.EDU Thank you very much  Received: from LCS.MIT.EDU (CHAOS 2420) by MC.LCS.MIT.EDU 10 Feb 89 20:23:13 EST Received: from ELI.CS.YALE.EDU (CS-GW.CS.YALE.EDU) by XX.LCS.MIT.EDU with TCP/SMTP; Thu 9 Feb 89 14:33:38-EST Received: from zug.AI.MIT.EDU by ELI.CS.YALE.EDU; Thu, 9 Feb 89 14:25:29 EST Full-Name: Received: by zug.AI.MIT.EDU (/\=-/\ Smail3.1.14.4 #14.13) id ; Thu, 9 Feb 89 14:25 EST Message-Id: Date: Thu, 9 Feb 89 14:25 EST From: jar@zug.AI.MIT.EDU (Jonathan Rees) To: krulwich-bruce@YALE.ARPA Cc: t-discussion@YALE.ARPA In-Reply-To: Bruce Krulwich's message of Wed, 8 Feb 89 16:19:43 EST <8902082117.AA01310@ELI.CS.YALE.EDU> Subject: Expanding macros Reply-To: jar@zurich.ai.mit.edu Allow me sketch out a more robust way to write a macro expander. Among other problems, I note that your FULLY-EXPAND-MACRO won't work with syntax tables, like the Scheme syntax table, in which the standard special form names don't have their standard meanings. (define expand (let ((quote-syntax (syntax-table-entry standard-syntax-table 'quote)) (lambda-syntax (syntax-table-entry standard-syntax-table 'lambda)) (labels-syntax (syntax-table-entry standard-syntax-table 'labels)) (if-syntax (syntax-table-entry standard-syntax-table 'if)) ... Must handle all primitive special forms. These are enumerated in EVAL.T. There aren't very many. ... ) (lambda (exp syntax-table) (iterate recur ((exp exp)) ;is there a RECUR macro? (if (not (pair? exp)) exp (let ((descriptor (cond ((symbol? (car exp)) (syntax-table-entry syntax-table (car exp))) ((syntax-descriptor? (car exp)) (car exp)) (else nil)))) (cond ((not descriptor) ;Combination? (let ((new-exp (map recur exp))) (if (and (symbol? (car new-exp)) (syntax-table-entry standard-syntax-table (car new-exp))) `((block ,(car new-exp)) ,@(cdr new-exp)) new-exp))) ((eq? descriptor quote-syntax) `(quote ,(cadr exp))) ((eq? descriptor lambda-syntax) `(lambda ,(cadr exp) ,@(map recur (cddr exp)))) ((eq? descriptor labels-syntax) `(labels ...)) ((eq? descriptor if-syntax) `(if ,@(map recur (cdr exp)))) ... ((macro-expander? descriptor) (recur (expand-macro-form descriptor exp syntax-table))) (else (error "Unknown special form -- ~S" exp))))))))) Except for error checking, this is the way one should generally write code walkers for T, for the time being. This expander is idempotent in the sense that (expand E ST) and (expand (expand E ST) standard-syntax-table) should give the same result. I think that's about as well as you can do. It's impossible in general to make a full macro expander with the property (expand E ST) is the same as (expand (expand E ST) ST). The expansion code for combinations tries to deal with the case where a program uses the name of a standard T special form or macro as a variable. E.g. the Scheme form (ITERATE X Y) should be treated as a combination, but it would be a use of a macro according to T's standard-syntax-table. If T had a CALL special form (does it?) then it would of course be cleaner to say (CALL ITERATE X Y) than ((BLOCK ITERATE) X Y). For non-pairs, you probably ought to employ the syntax table's atom-expander, but I think that feature might not be released. Look at EVAL.T or Orbit's front end to see what they do. This code-walker is relying on the fact that in T the syntax and variable namespaces are distinct. That may change, especially if the syntactic closures proposal is adopted. I haven't run this code, so it is quite likely to have bugs.  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 17 Feb 89 01:01:14 EST Received: from CENTRO.SOAR.CS.CMU.EDU by ELI.CS.YALE.EDU; Fri, 17 Feb 89 00:49:39 EST Full-Name: Message-Id: <8902170549.AA07082@ELI.CS.YALE.EDU> Date: Fri, 17 Feb 89 00:50:44 EST From: Olin.Shivers@CENTRO.SOAR.CS.CMU.EDU To: Scheme@mc.lcs.mit.edu, t-users@YALE.ARPA Subject: Process modes for gnu emacs --- I have some new process modes for interacting with T and Scheme (and shell, TeX, and Lisp) processes in gnu emacs. A description of these modes is appended to this msg. The package itself is too large to be shipped out with this msg -- the compressed shar file is 50kb. If you would like to try the modes out, you may retrieve the file by anonymous ftp from zurich.ai.mit.edu (18.26.0.176): - log in with user id "anonymous" - Set the transfer type to image or binary (command "binary" or somesuch). - get pub/cmu/cmuproc.shar.Z - leave ftp, uncompress & de-shar the file. MIT CScheme users may prefer to remain with xscheme.el mode. See the discussion about this is the notes below. -Olin ------ Notes follow ------ I have written new gnu-emacs packages that provide shell, inferior lisp, inferior scheme, and inferior T modes. These packages have the following advantages over the standard released gnu packages: - Input history is kept in all modes, traversed with M-p and M-n, just like on LispM's and various fancy shells. - Filename completion and query is available in all modes. - Keybindings are cross-compatible among all modes. - Keybindings are compatible with Zwei and Hemlock. - Directory tracking is more robust in shell mode, and is *only* active in shell mode. (Try entering "cd /" to an inferior lisp in the old package: Lisp barfs, but the inferior lisp mode goes ahead and changes the buffer's directory.) - Non-echoed text entry (for entering passwords) is available in all modes. - Shell and inferior Lisp modes are backwards compatible with the standard gnu modes. - One source for the inferior Lisp mode works in both emacs releases 18.4x and 18.5x. This has been the cause of confusing bugs for users who unwittingly tried to use an 18.4x version inferior Lisp mode in an 18.5x version emacs, and vice-versa. - A full set of eval/compile-region/defun commands for the inferior Lisp, Scheme, and T modes. - New modes are easily created for new types of processes. =============================================================================== THE BAD NEWS: It would be nice if the shell & inferior lisp package, cmushell.el, was completely plug-compatible with the old package in shell.el -- if you could just name the new version shell.el, and have it transparently replace the old one. But you can't. Several other packages (tex-mode, background, dbx, gdb, kermit, monkey, prolog, telnet) are also clients of shell mode. These packages assume detailed knowledge of shell mode internals in ways that are incompatible with the new mode (mostly because of the new mode's greater functionality). So, unless we are willing to port all of these packages, we can't have the new shell package be a complete replacement for shell.el -- that is, we can't name the file shell.el, and its main entry point (shell), because dbx.el will break when it loads it in and tries to use it. There are two ways to fix this. One: rewrite these other modes to use the new package. This is a win, but can't be assumed. The other, backwards compatible route, is to make this package non-conflict with shell.el, so both files can be loaded in at the same time. This is what I have done. So the mode names and major functions have different names, e.g: shell.el cmushell.el -------- ---------- M-x shell M-x cmushell -- Fire up a shell M-x run-lisp M-x cmulisp -- Fire up a lisp shell-mode-map cmushell-mode-map -- Keybindings for [cmu]shell mode All the names have been carefully chosen so that shell.el and cmushell.el won't tromp on each other -- that way dbx.el and friends can happily load in shell.el without breaking the cmushell.el package, and vice versa. With the exception of M-x cmushell and M-x cmulisp, however, most of the name changes are invisible to the user. Further, most of the customising variables that are common in functionality have the same name: inferior-lisp-program, explicit-shell-file-name, et al. Hook variables are different, so you can customise shell-mode and cmushell-mode differently, for instance. By the way, it is rather easy to port the shell.el-dependent packages to use the new stuff. There are fairly complete comments in the relevant source files showing how to do this. Note that this backwards-compatibility hassle *only* affects shell and inferior lisp mode; the other process-in-a-buffer modes (Scheme, T, etc.) do not have this problem. =============================================================================== GENERALIA: The implementation strategy was to factor common process functionality into a general command interpreter mode -- comint mode -- and then to build all the specific modes on top. This provides uniform, integrated functionality and interface across all the derived modes. Comint mode provides the input history, filename completion and query, non-echoed text entry, input editing, and process signalling (e.g., ^z, ^c, ...) commands. *Any* mode built on comint mode gets all this stuff automatically. Additionally, comint mode has general hooks for customising it to specific command interpreters, such as Lisp, Scheme, csh, ML, etc.. This release includes the following files: - comint.el comint mode - cmushell.el cmushell and cmulisp modes, built on comint mode. - cmuscheme.el inferior Scheme mode, built on comint mode. - tea.el inferior T mode, built on comint mode. - tea2.el Variant of tea.el - cmutex.el tex-mode.el with rewritten process interaction code. Some bugs also fixed. These packages have been in daily use by a user community of about 10-20 at CMU since August; most bugs have been shaken out. cmutex.el is less tested. Please notify me of bugs. The files are *extensively* commented; this should serve as sufficient documentation. Each file includes suggestions for your .emacs file in comments at the top. On-line documentation (C-h C-m, C-h C-f, C-h C-v) is available for modes, commands, and variables. This source is available on an FSF-style basis: use it any way you like as long as you don't charge money for it or change the basis of its availability; I assume no liability for its use. =============================================================================== INPUT HISTORY: There are actually two different ways to retrieve old commands for resubmission to a process. The standard way is to use the input history mechanism. An internal list is kept in each process buffer of the last n inputs (default: 30). The commands M-p and M-n move through this list. This is similar in functionality to the input history mechanisms provided by the LispM, Hemlock, and various fancy shells (tcsh, cmucsh, ksh,...). There is also a command, bound to C-c r, which searches backwards through the input history looking for a substring match. RMS doesn't like this mechanism. He has suggested an input history mechanism that operates by searching backwards (and forwards) through the buffer for occurrences of the prompt. The user can then resubmit the input by hitting return. I do not like this mechanism. If the prompt changes dynamically, you can miss a command. False positives are also annoying. The screen jumps around a lot as you scroll through your history. If you run a subprogram that has a null prompt (like dc), prompt search will miss all its inputs. Etc. However, you may try either of these mechanisms, and go with the style you prefer. The RMS-style prompt-search stuff is available on M-N and M-P (meta-shift-n and meta-shift-P); C-c R is bound to a command that searches for specific commands (analogous to C-c r). If you use this stuff, you will probably want to sharpen up the regular expression used to match the prompt in each mode to match your particular prompt -- the default, general regexp used in shell mode generates too many annoying false positives. (It's local variable comint-prompt-regexp -- you should set it in a hook). =============================================================================== MIT CSCHEME, XSCHEME.EL AND CMUSCHEME.EL: MIT Cscheme, when invoked with the -emacs flag, has a special user interface that communicates process state back to the superior emacs by outputting special control sequences. The gnumacs package, xscheme.el, has lots and lots of special purpose code to read these control sequences, and so is very tightly integrated with the cscheme process. The cscheme interrupt handler and debugger read single character commands in cbreak mode; when this happens, xscheme.el switches to special keymaps that bind the single letter command keys to emacs functions that directly send the character to the scheme process. Cmuscheme mode does *not* provide this functionality. If you are a cscheme user, you may prefer to use the xscheme.el/cscheme -emacs interaction. Here's a summary of the pros and cons, as I see them. xscheme: Tightly integrated with inferior cscheme process! A few commands not in cmuscheme. But. Integration is a bit of a hack. Input history only keeps the immediately prior input. Bizarre keybindings. cmuscheme: Not tightly integrated with inferior cscheme process. But. Carefully integrated functionality with the entire suite of comint-derived CMU process modes. Keybindings reminiscent of Zwei and Hemlock. Good input history. A few commands not in xscheme. It's a tradeoff. Pay your money; take your choice. If you use a Scheme that isn't Cscheme, of course, there isn't a choice. Xscheme.el is *very* Cscheme-specific; you must use cmuscheme.el. It would definitely be possible to stick the winning bits of cmuscheme.el into xscheme.el, or vice-versa. The friendly folks at Cscheme Central may be moved to do the former (I haven't discussed it with them). Interested parties are invited to do the latter. I am not a Cscheme user, so I won't be doing it myself. -Olin  Received: from ATHENA.CS.YALE.EDU (TCP 20011000033) by MC.LCS.MIT.EDU 17 Feb 89 12:39:43 EST Received: by ATHENA.CS.YALE.EDU; Fri, 17 Feb 89 10:43:16 EST Date: Fri, 17 Feb 89 10:43:16 EST Full-Name: Christopher Owens Message-Id: <8902171543.AA22443@ATHENA.CS.YALE.EDU> Received: by yale-ring (node-ad81/AD81) via WIMP-MAIL (Version 1.3/1.5) ; Fri Feb 17 10:37:00 To: t-discussion@YALE.ARPA (Newsgroups: arpa.t-discussion) From: Owens-Christopher@YALE.ARPA (Christopher Owens) Subject: Re: Process modes for gnu emacs References: <50943@yale-celray.yale.UUCP> Reply-To: Owens-Christopher@YALE.ARPA (Christopher Owens) In-Reply-To: Olin.Shivers@centro.soar.cs.cmu.edu Organization: Computer Science, Yale University, New Haven, CT 06520-2158 These files are available on the ring in /usr/yale/lib/emacs/local/cmushell.el, tea.el, comint.el, cmutex.el and cmushell.doc They are also availble (same file names) on athena in ~owens/emacs /c  Received: from ELI.CS.YALE.EDU (TCP 30006454001) by MC.LCS.MIT.EDU 17 Feb 89 20:06:24 EST Received: by ELI.CS.YALE.EDU; Fri, 17 Feb 89 19:43:51 EST Date: Fri, 17 Feb 89 19:43:51 EST Full-Name: Christopher Owens Message-Id: <8902180043.AA01052@ELI.CS.YALE.EDU> Received: by yale-ring (node-ad81/AD81) via WIMP-MAIL (Version 1.3/1.5) ; Fri Feb 17 19:41:15 To: t-discussion@YALE.ARPA (Newsgroups: arpa.t-discussion) From: Owens-Christopher@YALE.ARPA (Christopher Owens) Subject: Re: Process modes for gnu emacs References: <50964@yale-celray.yale.UUCP> Reply-To: Owens-Christopher@YALE.ARPA (Christopher Owens) In-Reply-To: owens-christopher@yale.UUCP Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Sorry about the previous message -- that was meant to be Yale internal; those machines are not available to outside FTP.