Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #57486
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: string-stack.4th |
| Date | 2017-04-17 12:04 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2017Apr17.140423@mips.complang.tuwien.ac.at> (permalink) |
| References | (4 earlier) <b0de7690-6977-4513-9804-d3782771a64e@googlegroups.com> <ee44fdd6-18dc-4076-b4b6-b2c4b8765ed3@googlegroups.com> <xn0kosx1g3k40me003@nntp.aioe.org> <2017Apr16.175138@mips.complang.tuwien.ac.at> <xn0kotn2p424x0x000@nntp.aioe.org> |
"Rudy Velthuis" <newsgroups@rvelthuis.de> writes:
>Anton Ertl wrote:
>
>> > The address-length pair only make sense if the string
>> > data is read directly from some kind of buffer and the buffer should
>> > not/cannot be modified. This only makes sense for transient data,
>> > e.g. when parsing a word or string of which the string data that
>> > can easily be discarded after use (e.g. when interpreting or
>> > compiling and you only parse to, er, find out what to do next).
>>
>> Much of my strings usage is like that. A good reason to use c-addr u.
>> Do you really want to copy a substring to a separate buffer (and where
>> do you allocate that?) before you can, e.g., write it to a file? I
>> don't.
>
>No, of course not. Then you use c-addr u, like in other languages.
So that's why we have c-addr u. Now adding another string
representation complicates things. I need to decide which string
representation is appropriate where, have to keep track of which
string representation is used where, have to insert conversion words
in various places, have to write some words in two variants, etc. And
what benefit do we get for putting up with these complications?
> But
>if you have to manipulate or keep around more than one string, and
>these are referenced in more than one spot, it often makes sense to
>have semi-permanent or permanent storage. So, yes, often such strings
>are simply stored in the word, or in an allocated buffer, or, well, in
>a separate heap, but then a double-cell "pointer" is useless.
The c-addr u representation is just as useful as ever: It tells you
where the string starts and how long it is.
- 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 2016: http://www.euroforth.org/ef16/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-15 16:54 -0700
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-15 19:55 -0700
Re: string-stack.4th Julian Fondren <julian.fondren@gmail.com> - 2017-04-15 20:08 -0700
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-16 13:50 +0000
Re: string-stack.4th anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-16 15:51 +0000
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-16 22:16 +0000
Re: string-stack.4th anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-17 12:04 +0000
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-17 13:11 -0700
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-17 23:18 +0000
Re: string-stack.4th albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-18 01:49 +0200
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-19 23:03 +0000
Re: string-stack.4th "Elizabeth D. Rather" <erather@forth.com> - 2017-04-19 13:19 -1000
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-20 00:15 +0000
Re: string-stack.4th "Elizabeth D. Rather" <erather@forth.com> - 2017-04-19 14:34 -1000
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-20 17:16 +0000
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-20 15:08 -0700
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-20 00:16 +0000
Re: string-stack.4th albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-20 21:10 +0200
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-21 09:59 +0000
Re: string-stack.4th albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-20 20:50 +0200
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-17 19:47 -0700
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-19 23:08 +0000
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-18 00:10 -0700
Re: string-stack.4th Alex <alex@rivadpm.com> - 2017-04-18 13:48 +0100
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-18 09:15 -0700
Re: string-stack.4th Alex <alex@rivadpm.com> - 2017-04-18 18:23 +0100
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-17 23:07 +0000
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-18 09:09 -0700
Re: string-stack.4th lehs <skydda.barnen@gmail.com> - 2017-04-18 10:27 -0700
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-16 19:26 -0700
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-17 23:13 +0000
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-23 12:39 -0700
Re: string-stack.4th Michael Barry <barrym95838@yahoo.com> - 2017-04-23 22:25 -0700
Re: string-stack.4th foxaudioresearch@gmail.com - 2017-04-24 14:06 -0700
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-29 03:19 +0000
Re: string-stack.4th Ron Aaron <rambamist@gmail.com> - 2017-04-24 08:35 +0300
Re: string-stack.4th Paul Rubin <no.email@nospam.invalid> - 2017-04-23 23:51 -0700
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-24 00:10 -0700
Re: string-stack.4th Ron Aaron <rambamist@gmail.com> - 2017-04-24 10:11 +0300
Re: string-stack.4th Lars Brinkhoff <lars.spam@nocrew.org> - 2017-04-24 09:27 +0200
Re: string-stack.4th Paul Rubin <no.email@nospam.invalid> - 2017-04-24 01:14 -0700
Re: string-stack.4th Alex <alex@rivadpm.com> - 2017-04-24 14:38 +0100
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-29 03:18 +0000
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-29 03:27 +0000
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-28 22:13 -0700
Re: string-stack.4th Alex <alex@rivadpm.com> - 2017-04-29 09:41 +0100
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-29 07:05 -0700
Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-29 11:43 +0000
Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-15 21:15 -0700
csiph-web