Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!dsl.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: ANS TC Magnet for Cont. Ref. Set Message-ID: <1593.UUL1.3#5129@willett.pgh.pa.us> Date: 24 Aug 90 03:44:34 GMT Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 114 Category 18, Topic 85 Message 33 Thu Aug 23, 1990 D.RUFFER [Dennis] at 16:08 EDT Re: ir230@sdcc6.ucsd.edu (john wavrik) > Suggestion: The ANSI team make available a packet consisting of > the printed BASIS document and a diskette with the document in > machine-readible form (preferably including a plain ASCII text > glossary file). THIS SHOULD BE AVAILABLE IN A TIMELY FASHION SO > THAT USERS HAVE AMPLE TIME TO PREPARE SUBMISSIONS TO THE ANSI > TEAM. I will pass your suggestion along John, but the problems with ASCII represenations of the BASIS document have been discussed at length. Refer to my posting from Elizabeth Rather to Mark Carroll on that subject. As far as the timeliness of the document, we are doing as good as possible. Remember that every 3 months a meeting is held that drastically changes the document. A volunteer editor must then sit down and make some sense out of the stack of 100 some proposals and apply those changes. Then the document is reviewed and made ready for printing. Then and only then is it posted electronically. Depending on the volunteer, this may take a few weeks or a few months. This time was especially difficult since the editor had to buy a computer and learn Word. We just made the 2 week mailing. Hopefully we will do better in the future, but be assured that everything is being done that can be done. II. Deferred Execution > Will the proposed ANSI standard have a portable mechanism for > deferred execution (like the F83 words DEFER and IS) As far as I can tell, you can still define them as follows: : UNINIT ." Not vectored " ; : DEFER CREATE ['] UNINIT , DOES> PERFORM ; : IS ( w -- P: Compile or change defered vector ) ' >BODY STATE @ IF LITERAL POSTPONE ! ELSE ! THEN ; IMMEDIATE Although this is not the way F83 defined them, I believe it is equivalent since BASIS has no definition for USER variables. III. Recursion and return stack size > When implementing a recursive algorithm it often becomes necessary > to increase the size of the return stack. Will there be a portable > way to do this? I would be hard pressed to alter the size of either stack in most Forths without recompiling their nucleus' so I wouldn't expect that to be portable. However, in ANS Forth, I can at least determine how big the return stack is so that I can write an application that can tell if it can run. I think I could use a word such as: : CHECK-SIZE ( n -- P: Check return stack depth ) " RETURN-STACK-CELLS" ENVIRONMENT? NOT IF 24 THEN > ABORT" Return stack is not big enough" ; > Along the same lines: will there be words analogous to RP0, SP0, > RP@, SP@? With multiple segment architectures, I wouldn't know what addresses any of these operators would refer to. If all you are interested is emptying the stacks, then ABORT clears the parameter stack and calls QUIT which clears the return stack. Otherwise, only the DEPTH of the parameter stack can be interrogated. I can see uses for these operators in defining ways to dump the stack contents, but I've never had a need for them in application words. I wouldn't consider debugging aids to be very portable. Can you cite a specific application need for these words? IV. Language Constructs > My impression is that the proposed ANSI Standards will not > provide a portable means for accessing the IP (and that code > which involves handlers cannot be portable). Is this correct? This is my impression also. However, I might take a crack at your example as follows: : )IF ; : IF( 0 >R \ count the number of IFs used BEGIN >IN @ ' ['] )IF = NOT WHILE >IN ! POSTPONE POSTPONE POSTPONE IF POSTPONE POSTPONE POSTPONE ELSE R> 1+ >R REPEAT DROP R> 0 DO POSTPONE THEN LOOP ; IMMEDIATE Wouldn't that accomplish your same objectives? Other than being more careful about how you write applications, I think most of what you can do now is possible with ANS Forth. Some thought may have to go into ways to make things portable, but the point is that it is possible. V. Power of Proposed Standard > Is the ANSI team willing to provide clarification, at this point, > as to whether or not a purpose of the proposed Standard is to > allow users to write significant programs portably? I think this depends on what you mean by a "significant program". The standard does not address user interface techniques that I would want to use in an application, but I could scale the application back so that it uses a simple TTY interface and still remain portable. Basically, if I want to make my application portable, I will have to work harder when designing the application so that I am sure to use only standard words. Although I do not think your question can be answered generically, I do believe that portable solutions can be found for most specific needs. By continuing to ask specific questions, we can determine how well the ANS Standard can be used to solve the problems. Thanks for the excersises. DaR ----- This message came from GEnie via willett through a semi-automated process. Report problems to: uunet!willett!dwp or dwp@willett.pgh.pa.us