Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Helmar Wodtke Newsgroups: comp.lang.forth Subject: Re: How about helping optimization in language? Date: Tue, 27 Mar 2012 11:29:51 -0700 (PDT) Organization: http://groups.google.com Lines: 48 Message-ID: <9650506.536.1332872991736.JavaMail.geo-discussion-forums@vblo18> References: <30126800.1344.1332858395156.JavaMail.geo-discussion-forums@ynnk21> <582295.182.1332861133595.JavaMail.geo-discussion-forums@ynko6> <8543639.1665.1332866775484.JavaMail.geo-discussion-forums@vbyj26> NNTP-Posting-Host: 62.158.126.42 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1332872993 17266 127.0.0.1 (27 Mar 2012 18:29:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 27 Mar 2012 18:29:53 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=62.158.126.42; posting-account=nibe3QoAAADcYL8fC0WC6vCas4By1Xgn User-Agent: G2/1.0 X-Received-Bytes: 3337 Xref: csiph.com comp.lang.forth:10602 Am Dienstag, 27. M=E4rz 2012 19:27:48 UTC+2 schrieb Andrew Haley: > Helmar Wodtke wrote: > > Am Dienstag, 27. M?rz 2012 18:34:56 UTC+2 schrieb Andrew Haley: > >> Helmar Wodtke wrote: > >> > Am Dienstag, 27. M?rz 2012 16:32:50 UTC+2 schrieb Andrew Haley: > >> >> Helmar Wodtke wrote: > >> >> >=20 > >> >> > ">R" (especially in ANS terms) means to bring something to a seco= nd > >> >> > "stack". "R>" to bring it back. This could be virtually something > >> >> > like a register at the machine you have. > >> >> >=20 > >> >> > Why not implement this more elaborate about what ">R" means? I kn= ow > >> >> > CS-ROLL etc. - it should not be this weird. How about defining "= >R" > >> >> > has nothing to do with return stack but it could affect it? > >> >>=20 > >> >> That is how >R is defined, and has been since '94. Have a look. > >> >=20 > >> > yes I know. But how about looking at real world challenges people > >> > get here in C.L.F. and are not able to solve?=20 > >>=20 > >> It's hard to do that without a specific example. > >=20 > > The basic question was: how to find two of three values on stack > > that are bigger than the smallest one. > >=20 > > ( a b c -- d e -- d, e are the maximums values of a b c) > > : 2of3 2dup max >r min max r> ; > >=20 > > This would be my "thumb simplification" of the thing. >=20 > That is a very pretty solution. The sequence "max >r min" is not really pretty. It is nice - but it depends= on implementation of the Forth system if this is a good solution. This is = about what I was talking about >R and R> - a lot depends on interpretation = of the system. If the system has a register left, why should >R be a stack = in this small thing? It could go to the register as long as I keep it stabl= e ;) Well, some flow control words would disturb the optimizations probably= . Regards, -Helmar > Andrew.