Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #40482
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: What is wrong with U.? (SwiftForth) |
| Date | 2015-07-10 07:55 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2015Jul10.095529@mips.complang.tuwien.ac.at> (permalink) |
| References | (4 earlier) <a338e4fc-298b-4122-81d5-8f6fb25b637e@googlegroups.com> <2015Jul9.191321@mips.complang.tuwien.ac.at> <b7108221-ecea-47b0-b87e-f2977a2f3b2a@googlegroups.com> <2015Jul10.075133@mips.complang.tuwien.ac.at> <cdd6c750-8b98-4cbb-8c30-80bb4625b581@googlegroups.com> |
franck.bensusan@gmail.com writes:
>Le vendredi 10 juillet 2015 07:54:15 UTC+2, Anton Ertl a =E9crit=A0:
>> franck.bensusan@gmail.com writes:
>> >Le jeudi 9 juillet 2015 19:22:33 UTC+2, Anton Ertl a =3DE9crit=3DA0:
>> >> franck.bensusan@gmail.com writes:
>> >> >Le jeudi 9 juillet 2015 16:34:11 UTC+2, Anton Ertl a =3D3DE9crit=3D3D=
>> >> Please demonstrate this, by rewriting this word to use your FB-CATCH
>> >> instead of CATCH:
>> >>=3D20
>> >> : collect1 ( -- ior )
>> >> ['] collect-garbage catch ;
>> >>=3D20
...
>Not tested, just the idea :
>
>: catch-save-sp ( -- ; R: -- x )
> @sp >r ;
>
>: catch-rest-sp ( ior -- ior; R: x -- )
> dup 0=3D IF=20
> r> drop=20
> ELSE=20
> r> swap >r sp! r>=20
> THEN ;
>
>:collect1 ( -- ios )
> catch-save-sp ['] collect-garbage fbcatch catch-rest-sp ;
Thank you. I think that's already too cumbersome, but you would have
to cope with the following additional problems:
1) You cannot use the return stack for passing data from one colon
definition to another colon definition as you try to do.
2) SP@ and SP! are not standard words.
It would, however, be not particularly difficult to have a word like
FBCATCH in a Forth system (e.g., as factor of CATCH), and let the
normal THROW work with it as you suggest. I am not aware that any
system provides this (IIRC such a word has not come up in discussions
here), so it seems that system implementors don't share your idea of
the value of such a word, nor their users, who would ask the system
implementor for such a feature if they thought it valuable.
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2015: http://www.mpeforth.com/euroforth2015/euroforth2015.htm
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What is wrong with U.? (SwiftForth) Gerard Sontag <gerardsontag@gmail.com> - 2015-07-08 05:22 -0700
Re: What is wrong with U.? (SwiftForth) Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-08 05:49 -0700
Re: What is wrong with U.? (SwiftForth) coos <chforth@hccnet.nl> - 2015-07-08 14:57 +0200
Re: What is wrong with U.? (SwiftForth) Gerard Sontag <gerardsontag@gmail.com> - 2015-07-08 06:20 -0700
Re: What is wrong with U.? (SwiftForth) "Elizabeth D. Rather" <erather@forth.com> - 2015-07-08 09:00 -1000
Re: What is wrong with U.? (SwiftForth) jfong@ms4.hinet.net - 2015-07-08 17:37 -0700
Re: What is wrong with U.? (SwiftForth) foxaudioresearch@gmail.com - 2015-07-08 18:01 -0700
Re: What is wrong with U.? (SwiftForth) "Elizabeth D. Rather" <erather@forth.com> - 2015-07-08 15:56 -1000
Re: What is wrong with U.? (SwiftForth) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-09 05:12 +0000
Re: What is wrong with U.? (SwiftForth) djc <ciesinger@gmx.net> - 2015-07-09 00:52 -0700
Re: What is wrong with U.? (SwiftForth) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-09 08:54 +0000
Re: What is wrong with U.? (SwiftForth) franck.bensusan@gmail.com - 2015-07-09 03:50 -0700
Re: What is wrong with U.? (SwiftForth) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-09 13:52 +0000
Re: What is wrong with U.? (SwiftForth) franck.bensusan@gmail.com - 2015-07-09 09:20 -0700
Re: What is wrong with U.? (SwiftForth) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-09 17:13 +0000
Re: What is wrong with U.? (SwiftForth) franck.bensusan@gmail.com - 2015-07-09 10:45 -0700
Re: What is wrong with U.? (SwiftForth) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-10 05:51 +0000
Re: What is wrong with U.? (SwiftForth) franck.bensusan@gmail.com - 2015-07-09 23:11 -0700
Re: What is wrong with U.? (SwiftForth) Mark Wills <markwills1970@gmail.com> - 2015-07-10 01:09 -0700
Re: What is wrong with U.? (SwiftForth) franck.bensusan@gmail.com - 2015-07-10 01:20 -0700
Re: What is wrong with U.? (SwiftForth) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-10 07:55 +0000
Re: What is wrong with U.? (SwiftForth) franck.bensusan@gmail.com - 2015-07-10 01:53 -0700
Re: What is wrong with U.? (SwiftForth) "Elizabeth D. Rather" <erather@forth.com> - 2015-07-10 07:53 -1000
Re: What is wrong with U.? (SwiftForth) franck.bensusan@gmail.com - 2015-07-11 02:08 -0700
Re: What is wrong with U.? (SwiftForth) Mark Wills <markwills1970@gmail.com> - 2015-07-11 02:32 -0700
Re: What is wrong with U.? (SwiftForth) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-11 15:06 +0000
Re: What is wrong with U.? (SwiftForth) "Elizabeth D. Rather" <erather@forth.com> - 2015-07-09 08:22 -1000
Re: What is wrong with U.? (SwiftForth) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-10 05:55 +0000
Re: What is wrong with U.? (SwiftForth) "HAA" <someone@microsoft.com> - 2015-07-09 20:12 +1000
Re: What is wrong with U.? (SwiftForth) coos <chforth@hccnet.nl> - 2015-07-09 15:34 +0200
Re: What is wrong with U.? (SwiftForth) Ron Aaron <rambamist@gmail.com> - 2015-07-10 14:16 +0300
Re: What is wrong with U.? (SwiftForth) rickman <gnuarm@gmail.com> - 2015-07-10 02:20 -0400
csiph-web