Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #41960
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: ? operator in Forth |
| Date | 2015-09-11 16:54 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2015Sep11.185427@mips.complang.tuwien.ac.at> (permalink) |
| References | <1f86d832-a0bd-4d35-9587-0b81afe11035@googlegroups.com> <55f305a4$0$23791$e4fe514c@news.xs4all.nl> |
Hans Bezemer <the.beez.speaks@gmail.com> writes:
>Mark Wills wrote:
>
>The Factor way:
>: NO! ." no" ; ok
>: YES! ." yes" ; ok
>: ?? 0= if swap then drop execute ;
>
>' YES! ' NO! true ?? yes ok
>' YES! ' NO! false ?? no ok
>
>Add [: and ;] and you're C - in an RPN kind of syntax, of course.
No, you are Postscript (or, as originally written, Factor):
GS>true {(yes) =} {(no) =} ifelse
yes
GS>false {(yes) =} {(no) =} ifelse
no
The Postscript stack effect is better, BTW.
- 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.rigwit.co.uk/EuroForth2015/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
? operator in Forth Mark Wills <markwills1970@gmail.com> - 2015-09-10 13:55 -0700
Re: ? operator in Forth Mark Wills <markwills1970@gmail.com> - 2015-09-10 14:16 -0700
Re: ? operator in Forth "Elizabeth D. Rather" <erather@forth.com> - 2015-09-10 11:58 -1000
Re: ? operator in Forth "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-09-11 01:30 -0400
Re: ? operator in Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-11 06:17 +0000
Re: ? operator in Forth julian.fondren@endurance.com - 2015-09-10 21:00 -0700
Re: ? operator in Forth hughaguilar96@gmail.com - 2015-09-10 21:20 -0700
Re: ? operator in Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-11 05:16 +0000
Re: ? operator in Forth humptydumpty <ouatubi@gmail.com> - 2015-09-12 01:11 -0700
Re: ? operator in Forth hughaguilar96@gmail.com - 2015-09-12 17:14 -0700
Re: ? operator in Forth humptydumpty <ouatubi@gmail.com> - 2015-09-13 02:18 -0700
Re: ? operator in Forth hughaguilar96@gmail.com - 2015-09-10 15:21 -0700
Re: ? operator in Forth "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-09-11 01:35 -0400
Re: ? operator in Forth humptydumpty <ouatubi@gmail.com> - 2015-09-10 22:58 -0700
Re: ? operator in Forth Hans Bezemer <the.beez.speaks@gmail.com> - 2015-09-11 18:48 +0200
Re: ? operator in Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-11 16:54 +0000
Re: ? operator in Forth hughaguilar96@gmail.com - 2015-09-11 21:32 -0700
Re: ? operator in Forth "WJ" <w_a_x_man@yahoo.com> - 2015-09-14 18:13 +0000
Re: ? operator in Forth "WJ" <w_a_x_man@yahoo.com> - 2015-09-14 18:32 +0000
Re: ? operator in Forth hughaguilar96@gmail.com - 2015-09-14 14:40 -0700
csiph-web