Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #16855 > unrolled thread
| Started by | Mark Wills <forthfreak@gmail.com> |
|---|---|
| First post | 2012-10-31 04:58 -0700 |
| Last post | 2012-11-02 13:13 -0400 |
| Articles | 20 on this page of 169 — 25 participants |
Back to article view | Back to comp.lang.forth
Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 04:58 -0700
Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-10-31 05:22 -0700
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 05:44 -0700
Re: Is there a better way? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-10-31 11:29 -0400
Re: Is there a better way? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-10-31 11:40 -0400
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 08:45 -0700
Re: Is there a better way? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-02 04:48 -0400
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-10-31 21:42 -0400
Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-01 19:19 -0700
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 13:06 -0400
Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-02 12:18 -0500
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 14:34 -0400
Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-02 11:39 -0700
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 14:43 -0400
Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-04 02:36 -0600
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-04 14:18 -0500
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-02 14:38 -0700
Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-04 03:01 -0600
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-04 03:54 -0800
Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-04 07:59 -0600
Re: Is there a better way? Elizabeth D Rather <erather@forth.com> - 2012-11-04 08:34 -1000
Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-04 15:22 -0800
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-05 02:39 -0800
Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-05 14:01 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-05 10:39 -1000
Re: Words consuming arguments, was [Re: Is there a better way?] Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-05 21:07 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-06 20:57 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-06 21:43 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-07 03:52 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-07 19:55 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-07 20:46 -1000
Re: Words consuming arguments, was [Re: Is there a better way?] stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-08 10:39 +0000
Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-12 03:48 -0600
Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-12 07:57 -1000
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-12 19:50 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-12 19:49 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-12 15:00 -1000
Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-13 00:50 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-13 00:58 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-12 23:17 -1000
Re: Words consuming arguments, was [Re: Is there a better way?] albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-13 13:44 +0000
Re: Words consuming arguments, was [Re: Is there a better way?] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-13 13:53 +0000
Re: Words consuming arguments, was [Re: Is there a better way?] Alex McDonald <blog@rivadpm.com> - 2012-11-13 06:39 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-13 18:02 +0000
Re: Words consuming arguments, was [Re: Is there a better way?] Alex McDonald <blog@rivadpm.com> - 2012-11-13 12:10 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-15 16:59 +0000
Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-13 07:55 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-14 06:34 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-14 05:01 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-14 16:11 +0000
Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-14 09:36 -1000
Re: Words consuming arguments, was [Re: Is there a better way?] humptydumpty <ouatubi@gmail.com> - 2012-11-14 12:19 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-13 10:20 -0600
Re: Words consuming arguments, was [Re: Is there a better way?] Brad Eckert <hwfwguy@gmail.com> - 2012-11-13 08:50 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-14 06:42 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-14 14:14 +0000
Re: Words consuming arguments, was [Re: Is there a better way?] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-14 15:28 +0000
Re: Words consuming arguments, was [Re: Is there a better way?] Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-14 17:54 +0100
Re: Words consuming arguments, was [Re: Is there a better way?] Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-14 15:01 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-15 00:08 -0800
Strings (was: Words consuming arguments) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-15 15:18 +0000
Re: Strings (was: Words consuming arguments) albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-15 16:36 +0000
Re: Strings (was: Words consuming arguments) "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-15 18:35 -0500
Re: Strings (was: Words consuming arguments) stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-16 00:36 +0000
Re: Strings (was: Words consuming arguments) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-16 17:42 +0000
Re: Strings (was: Words consuming arguments) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-16 17:55 +0000
Re: Words consuming arguments, was [Re: Is there a better way?] Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-17 04:18 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] Alex McDonald <blog@rivadpm.com> - 2012-11-17 04:56 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-17 07:24 -1000
Re: Words consuming arguments, was [Re: Is there a better way?] Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-19 15:58 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] Brad Eckert <hwfwguy@gmail.com> - 2012-11-20 08:17 -0800
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-14 06:30 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-14 09:06 -1000
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-15 06:18 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-13 04:26 -0600
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-14 06:29 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-14 06:03 -0600
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-15 07:15 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-15 11:51 -0600
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-15 18:44 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-16 03:50 -0600
Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-15 08:09 -1000
Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-06 21:19 -1000
Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-07 20:00 -0500
Re: Words consuming arguments, was [Re: Is there a better way?] stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-08 10:49 +0000
Re: Words consuming arguments, was [Re: Is there a better way?] albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-07 14:01 +0000
Re: Is there a better way? awegel@arcor.de (Alex Wegel) - 2012-11-04 11:07 +0100
Re: Is there a better way? awegel@arcor.de (Alex Wegel) - 2012-11-04 11:36 +0100
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-04 03:48 -0800
Re: Is there a better way? awegel@arcor.de (Alex Wegel) - 2012-11-04 13:31 +0100
Re: Is there a better way? Coos Haak <chforth@hccnet.nl> - 2012-11-04 13:29 +0100
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-04 04:42 -0800
Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-04 02:38 -0600
Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-10-31 10:20 -0400
Re: Is there a better way? humptydumpty <ouatubi@gmail.com> - 2012-10-31 05:53 -0700
Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-10-31 09:23 -0400
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 06:41 -0700
Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-31 11:46 -0500
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 14:27 -0700
Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-10-31 14:32 -0700
Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-10-31 16:15 -0700
Re: Is there a better way? Coos Haak <chforth@hccnet.nl> - 2012-10-31 22:49 +0100
Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-31 17:13 -0500
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 23:39 -0700
Re: Is there a better way? "Elizabeth D. Rather" <erather@forth.com> - 2012-10-31 20:58 -1000
Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-01 02:04 -0700
Re: Is there a better way? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-10-31 19:13 -0400
Re: Is there a better way? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-02 17:31 +0000
Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-02 10:37 -0700
Re: Is there a better way? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-02 18:12 +0000
Re: Is there a better way? "Elizabeth D. Rather" <erather@forth.com> - 2012-11-02 08:29 -1000
Re: Is there a better way? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-05 14:53 +0000
Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-02 11:30 -0700
Re: Is there a better way? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-03 00:15 +0100
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 19:21 -0400
Re: Is there a better way? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-03 00:42 +0100
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 20:21 -0400
Re: Is there a better way? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-03 01:44 +0100
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-03 12:12 -0400
Re: Is there a better way? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-03 18:24 +0100
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-03 14:00 -0400
Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-03 10:29 -0700
Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-02 18:42 -0700
Re: Is there a better way? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-05 11:45 +0000
Re: Is there a better way? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-01 21:00 +0000
Re: Is there a better way? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-10-31 15:26 +0000
Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-10-31 12:22 -0400
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 15:07 -0700
Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-10-31 19:16 -0400
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-01 06:31 -0700
Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-11-01 10:34 -0400
Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-11-01 10:48 -0400
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-01 08:55 -0700
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-01 08:49 -0700
Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-11-01 12:46 -0400
Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-01 09:37 -0500
Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-01 07:41 -0700
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-01 08:52 -0700
Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-01 12:18 -0500
Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-01 19:38 -0700
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-02 02:29 -0700
Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-04 21:48 -0800
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-05 02:44 -0800
Re: Is there a better way? Graham NEWS <gray@forthman.plus.com> - 2012-11-01 15:52 +0000
Re: Is there a better way? Josh Grams <josh@qualdan.com> - 2012-11-03 16:38 +0000
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 14:26 -0700
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-01 13:42 -0400
Re: Is there a better way? Graham <""gray\"@forthman@plus.com"> - 2012-10-31 17:05 +0000
Re: Is there a better way? Peter Fälth <peter.falth@tin.it> - 2012-10-31 12:07 -0700
Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-10-31 12:12 -0700
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 14:17 -0700
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 14:21 -0700
Re: Is there a better way? Pablo Hugo Reda <pabloreda@gmail.com> - 2012-10-31 14:50 -0700
Re: Is there a better way? Pablo Hugo Reda <pabloreda@gmail.com> - 2012-10-31 14:51 -0700
Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-10-31 14:57 -0700
Re: Is there a better way? Coos Haak <chforth@hccnet.nl> - 2012-10-31 23:47 +0100
Re: Is there a better way? mhx@iae.nl (Marcel Hendrix) - 2012-11-01 21:28 +0200
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 15:11 -0700
Re: Is there a better way? Pablo Hugo Reda <pabloreda@gmail.com> - 2012-10-31 15:44 -0700
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-01 13:55 -0400
Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-10-31 16:10 -0700
Re: Is there a better way? Charles Mélice <charles.melice@gmail.com> - 2012-11-02 01:10 -0700
Re: Is there a better way? Charles Mélice <charles.melice@gmail.com> - 2012-11-02 01:18 -0700
Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-02 01:58 -0700
Re: Is there a better way? Charles Mélice <charles.melice@gmail.com> - 2012-11-02 02:14 -0700
Re: Is there a better way? Charles Mélice <charles.melice@gmail.com> - 2012-11-02 02:16 -0700
Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-02 06:16 -0500
Re: Is there a better way? Charles Mélice <charles.melice@gmail.com> - 2012-11-02 06:04 -0700
Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 13:13 -0400
Page 4 of 9 — ← Prev page 1 2 3 [4] 5 6 7 8 9 Next page →
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2012-11-15 15:18 +0000 |
| Subject | Strings (was: Words consuming arguments) |
| Message-ID | <2012Nov15.161816@mips.complang.tuwien.ac.at> |
| In reply to | #17288 |
Mark Wills <forthfreak@gmail.com> writes:
>On Nov 14, 11:01=A0pm, Hugh Aguilar <hughaguila...@yahoo.com> wrote:
>
>> I don't think that I will support counted strings at all in Straight
>> Forth (I mean, strings with the count stored in the 0'th array
>> element). I will only support adr,len strings (the address of the char
>> array and the size of the array on the stack).
>
>I'm not so sure that's a good idea. The advantage of counted strings
>is that they are significantly easier to carry about on the stack:
>
>c" red" c" green" c" blue"
>
>is much nicer than
>
>s" red" s" green" s" blue"
I don't see a significant difference. Is 'c' nicer than 's'?
>because with the former there are only 3 items on the stack, not 6.
>You determine the length of the string you are about to work with *at
>the point when you're going to work with it" (with COUNT), which is
>*much* nicer (IMHO) than carrying and juggling 6 items around on the
>stack!
That's one aspect, but that means that you define the stack effects of
your words to pass counted strings around. Unfortunately, apart from
C" and WORD, there are hardly any words that produce counted strings;
there is no word for turning a c-addr u string into a counted string
in the standard, and if you define it yourself, you run into the
memory management problem (that's probably also why there is no such
word in the standard): You need to put the counted string in some
unused memory area, and can only reclaim that memory when it's no
longer used.
Therefore, on balance, in my experience it's better to define your
stack effects to expect c-addr u strings, and that's probably also why
it's the dominant string representation in Forth-94. The deeper
stacks are not nice, but better than the alternative.
- 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 2012: http://www.euroforth.org/ef12/
[toc] | [prev] | [next] | [standalone]
| From | albert@spenarnc.xs4all.nl (Albert van der Horst) |
|---|---|
| Date | 2012-11-15 16:36 +0000 |
| Subject | Re: Strings (was: Words consuming arguments) |
| Message-ID | <50a519ff$0$3193$e4fe514c@dreader35.news.xs4all.nl> |
| In reply to | #17298 |
In article <2012Nov15.161816@mips.complang.tuwien.ac.at>, Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote: >Mark Wills <forthfreak@gmail.com> writes: >>On Nov 14, 11:01=A0pm, Hugh Aguilar <hughaguila...@yahoo.com> wrote: >> >>> I don't think that I will support counted strings at all in Straight >>> Forth (I mean, strings with the count stored in the 0'th array >>> element). I will only support adr,len strings (the address of the char >>> array and the size of the array on the stack). >> >>I'm not so sure that's a good idea. The advantage of counted strings >>is that they are significantly easier to carry about on the stack: >> >>c" red" c" green" c" blue" >> >>is much nicer than >> >>s" red" s" green" s" blue" > >I don't see a significant difference. Is 'c' nicer than 's'? > >>because with the former there are only 3 items on the stack, not 6. >>You determine the length of the string you are about to work with *at >>the point when you're going to work with it" (with COUNT), which is >>*much* nicer (IMHO) than carrying and juggling 6 items around on the >>stack! > >That's one aspect, but that means that you define the stack effects of >your words to pass counted strings around. Unfortunately, apart from >C" and WORD, there are hardly any words that produce counted strings; >there is no word for turning a c-addr u string into a counted string >in the standard, and if you define it yourself, you run into the >memory management problem (that's probably also why there is no such >word in the standard): You need to put the counted string in some >unused memory area, and can only reclaim that memory when it's no >longer used. > >Therefore, on balance, in my experience it's better to define your >stack effects to expect c-addr u strings, and that's probably also why >it's the dominant string representation in Forth-94. The deeper >stacks are not nice, but better than the alternative. I think you have presented the case nicely. Manipulating pair of cells on the stack like in 2SWAP 2OVER is not too bad. And I've gone quite some miles with simples static buffers for strings. ( $@ $! ). If only we had SDSWAP and DSSWAP instead of ROT and -ROT ... > >- anton >-- >M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html Groetjes Albert -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
[toc] | [prev] | [next] | [standalone]
| From | "Rod Pemberton" <do_not_have@notemailnotz.cnm> |
|---|---|
| Date | 2012-11-15 18:35 -0500 |
| Subject | Re: Strings (was: Words consuming arguments) |
| Message-ID | <k83tv1$qma$1@speranza.aioe.org> |
| In reply to | #17298 |
"Anton Ertl" <anton@mips.complang.tuwien.ac.at> wrote in message news:2012Nov15.161816@mips.complang.tuwien.ac.at... > [...] Unfortunately, apart from > C" and WORD, there are hardly any words that produce counted strings; > there is no word for turning a c-addr u string into a counted string > in the standard, and if you define it yourself, you run into the > memory management problem (that's probably also why there is no such > word in the standard): You need to put the counted string in some > unused memory area, and can only reclaim that memory when it's no > longer used. Wow, I'm amazed! Someone here finally provided the reason null-terminated strings would be better than counted strings in Forth... Rod Pemberton
[toc] | [prev] | [next] | [standalone]
| From | stephenXXX@mpeforth.com (Stephen Pelc) |
|---|---|
| Date | 2012-11-16 00:36 +0000 |
| Subject | Re: Strings (was: Words consuming arguments) |
| Message-ID | <50a585a5.322394474@192.168.0.50> |
| In reply to | #17305 |
On Thu, 15 Nov 2012 18:35:02 -0500, "Rod Pemberton" <do_not_have@notemailnotz.cnm> wrote: >"Anton Ertl" <anton@mips.complang.tuwien.ac.at> wrote in message >news:2012Nov15.161816@mips.complang.tuwien.ac.at... > >> [...] Unfortunately, apart from >> C" and WORD, there are hardly any words that produce counted strings; >> there is no word for turning a c-addr u string into a counted string >> in the standard, and if you define it yourself, you run into the >> memory management problem (that's probably also why there is no such >> word in the standard): You need to put the counted string in some >> unused memory area, and can only reclaim that memory when it's no >> longer used. > >Wow, I'm amazed! > >Someone here finally provided the reason null-terminated strings would be >better than counted strings in Forth... For practical applications, all Forth standards to date have been inadequate for commercial level string handling. However, Anton's statement "there is no word for turning a c-addr u string into a counted string" ignores the common practice word PLACE \ src srclen dest -- See: http://forth.sourceforge.net/mirror/comus/ See also the string library at http://code.google.com/p/ffl/ which is linked from FLAG http://soton.mpeforth.com/flag/ Stephen -- Stephen Pelc, stephenXXX@mpeforth.com MicroProcessor Engineering Ltd - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691 web: http://www.mpeforth.com - free VFX Forth downloads
[toc] | [prev] | [next] | [standalone]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2012-11-16 17:42 +0000 |
| Subject | Re: Strings (was: Words consuming arguments) |
| Message-ID | <2012Nov16.184201@mips.complang.tuwien.ac.at> |
| In reply to | #17308 |
stephenXXX@mpeforth.com (Stephen Pelc) writes:
>On Thu, 15 Nov 2012 18:35:02 -0500, "Rod Pemberton"
><do_not_have@notemailnotz.cnm> wrote:
>
>>"Anton Ertl" <anton@mips.complang.tuwien.ac.at> wrote in message
>>news:2012Nov15.161816@mips.complang.tuwien.ac.at...
>>
>>> there is no word for turning a c-addr u string into a counted string
>>> in the standard
...
>However, Anton's statement "there is no word for turning a c-addr u
>string into a counted string" ignores the common practice word
>
>PLACE \ src srclen dest --
>See: http://forth.sourceforge.net/mirror/comus/
You conveniently and distortingly did not cite "in the standard" the
second time. So, we don't have PLACE in the standard, and that's
good.
As an example of the problems of Mark Wills' scheme of passing all
strings around as counted strings and using PLACE in that context,
please show "/$", a variant of "/STRING" that passes counted strings
(instead of c-addr u) in and out. Show how PLACE is useful for
implementing that and compare the implementation with /STRING.
- 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 2012: http://www.euroforth.org/ef12/
[toc] | [prev] | [next] | [standalone]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2012-11-16 17:55 +0000 |
| Subject | Re: Strings (was: Words consuming arguments) |
| Message-ID | <2012Nov16.185550@mips.complang.tuwien.ac.at> |
| In reply to | #17305 |
"Rod Pemberton" <do_not_have@notemailnotz.cnm> writes:
>"Anton Ertl" <anton@mips.complang.tuwien.ac.at> wrote in message
>news:2012Nov15.161816@mips.complang.tuwien.ac.at...
>
>> [...] Unfortunately, apart from
>> C" and WORD, there are hardly any words that produce counted strings;
>> there is no word for turning a c-addr u string into a counted string
>> in the standard, and if you define it yourself, you run into the
>> memory management problem (that's probably also why there is no such
>> word in the standard): You need to put the counted string in some
>> unused memory area, and can only reclaim that memory when it's no
>> longer used.
>
>Wow, I'm amazed!
>
>Someone here finally provided the reason null-terminated strings would be
>better than counted strings in Forth...
And what's that reason? NUL-terminated strings have the same
problems for almost all operations (except /STRING), plus the problem
that they cannot contain NUL.
- 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 2012: http://www.euroforth.org/ef12/
[toc] | [prev] | [next] | [standalone]
| From | Hugh Aguilar <hughaguilar96@yahoo.com> |
|---|---|
| Date | 2012-11-17 04:18 -0800 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <7d8c55f7-94e3-40d5-8a53-9f699bd7ea5a@b4g2000pby.googlegroups.com> |
| In reply to | #17288 |
On Nov 15, 1:08 am, Mark Wills <forthfr...@gmail.com> wrote: > On Nov 14, 11:01 pm, Hugh Aguilar <hughaguila...@yahoo.com> wrote: > > > I don't think that I will support counted strings at all in Straight > > Forth (I mean, strings with the count stored in the 0'th array > > element). I will only support adr,len strings (the address of the char > > array and the size of the array on the stack). > > I'm not so sure that's a good idea. The advantage of counted strings > is that they are significantly easier to carry about on the stack: > > c" red" c" green" c" blue" > > is much nicer than > > s" red" s" green" s" blue" > > because with the former there are only 3 items on the stack, not 6. > You determine the length of the string you are about to work with *at > the point when you're going to work with it" (with COUNT), which is > *much* nicer (IMHO) than carrying and juggling 6 items around on the > stack! > > FWIW! Mark, you didn't read my words very carefully. Straight Forth will have two stacks --- one for single-cell data such as integers, pointers, etc. (the parameter stack that you are familiar with), and another for double-cell data such as double-precision integers and adr,len strings. There will also be a couple of floating- point stacks: one for low-precision floats and one for high-precision floats. This is your example: > c" red" c" green" c" blue" I won't be juggling 6 items on the parameter stack --- I will be juggling 3 items on the double-wide stack --- this stuff won't be on the single-wide parameter stack at all. The functions will be hard-coded to work with the appropriate stack. For example, SWAP will swap the top 2 items on the single-wide parameter stack and 2SWAP will swap the top two items on the double- wide parameter stack. S>D will move the top value of the single-wide parameter stack to the double-wide parameter stack, and will sign- extend it in the process. I have multiple stacks, with each stack associated to a particular data-type --- well, at least to a particular data-type size, as the double-wide stack will be for both double-precision integers and adr,len strings which are different data types but which both fit nicely on the double-wide stack. The point of doing this is to reduce the amount of stack-juggling that is done --- stack-juggling is a big part of why ANS-Forth is widely considered to be unreadable --- it is a major mess to have double-wide data intermingled with single-wide data on the parameter stack. I will also support local variables of course, but they won't be needed as a crutch to avoid stack-juggling as is often true in ANS-Forth --- with the multiple stacks, Forth purists who dislike locals will be able to write code without locals, while yet avoiding all of that ugly stack-juggling that typically plagues ANS-Forth.
[toc] | [prev] | [next] | [standalone]
| From | Alex McDonald <blog@rivadpm.com> |
|---|---|
| Date | 2012-11-17 04:56 -0800 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <e9390568-2a9c-4d8c-8923-b73f82e5f24f@bx4g2000vbb.googlegroups.com> |
| In reply to | #17341 |
On Nov 17, 12:18 pm, Hugh Aguilar <hughaguila...@yahoo.com> wrote: > On Nov 15, 1:08 am, Mark Wills <forthfr...@gmail.com> wrote: > > > > > > > > > > > On Nov 14, 11:01 pm, Hugh Aguilar <hughaguila...@yahoo.com> wrote: > > > > I don't think that I will support counted strings at all in Straight > > > Forth (I mean, strings with the count stored in the 0'th array > > > element). I will only support adr,len strings (the address of the char > > > array and the size of the array on the stack). > > > I'm not so sure that's a good idea. The advantage of counted strings > > is that they are significantly easier to carry about on the stack: > > > c" red" c" green" c" blue" > > > is much nicer than > > > s" red" s" green" s" blue" > > > because with the former there are only 3 items on the stack, not 6. > > You determine the length of the string you are about to work with *at > > the point when you're going to work with it" (with COUNT), which is > > *much* nicer (IMHO) than carrying and juggling 6 items around on the > > stack! > > > FWIW! > > Mark, you didn't read my words very carefully. > > Straight Forth will have two stacks --- one for single-cell data such > as integers, pointers, etc. (the parameter stack that you are familiar > with), and another for double-cell data such as double-precision > integers and adr,len strings. There will also be a couple of floating- > point stacks: one for low-precision floats and one for high-precision > floats. > > This is your example:> c" red" c" green" c" blue" > > I won't be juggling 6 items on the parameter stack --- I will be > juggling 3 items on the double-wide stack --- this stuff won't be on > the single-wide parameter stack at all. > > The functions will be hard-coded to work with the appropriate stack. > For example, SWAP will swap the top 2 items on the single-wide > parameter stack and 2SWAP will swap the top two items on the double- > wide parameter stack. S>D will move the top value of the single-wide > parameter stack to the double-wide parameter stack, and will sign- > extend it in the process. > > I have multiple stacks, with each stack associated to a particular > data-type --- well, at least to a particular data-type size, as the > double-wide stack will be for both double-precision integers and > adr,len strings which are different data types but which both fit > nicely on the double-wide stack. The point of doing this is to reduce > the amount of stack-juggling that is done --- stack-juggling is a big > part of why ANS-Forth is widely considered to be unreadable --- it is > a major mess to have double-wide data intermingled with single-wide > data on the parameter stack. I will also support local variables of > course, but they won't be needed as a crutch to avoid stack-juggling > as is often true in ANS-Forth --- with the multiple stacks, Forth > purists who dislike locals will be able to write code without locals, > while yet avoiding all of that ugly stack-juggling that typically > plagues ANS-Forth. : foo s" abcd" over 1 ." the character " type ." is the first character of " type ; : hugh ??? ; Fill in the ??? please without introducing stack to stack moves.
[toc] | [prev] | [next] | [standalone]
| From | "Elizabeth D. Rather" <erather@forth.com> |
|---|---|
| Date | 2012-11-17 07:24 -1000 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <74-dnUmJi8vXVTrNnZ2dnUVZ_tSdnZ2d@supernews.com> |
| In reply to | #17342 |
On 11/17/12 2:56 AM, Alex McDonald wrote: > On Nov 17, 12:18 pm, Hugh Aguilar <hughaguila...@yahoo.com> wrote: ... >> I have multiple stacks, with each stack associated to a particular >> data-type --- well, at least to a particular data-type size, as the >> double-wide stack will be for both double-precision integers and >> adr,len strings which are different data types but which both fit >> nicely on the double-wide stack. The point of doing this is to reduce >> the amount of stack-juggling that is done --- stack-juggling is a big >> part of why ANS-Forth is widely considered to be unreadable --- it is >> a major mess to have double-wide data intermingled with single-wide >> data on the parameter stack. I will also support local variables of >> course, but they won't be needed as a crutch to avoid stack-juggling >> as is often true in ANS-Forth --- with the multiple stacks, Forth >> purists who dislike locals will be able to write code without locals, >> while yet avoiding all of that ugly stack-juggling that typically >> plagues ANS-Forth. > > : foo s" abcd" over 1 ." the character " type ." is the first > character of " type ; > : hugh ??? ; > > Fill in the ??? please without introducing stack to stack moves. > The addr-len parameters for a string are not an example of "double-wide" data, they are a pair of single-cell items each of which has a meaning and potential use independent of the fact that together they describe a string. For example: S" Here is some text" PAD SWAP MOVE ...uses them individually but in a relevant way, as does Alex's example. Double-length integers are less likely to need their components treated individually, but even there it's awfully nice to be able to convert a double that you know (because of application knowledge) to a single by doing a DROP. Cheers, Elizabeth -- ================================================== Elizabeth D. Rather (US & Canada) 800-55-FORTH FORTH Inc. +1 310.999.6784 5959 West Century Blvd. Suite 700 Los Angeles, CA 90045 http://www.forth.com "Forth-based products and Services for real-time applications since 1973." ==================================================
[toc] | [prev] | [next] | [standalone]
| From | Hugh Aguilar <hughaguilar96@yahoo.com> |
|---|---|
| Date | 2012-11-19 15:58 -0800 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <d45eed78-9a9d-499a-aadd-bf9dd5712340@6g2000pbh.googlegroups.com> |
| In reply to | #17343 |
On Nov 17, 10:24 am, "Elizabeth D. Rather" <erat...@forth.com> wrote: > > On Nov 17, 12:18 pm,HughAguilar <hughaguila...@yahoo.com> wrote: > ... > >> I have multiple stacks, with each stack associated to a particular > >> data-type --- well, at least to a particular data-type size, as the > >> double-wide stack will be for both double-precision integers and > >> adr,len strings which are different data types but which both fit > >> nicely on the double-wide stack. The point of doing this is to reduce > >> the amount of stack-juggling that is done --- stack-juggling is a big > >> part of why ANS-Forth is widely considered to be unreadable --- it is > >> a major mess to have double-wide data intermingled with single-wide > >> data on the parameter stack. I will also support local variables of > >> course, but they won't be needed as a crutch to avoid stack-juggling > >> as is often true in ANS-Forth --- with the multiple stacks, Forth > >> purists who dislike locals will be able to write code without locals, > >> while yet avoiding all of that ugly stack-juggling that typically > >> plagues ANS-Forth. > > > : foo s" abcd" over 1 ." the character " type ." is the first > > character of " type ; > > :hugh??? ; > > > Fill in the ??? please without introducing stack to stack moves. > > The addr-len parameters for a string are not an example of "double-wide" > data, they are a pair of single-cell items each of which has a meaning > and potential use independent of the fact that together they describe a > string. > > For example: > > S" Here is some text" PAD SWAP MOVE > > ...uses them individually but in a relevant way, as does Alex's example. I'm really opposed to this idea that all code has to be written manually. I would treat strings as a data type. I would have a library of functions that work on strings. The implementation of the strings can largely be hidden under the hood --- this isn't really anything that the user needs to know about. I don't like having the user write code like this to iterate over a string: over + swap do I c@ xxx loop Code like this becomes "idiomatic" --- it gets cut-and-pasted throughout the user's program. This is very error-prone. I would much prefer to have an iterator that iterates over the string and it is given the xt of xxx as a parameter, and it calls xxx for every character. The iterator encapsulates the code for iterating over a string, so this code doesn't have to be written out manually by the user over and over again. Also, the iterator is part of the language (in the case of standard data types such as strings and linked lists, etc.), and so the iterator can be written in assembly language for speed. > Double-length integers are less likely to need their components treated > individually, but even there it's awfully nice to be able to convert a > double that you know (because of application knowledge) to a single by > doing a DROP. There is never any good reason to treat the components of a double- precision integer individually. There will be a D>S word for converting a double to a single (and moving it from the double-wide stack to the single-wide stack) --- and it will throw an error if this can't be done exactly. If there is some demand for treating the components individually (which I doubt), then I can provide a D>LO and D>HI that move only the low or high word of the double to the single-wide stack. Similarly, I can provide a STR>DATA and a STR>LENGTH that move the pointer to the data or the length of the string to the single-wide stack. I very much doubt that anybody will ever need this kind of stuff though --- if they do, they are either doing something very esoteric, or they are screwing up (the latter being the more likely). It is really a good idea to hide information about the internal representation of primitive data types (such as double-precision integers or strings). This isn't the 1970s anymore --- nobody writes code manually, and then cuts-and-pastes this code repeatedly throughout the program --- this low-level stuff gets buried under an API. Everybody who has written large programs knows this (actually, medium-sized programs too).
[toc] | [prev] | [next] | [standalone]
| From | Brad Eckert <hwfwguy@gmail.com> |
|---|---|
| Date | 2012-11-20 08:17 -0800 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <e6f70bdb-d9a7-4f26-88c6-0d5e184e6af4@googlegroups.com> |
| In reply to | #17405 |
On Monday, November 19, 2012 4:58:13 PM UTC-7, Hugh Aguilar wrote: > > over + swap do I c@ xxx loop > > Code like this becomes "idiomatic" --- it gets cut-and-pasted > throughout the user's program. This is very error-prone. I would much > prefer to have an iterator that iterates over the string and it is > given the xt of xxx as a parameter, and it calls xxx for every > character. The iterator encapsulates the code for iterating over a > string, so this code doesn't have to be written out manually by the > user over and over again. Also, the iterator is part of the language > (in the case of standard data types such as strings and linked lists, > etc.), and so the iterator can be written in assembly language for > speed. If you're proposing building a new application-specific language, that's how Forth is supposed to be used. > > There is never any good reason to treat the components of a double- > precision integer individually. There will be a D>S word for > converting a double to a single (and moving it from the double-wide > stack to the single-wide stack) --- and it will throw an error if this > can't be done exactly. > Here's the problem I see with your approach. Historically, you haven't been very open to outside ideas or constructive criticism. So, your work is going to be the product of what's inside Hugh's head. OTOH, ANS Forth is the product of many years of exploration and relentless reworking of the language by many highly experienced people in the course of writing commercial applications. If you want to improve on ANS, do it by taking away not adding.
[toc] | [prev] | [next] | [standalone]
| From | "Rod Pemberton" <do_not_have@notemailnotz.cnm> |
|---|---|
| Date | 2012-11-14 06:30 -0500 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <k7vv49$23q$1@speranza.aioe.org> |
| In reply to | #17243 |
"Elizabeth D. Rather" <erather@forth.com> wrote in message news:mdqdnYH8wqQ6BjzNnZ2dnUVZ_rWdnZ2d@supernews.com... > On 11/12/12 2:49 PM, Rod Pemberton wrote: > ... > > BTW, this is the original definition of COUNT: > > > > " COUNT addr1 --- addr2 n L0 > > Leave the byte address addr2 and byte count n of a > > message text beginning at addr1. It is presumed that > > the first byte at addr1 contains the text byte count and > > the actual text starts with the second byte. Typically > > COUNT is followed by TYPE." > > > > It's also more accurate. It doesn't assume counted strings. > > I'm not sure what "original" means in this context. COUNT has been > around since 1971, which is 7 years before the first, very preliminary, > attempt at standards. In any case, the sentence, "It is presumed that > the first byte at addr1 contains the text byte count and the actual text > starts with the second byte" is an accurate description of a counted > string. > What does "presumed" mean to you? Rod Pemberton
[toc] | [prev] | [next] | [standalone]
| From | "Elizabeth D. Rather" <erather@forth.com> |
|---|---|
| Date | 2012-11-14 09:06 -1000 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <7sWdnXCP3YRSdj7NnZ2dnUVZ_uadnZ2d@supernews.com> |
| In reply to | #17267 |
On 11/14/12 1:30 AM, Rod Pemberton wrote: > "Elizabeth D. Rather" <erather@forth.com> wrote in message > news:mdqdnYH8wqQ6BjzNnZ2dnUVZ_rWdnZ2d@supernews.com... >> On 11/12/12 2:49 PM, Rod Pemberton wrote: >> ... >>> BTW, this is the original definition of COUNT: >>> >>> " COUNT addr1 --- addr2 n L0 >>> Leave the byte address addr2 and byte count n of a >>> message text beginning at addr1. It is presumed that >>> the first byte at addr1 contains the text byte count and >>> the actual text starts with the second byte. Typically >>> COUNT is followed by TYPE." >>> >>> It's also more accurate. It doesn't assume counted strings. >> >> I'm not sure what "original" means in this context. COUNT has been >> around since 1971, which is 7 years before the first, very preliminary, >> attempt at standards. In any case, the sentence, "It is presumed that >> the first byte at addr1 contains the text byte count and the actual text >> starts with the second byte" is an accurate description of a counted >> string. >> > > What does "presumed" mean to you? From dictionary.com: pre·sume [pri-zoom] Show IPA verb, pre·sumed, pre·sum·ing. verb (used with object) 1. to take for granted, assume, or suppose: I presume you're tired after your drive. 2. Law . to assume as true in the absence of proof to the contrary. In other words, it's a synonym to 'assume', so all definitions of COUNT both assume and presume a counted string format. Cheers, Elizabeth -- ================================================== Elizabeth D. Rather (US & Canada) 800-55-FORTH FORTH Inc. +1 310.999.6784 5959 West Century Blvd. Suite 700 Los Angeles, CA 90045 http://www.forth.com "Forth-based products and Services for real-time applications since 1973." ==================================================
[toc] | [prev] | [next] | [standalone]
| From | "Rod Pemberton" <do_not_have@notemailnotz.cnm> |
|---|---|
| Date | 2012-11-15 06:18 -0500 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <k82ip2$aao$1@speranza.aioe.org> |
| In reply to | #17278 |
"Elizabeth D. Rather" <erather@forth.com> wrote in message news:7sWdnXCP3YRSdj7NnZ2dnUVZ_uadnZ2d@supernews.com... > On 11/14/12 1:30 AM, Rod Pemberton wrote: > > "Elizabeth D. Rather" <erather@forth.com> wrote in message > > news:mdqdnYH8wqQ6BjzNnZ2dnUVZ_rWdnZ2d@supernews.com... > >> On 11/12/12 2:49 PM, Rod Pemberton wrote: ... > >>> BTW, this is the original definition of COUNT: > >>> > >>> " COUNT addr1 --- addr2 n L0 > >>> Leave the byte address addr2 and byte count n of a > >>> message text beginning at addr1. It is presumed that > >>> the first byte at addr1 contains the text byte count > >>> and the actual text starts with the second byte. > >>> Typically COUNT is followed by TYPE." > >>> > >>> It's also more accurate. It doesn't assume counted strings. > >> > >> I'm not sure what "original" means in this context. COUNT has been > >> around since 1971, which is 7 years before the first, very preliminary, > >> attempt at standards. In any case, the sentence, "It is presumed that > >> the first byte at addr1 contains the text byte count and the actual > >> text starts with the second byte" is an accurate description of a > >> counted string. > >> > > > > What does "presumed" mean to you? > > From dictionary.com: > > pre·sume [pri-zoom] Show IPA verb, pre·sumed, pre·sum·ing. > verb (used with object) > 1. to take for granted, assume, or suppose: I presume you're tired after > your drive. > 2. Law . to assume as true in the absence of proof to the contrary. > > In other words, it's a synonym to 'assume', so all definitions of COUNT > both assume and presume a counted string format. Presume is presumptive. It's a guess at what is true, typically because that guess is most likely true. However, presume doesn't mean that something is true. I.e., that definition of COUNT allows for implementations other than counted strings. Rod Pemberton
[toc] | [prev] | [next] | [standalone]
| From | Andrew Haley <andrew29@littlepinkcloud.invalid> |
|---|---|
| Date | 2012-11-13 04:26 -0600 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <7vOdnf3g2cvQvT_NnZ2dnUVZ8mGdnZ2d@supernews.com> |
| In reply to | #17241 |
Rod Pemberton <do_not_have@notemailnotz.cnm> wrote: > "Andrew Haley" <andrew29@littlepinkcloud.invalid> wrote in message > news:lo6dnQzHTZphWD3NnZ2dnUVZ8qqdnZ2d@supernews.com... >> Rod Pemberton <do_not_have@notemailnotz.cnm> wrote: >> > "Hugh Aguilar" <hughaguilar96@yahoo.com> wrote in message >> > > news:45d4f07b-8d85-43e7-acc9-614966bdae14@uk1g2000pbb.googlegroups.com... >> >> On Nov 6, 6:53 pm, "Rod Pemberton" <do_not_h...@notemailnotz.cnm> >> >> wrote: >> >> >> >> > What about a word like COUNT ? >> >> >> >> > COUNT ( addr -- addr len ) >> >> >> >> This is the stack picture for COUNT : >> >> >> >> : count ( adr1 -- adr2 len ) >> >> >> >> COUNT does consume adr1 --- and then it gives you back >> >> some other data >> > >> > That's a matter of interpretation. len is definately different. >> > >> >> (adr2 is not the same datum as adr1). >> > >> > False. "adr2 is" _typically_ "not the same datum as adr1", but can be. >> > >> > There is no requirement that adr2 be different from adr1. >> >> Of course there is, because the count is at c-addr1, and c-addr2 is >> the start of the string: >> >> 6.1.0980 COUNT >> CORE >> >> ( c-addr1 -- c-addr2 u ) >> >> Return the character string specification for the counted string >> stored at c-addr1. c-addr2 is the address of the first character after >> c-addr1. u is the contents of the character at c-addr1, which is the >> length in characters of the string at c-addr2. >> >> > There is only a requirement that COUNT returns an address to the >> > start of the string. Historically, since counted strings are used >> > in Forth, where the count precedes the string, they are different. >> > But, if no count precedes the string, they'll be the same. >> >> The count precedes the string, as COUNT's glossary entry makes clear. > > Did you just pop in and ignore *EVERYTHING* that was said > previously, i.e., including the now snipped context? You *keep* > responding near the end of a thread after relevant context for you > reply has been snipped. Please, read the entire thread first. I'm responding to what I quoted; nothing more, nothing less. If you disagee with the part you wrote that I responded to, feel free to say so. > BTW, this is the original definition of COUNT: > > " COUNT addr1 --- addr2 n L0 > Leave the byte address addr2 and byte count n of a > message text beginning at addr1. It is presumed that > the first byte at addr1 contains the text byte count > and the actual text starts with the second byte. > Typically COUNT is followed by TYPE." > > It's also more accurate. In what more is it more accurate than the standard definition? > It doesn't assume counted strings. Yes it does. Read it again. Andrew.
[toc] | [prev] | [next] | [standalone]
| From | "Rod Pemberton" <do_not_have@notemailnotz.cnm> |
|---|---|
| Date | 2012-11-14 06:29 -0500 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <k7vv1v$1q6$1@speranza.aioe.org> |
| In reply to | #17248 |
"Andrew Haley" <andrew29@littlepinkcloud.invalid> wrote in message news:7vOdnf3g2cvQvT_NnZ2dnUVZ8mGdnZ2d@supernews.com... > Rod Pemberton <do_not_have@notemailnotz.cnm> wrote: ... > > BTW, this is the original definition of COUNT: > > > > " COUNT addr1 --- addr2 n L0 > > Leave the byte address addr2 and byte count n of a > > message text beginning at addr1. It is presumed that > > the first byte at addr1 contains the text byte count > > and the actual text starts with the second byte. > > Typically COUNT is followed by TYPE." > > > > It's also more accurate. > > [How] is it more accurate than the standard definition? > It doesn't assume counted strings. > > It doesn't assume counted strings. > > Yes it does. Read it again. > No it doesn't. Read it again. This time look for the word "presumed". Look up the definition for "presumed". Rod Pemberton
[toc] | [prev] | [next] | [standalone]
| From | Andrew Haley <andrew29@littlepinkcloud.invalid> |
|---|---|
| Date | 2012-11-14 06:03 -0600 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <GtOdnYh--vAWFT7NnZ2dnUVZ8iCdnZ2d@supernews.com> |
| In reply to | #17266 |
Rod Pemberton <do_not_have@notemailnotz.cnm> wrote: > "Andrew Haley" <andrew29@littlepinkcloud.invalid> wrote in message > news:7vOdnf3g2cvQvT_NnZ2dnUVZ8mGdnZ2d@supernews.com... >> Rod Pemberton <do_not_have@notemailnotz.cnm> wrote: > ... > >> > BTW, this is the original definition of COUNT: >> > >> > " COUNT addr1 --- addr2 n L0 >> > Leave the byte address addr2 and byte count n of a >> > message text beginning at addr1. It is presumed that >> > the first byte at addr1 contains the text byte count >> > and the actual text starts with the second byte. >> > Typically COUNT is followed by TYPE." >> > >> > It's also more accurate. >> >> [How] is it more accurate than the standard definition? > > It doesn't assume counted strings. In which case it would be less accurate; if your claim were true, which it isn't. FWIW, this isn't the "original" definition of COUNT . COUNT dates from before fig-FORTH, and we'd need Elizabeth's help to find its earliest definition. >> > It doesn't assume counted strings. >> >> Yes it does. Read it again. > > No it doesn't. Read it again. > > This time look for the word "presumed". > Look up the definition for "presumed". It's the past participle of the verb "to presume", which means variously, to assume to be true, to take for granted, to suppose, etc. fig-FORTH isn't a standard; it is defined by its implementation. The fig-FORTH implementation of COUNT is : COUNT DUP 1+ SWAP C@ ; Andrew.
[toc] | [prev] | [next] | [standalone]
| From | "Rod Pemberton" <do_not_have@notemailnotz.cnm> |
|---|---|
| Date | 2012-11-15 07:15 -0500 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <k82m4s$j4u$1@speranza.aioe.org> |
| In reply to | #17270 |
"Andrew Haley" <andrew29@littlepinkcloud.invalid> wrote in message news:GtOdnYh--vAWFT7NnZ2dnUVZ8iCdnZ2d@supernews.com... > Rod Pemberton <do_not_have@notemailnotz.cnm> wrote: > > "Andrew Haley" <andrew29@littlepinkcloud.invalid> wrote in message > > news:7vOdnf3g2cvQvT_NnZ2dnUVZ8mGdnZ2d@supernews.com... > >> Rod Pemberton <do_not_have@notemailnotz.cnm> wrote: ... > >> > BTW, this is the original definition of COUNT: > >> > > >> > " COUNT addr1 --- addr2 n L0 > >> > Leave the byte address addr2 and byte count n of a > >> > message text beginning at addr1. It is presumed that > >> > the first byte at addr1 contains the text byte count > >> > and the actual text starts with the second byte. > >> > Typically COUNT is followed by TYPE." > >> > > >> > It's also more accurate. > >> > >> [How] is it more accurate than the standard definition? > > > > It doesn't assume counted strings. > > In which case it would be less accurate; if your claim were true, which it > isn't. This depends on ones perspective. As compared to valid implementations, it's more accurate because it allows for other valid implementations that don't use counted strings. It's only less accurate if you believe that only counted strings are the only valid representation for strings. > FWIW, this isn't the "original" definition of COUNT . COUNT dates > from before fig-FORTH, and we'd need Elizabeth's help to find its > earliest definition. > "FORTH - A Language for Interactive Computing" by Charles Moore and Geoffery C. Leach, 1970 doesn't have COUNT or an equivalent that I see. "Forth - The Early Years" by Chuck Moore, 1991 from HOPL, summarizes Forth from 1958 to 1971. It doesn't have COUNT or an equivalent listed. Ms. Rather said COUNT has been around since 1971 elsewhere in this thread. In "Threads of a FORTH Tapestry" by Gregg Williams, BYTE Magazine, August 1980, he said that in 1979 he saw COUNT defined as: : COUNT 0 DO I . LOOP ; COUNT is not listed in the Forth glossary in that 1980 issue. Forth Dimensions, Vol.1 #2, 1978 - COUNT not listed in abbreviated glossary. Forth Dimensions, Vol.2 #3, 1980 - COUNT used in another manner. Forth Dimensions, Vol.3 #1, 1981 - COUNT used correctly in code. Two fig-Forth documents from 1979 and 1980 have COUNT as posted. COUNT appears in Chapter 10 of the online version of "Starting Forth" by Leo Brodie, 1982. Google Books shows various Forth books from 1983 to 1986 have COUNT. COUNT is in John Hayes' VAX FORTH, 1984, net.lang.forth. So, COUNT likely became available somewhere between 1971 and 1979. To me, it looks like it's more towards fig-Forth, since 1) that's where we found it to be defined and 2) there are two uses of COUNT where it wasn't being used correctly just prior to fig-Forth. However, I didn't locate many references online between those two dates. > >> > It doesn't assume counted strings. > >> > >> Yes it does. Read it again. > > > > No it doesn't. Read it again. > > > > This time look for the word "presumed". > > Look up the definition for "presumed". > > It's the past participle of the verb "to presume", which means > variously, to assume to be true, to take for granted, to suppose, etc. FYI, "assumed to be true" is different from "is true". One is absolutely true. The other is predominantly true, but doesn't have to be true. E.g., Dick Pountain's "Object-oriented Forth: implementation of data structures" says: "... For example, WORD returns the address of a packed string, but TYPE wants an unpacked string argument, so the word COUNT must be used to convert one to the other. (Just for good measure Forth also throws in null terminated strings in the inner workings of EXPECT which covers the gamut of posssibilities.)" That's a documented case of null terminated strings being used in Forth ... > fig-FORTH isn't a standard; it is defined by its implementation. It's a standard of the Forth Interest Group. You mean it's not a standard by a standards organization. That's true. Rod Pemberton
[toc] | [prev] | [next] | [standalone]
| From | Andrew Haley <andrew29@littlepinkcloud.invalid> |
|---|---|
| Date | 2012-11-15 11:51 -0600 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <yPednYu6mvIKtjjNnZ2dnUVZ8radnZ2d@supernews.com> |
| In reply to | #17296 |
Rod Pemberton <do_not_have@notemailnotz.cnm> wrote: > "Andrew Haley" <andrew29@littlepinkcloud.invalid> wrote in message > news:GtOdnYh--vAWFT7NnZ2dnUVZ8iCdnZ2d@supernews.com... >> Rod Pemberton <do_not_have@notemailnotz.cnm> wrote: >> > "Andrew Haley" <andrew29@littlepinkcloud.invalid> wrote in message >> > news:7vOdnf3g2cvQvT_NnZ2dnUVZ8mGdnZ2d@supernews.com... >> >> Rod Pemberton <do_not_have@notemailnotz.cnm> wrote: > ... > >> >> > BTW, this is the original definition of COUNT: >> >> > >> >> > " COUNT addr1 --- addr2 n L0 >> >> > Leave the byte address addr2 and byte count n of a >> >> > message text beginning at addr1. It is presumed that >> >> > the first byte at addr1 contains the text byte count >> >> > and the actual text starts with the second byte. >> >> > Typically COUNT is followed by TYPE." >> >> > >> >> > It's also more accurate. >> >> >> >> [How] is it more accurate than the standard definition? >> > >> > It doesn't assume counted strings. >> >> In which case it would be less accurate; if your claim were true, which it >> isn't. > > This depends on ones perspective. As compared to valid implementations, > it's more accurate because it allows for other valid implementations that > don't use counted strings. It's only less accurate if you believe that only > counted strings are the only valid representation for strings. > >> FWIW, this isn't the "original" definition of COUNT . COUNT dates >> from before fig-FORTH, and we'd need Elizabeth's help to find its >> earliest definition. > > "FORTH - A Language for Interactive Computing" by Charles Moore and Geoffery > C. Leach, 1970 doesn't have COUNT or an equivalent that I see. > > "Forth - The Early Years" by Chuck Moore, 1991 from HOPL, summarizes Forth > from 1958 to 1971. It doesn't have COUNT or an equivalent listed. > > Ms. Rather said COUNT has been around since 1971 elsewhere in this thread. And she's probably right. > So, COUNT likely became available somewhere between 1971 and 1979. Around 1971, I would have thought. > To me, it looks like it's more towards fig-Forth fig-FORTH didn't originate very much: variable-length dictionary entries and "compiler security" were its main contributions. I would be surprised if it originated COUNT, especially since Elizabeth, the closest thing there is to an authority on the history of Forth, says otherwise. >> >> > It doesn't assume counted strings. >> >> >> >> Yes it does. Read it again. >> > >> > No it doesn't. Read it again. >> > >> > This time look for the word "presumed". >> > Look up the definition for "presumed". >> >> It's the past participle of the verb "to presume", which means >> variously, to assume to be true, to take for granted, to suppose, etc. > > FYI, "assumed to be true" is different from "is true". One is > absolutely true. The other is predominantly true, but doesn't have > to be true. I don't think that's what "presumed" means: "presumed" doesn't mean "probably true". It means something more like "assumed to be true in this context". Besides, we can't possibly know what the author's intention was; I think this entry defines a counted string for the purposes of the word COUNT . > E.g., Dick Pountain's "Object-oriented Forth: implementation of data > structures" says: > > "... For example, WORD returns the address of a packed string, but > TYPE wants an unpacked string argument, so the word COUNT must be > used to convert one to the other. (Just for good measure Forth also > throws in null terminated strings in the inner workings of EXPECT > which covers the gamut of posssibilities.)" > > That's a documented case of null terminated strings being used in Forth ... And? >> fig-FORTH isn't a standard; it is defined by its implementation. > > It's a standard of the Forth Interest Group. You mean it's not a standard > by a standards organization. No, I don't. It's not really any kind of a standard, more a portable implementation. And it still defines COUNT the way every other Forth does! fig-FORTH was never going to be any use as a standard, so FORTH-79, which defines COUNT in the usual way, came along shortly after. Of course you are free to define COUNT in any way you like, but to claim historical authority from a fig-FORTH glossary entry is absurd. Andrew.
[toc] | [prev] | [next] | [standalone]
| From | "Rod Pemberton" <do_not_have@notemailnotz.cnm> |
|---|---|
| Date | 2012-11-15 18:44 -0500 |
| Subject | Re: Words consuming arguments, was [Re: Is there a better way?] |
| Message-ID | <k83uhh$rum$1@speranza.aioe.org> |
| In reply to | #17302 |
"Andrew Haley" <andrew29@littlepinkcloud.invalid> wrote in message news:yPednYu6mvIKtjjNnZ2dnUVZ8radnZ2d@supernews.com... > Rod Pemberton <do_not_have@notemailnotz.cnm> wrote: > > "Andrew Haley" <andrew29@littlepinkcloud.invalid> wrote in message > > news:GtOdnYh--vAWFT7NnZ2dnUVZ8iCdnZ2d@supernews.com... ... > >> fig-FORTH isn't a standard; it is defined by its implementation. > > > > It's a standard of the Forth Interest Group. You mean it's not a > > standard by a standards organization. > > No, I don't. It's not really any kind of a standard, more a portable > implementation. And it still defines COUNT the way every other Forth > does! fig-FORTH was never going to be any use as a standard, so > FORTH-79, which defines COUNT in the usual way, came along shortly > after. > > Of course you are free to define COUNT in any way you like, but to > claim historical authority from a fig-FORTH glossary entry is absurd. > Well, I'm getting the impression that you've never actually seen the fig-Forth standards. You seem to think it's nothing more than a glossary. If you had seen them, I think you'd belittle FORTH-79 as a standard. By comparison, it's a joke. fig-Forth has far more than a glossary. It has memory diagrams for implemenation of the system such what types of stacks, and where the stacks are supposed to be located. One of them has a complete fig-Forth almost entirely in Forth with just minimal assembly. It also has code for a line editor. There are two fig-Forth document scans as text on the Internet. One of them is basically just a "glossary" while the other is the more complete version. There are also numerous other .pdf's which just include fig-Forth code in assembly for a specific platform. Those don't have a "glossary" just Forth definitions in assembly. Anyway, I've posted links to both scans in c.l.f. previously. Rod Pemberton
[toc] | [prev] | [next] | [standalone]
Page 4 of 9 — ← Prev page 1 2 3 [4] 5 6 7 8 9 Next page →
Back to top | Article view | comp.lang.forth
csiph-web