Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #39500
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: ColorForth - another dead end? |
| Date | 2015-06-01 13:21 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2015Jun1.152134@mips.complang.tuwien.ac.at> (permalink) |
| References | (5 earlier) <mkbs7o$4g9$1@dont-email.me> <7b109f06-c5ad-413c-a9f2-85e7f3b34da4@googlegroups.com> <mkbvcb$en0$1@dont-email.me> <ebfc8bdf-0f90-49b7-8469-b52bcae527e3@googlegroups.com> <77c3499b-2f89-41ec-b477-f529b7c2345b@googlegroups.com> |
humptydumpty <ouatubi@gmail.com> writes:
>: field ( offs size -- offs+size )
> over >R
> : R> ?dup
> IF
> S>D <# [CHAR] + hold BL hold #S #>
> postpone SLITERAL postpone EVALUATE
> THEN
> postpone ; IMMEDIATE +
>;
A very nice example of the dangers of EVALUATE-based macros.
decimal
9 cells 1 cells field x drop
hex 0 x 9 cells = .
prints 0. The following implementation is both correct and simpler
(and optimizes the 0 offset case):
: +FIELD {: n1 n2 -- n3 :}
: n1 if
n1 postpone literal postpone +
else
immediate
then
postpone ; n1 n2 + ;
- 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
ColorForth - another dead end? borota@gmail.com - 2015-05-24 12:22 -0700
Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-24 14:00 -0700
Re: ColorForth - another dead end? borota@gmail.com - 2015-05-24 16:18 -0700
Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-24 16:45 -0700
Re: ColorForth - another dead end? "Elizabeth D. Rather" <erather@forth.com> - 2015-05-24 14:50 -1000
Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-24 18:12 -0700
Re: ColorForth - another dead end? onewhohopes@gmail.com - 2015-05-28 13:00 -0700
Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-28 18:55 -0700
Re: ColorForth - another dead end? Howerd <howerdo@yahoo.co.uk> - 2015-05-29 00:49 -0700
Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-29 07:56 -0700
Re: ColorForth - another dead end? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-05-29 15:04 +0000
Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-29 10:03 -0700
Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-29 10:15 -0700
Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-29 19:28 -0700
Re: ColorForth - another dead end? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-05-30 12:34 +0000
Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-29 19:19 -0700
Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-29 22:30 -0700
Re: ColorForth - another dead end? "Rod Pemberton" <fork@lllljunkqwer.cpm> - 2015-05-30 00:14 -0400
Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-29 22:22 -0700
Re: ColorForth - another dead end? "Alex McDonald" <blog@rivadpm.com> - 2015-05-30 09:27 +0100
Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-30 02:05 -0700
Re: ColorForth - another dead end? "Alex McDonald" <blog@rivadpm.com> - 2015-05-30 10:21 +0100
Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-30 04:08 -0700
Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-30 07:43 -0700
Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-30 09:42 -0700
Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-30 10:25 -0700
Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-30 22:36 -0700
Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-31 16:38 -0700
Re: ColorForth - another dead end? "Alex McDonald" <blog@rivadpm.com> - 2015-05-31 09:11 +0100
Re: ColorForth - another dead end? humptydumpty <ouatubi@gmail.com> - 2015-05-31 11:31 -0700
Re: ColorForth - another dead end? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-06-01 13:21 +0000
Re: ColorForth - another dead end? humptydumpty <ouatubi@gmail.com> - 2015-06-01 08:18 -0700
Re: ColorForth - another dead end? humptydumpty <ouatubi@gmail.com> - 2015-06-01 09:07 -0700
Re: ColorForth - another dead end? humptydumpty <ouatubi@gmail.com> - 2015-06-01 23:31 -0700
Field name overloading (was: ColorForth - another dead end?) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-06-02 09:47 +0000
Re: Field name overloading (was: ColorForth - another dead end?) humptydumpty <ouatubi@gmail.com> - 2015-06-02 13:07 -0700
Re: ColorForth - another dead end? humptydumpty <ouatubi@gmail.com> - 2015-06-01 08:20 -0700
Re: ColorForth - another dead end? "Rod Pemberton" <fork@lllljunkqwer.cpm> - 2015-05-30 15:34 -0400
Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-29 22:55 -0700
Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-30 00:54 -0700
Re: ColorForth - another dead end? stephen@mpeforth.com (Stephen Pelc) - 2015-05-30 17:20 +0000
Re: ColorForth - another dead end? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-05-31 15:17 +0000
Re: ColorForth - another dead end? Hannu Vuolasaho <vuokkosetae@gmail.com> - 2015-05-25 10:06 +0300
Re: ColorForth - another dead end? Jason Damisch <jasondamisch@yahoo.com> - 2015-05-25 11:11 -0700
Re: ColorForth - another dead end? rickman <gnuarm@gmail.com> - 2015-05-25 14:22 -0400
Re: ColorForth - another dead end? "Elizabeth D. Rather" <erather@forth.com> - 2015-05-25 14:57 -1000
Re: ColorForth - another dead end? borota@gmail.com - 2015-05-25 20:42 -0700
Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-29 19:46 -0700
Re: ColorForth - another dead end? "Rod Pemberton" <fork@lllljunkqwer.cpm> - 2015-05-30 00:03 -0400
Re: ColorForth - another dead end? Howerd <howerdo@yahoo.co.uk> - 2015-05-24 21:51 -0700
Re: ColorForth - another dead end? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-05-25 11:17 +0000
Re: ColorForth - another dead end? Mark Wills <markwills1970@gmail.com> - 2015-05-25 01:50 -0700
Re: ColorForth - another dead end? Howerd <howerdo@yahoo.co.uk> - 2015-05-25 02:11 -0700
Re: ColorForth - another dead end? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-05-25 14:11 +0000
csiph-web