Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!usc!rutgers!rochester!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: Vocabularies Message-ID: <1642.UUL1.3#5129@willett.pgh.pa.us> Date: 30 Aug 90 03:01:39 GMT Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 85 Category 18, Topic 92 Message 43 Wed Aug 29, 1990 R.BERKEY [Robert] at 06:00 PDT Subject: Custom Compilers Dennis Ruffer writes: > Re: ir230@sdcc6.ucsd.edu (john wavrik) > > What I was after is whether the proposed Standard has general > > portable mechanisms for controlling compilation -- which can be > > used to define control structures, for example. > > Again, I say, YES IT DOES! If the previous example where you > got at least two acceptable solutions did not convince you, then > PLEASE, hit us with another one. I, for one, would be glad to > take a wack at solving another puzzle. Perhaps my posting on Monday wasn't clear enough: > Category 3, Topic 45 > Message 2 Mon Aug 27, 1990 > R.BERKEY [Robert] at 21:39 PDT > > > > This is to be used in the form IF( c1 e1 ... ck ek )IF > > The solutions given to this problem depend on the source code being on one > line. Let's pretty print it: > > This is to be used in the form: > > IF( > c1 e1 > ... > ck ek > )IF > > Now what? The point is that the solutions offered are only valid if the source code is on one line, such as the specific formulation proposed as the problem. Note that John Wavrik's original requirement included more than one line of source code: > From: ir230@sdcc6.ucsd.edu (john wavrik) > Newsgroups: comp.lang.forth > Subject: Domain of Forth > Keywords: algorithms permutations Baden > Message-ID: <12353@sdcc6.ucsd.edu> > Date: 21 Aug 90 05:00:06 GMT > Organization: University of California, San Diego > The state of the system is given by the position (0 < pos <= 2n) > within the cycle. The position must be maintained for each n. Here > is the code for the required function: > > : Perm ( n -- t ) DUP 2 = \ terminal condition > IF DROP 1 > ELSE DUP Next-Pos ( n pos ) > If( =n? p(n-1) > <2n? Descending > true p(n-1)+1 )If > THEN ; > > Where, of course, we must explain the meaning of a few words 8-) So, no. None of the posted solutions work. At least to the problem for which a solution was sought. Another closely related issue is whether comments are to be allowed within the range of the custom compiler. Robert ----- This message came from GEnie via willett through a semi-automated process. Report problems to: uunet!willett!dwp or dwp@willett.pgh.pa.us