Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Alexander Skobelev Newsgroups: comp.lang.forth Subject: Re: FORTH LITE TUTORIAL based on MPE VFX Date: Thu, 26 Jun 2014 10:45:18 +0400 Organization: A noiseless patient Spider Lines: 26 Message-ID: References: <2d2eba75-5d44-422a-8a3f-751702d8cea6@googlegroups.com> <45f5f8f9-e2c0-42f1-8640-8108c55d397f@googlegroups.com> <1ad192b0-6c5b-462c-8d19-cad563dbf974@googlegroups.com> <557e2d7a-6003-42af-803b-5d21a00315bd@googlegroups.com> <87ceaa31-134f-4503-8a49-e07b4061b301@googlegroups.com> <29b02601-d43c-4f76-8f3a-02bb4855a09a@googlegroups.com> <31f28699-46bc-4f5b-a1f2-565d663dfd3e@googlegroups.com> <2cb5ef69-0e06-4a07-8594-5f65b3d2a714@googlegroups.com> <4e5d1063-b6f1-4cd8-ae53-be0435e372ee@googlegroups.com> <96e20bcc-9f13-4212-9959-6fa4765b40c1@googlegroups.com> <243713a6-b8b2-4053-bb59-6249ebf6b7f5@googlegroups.com> <39b481fe-3c92-44bc-aee7-b344fa9d523d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="0bbd6ff8dce8d563070daea2d73d76f2"; logging-data="24790"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+OFOWlNXiUp84ze23mACPM" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (darwin) Cancel-Lock: sha1:EhFwarDFwGs8z1CftUAxX84oFdQ= sha1:85Je/RM3nAx4hwZwlKJnakTY/q8= Xref: csiph.com comp.lang.forth:31863 "Rod Pemberton" writes: > On Wed, 25 Jun 2014 16:19:56 -0400, wrote: > >> In my language, I will not have any limit on the size of the strings, > > Just how do you intend to do that? ... > > You said you're not going to use nul-terminated strings (below), but > integers have a limited range. So, if you use counted strings, your > strings will be limited to the maximum representable value for the > integer used to store the strings' length. I.e., 65535 for unsigned > 16-bit, 4294967295 for unsigned 32-bit, etc. 32-bits is huge, but > it's still a fixed size, not unlimited as you've claimed. As soon as your strings can keep more characters than can fit in the memory you can say that your strings have no limit on the size. I suppose that can be done by using a count of variable size. For example, we can store the length of count in 2 high bits of it: 00 - count is 1 byte and maximum length is 2^6-1 = 63 01 - count is 2 bytes and maximum length is 2^6 * 256 + 255 = 16383 10 - count is 4 bytes and maximum length is 1073741823 11 - count is 8 bytes and maximum length is 9223372036854775807