Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #42688

Re: Questions about strings

From rickman <gnuarm@gmail.com>
Newsgroups comp.lang.forth
Subject Re: Questions about strings
Date 2015-10-17 14:07 -0400
Organization A noiseless patient Spider
Message-ID <mvu2kl$sdr$1@dont-email.me> (permalink)
References <a094319a-c257-452a-8009-e5d55ab1cdf6@googlegroups.com> <mvtp55$o2q$1@dont-email.me> <b80998ae-fed3-4d58-8de1-ab4627b8eed3@googlegroups.com>

Show all headers | View raw


On 10/17/2015 1:43 PM, Chris Curl wrote:
> On Saturday, October 17, 2015 at 11:25:26 AM UTC-4, rickman wrote:
>> On 10/17/2015 9:46 AM, Chris Curl wrote:
>>> Assuming that the count is at the beginning of a string, is the count the same size as the characters in the string?
>>>
>>> And are the characters "wide" (16 bits), or are they 8-bit entities?
>>>
>>> In other words, to get the length of a string, would I use C@ or @?
>>>
>>> I know I could use COUNT NIP, but I want to understand what is going on behind the scenes so that my implementation behaves like others would.
>>>
>>> Perhaps I should go rogue and implement them as standard BSTRs ...
>>>
>>> http://bytecomb.com/vba-internals-string-variables-and-pointers-in-depth/
>>
>> Do you read the ANS Forth spec?
>>
>> "3.1.3.4 Counted strings
>> A counted string in memory is identified by the address (c-addr) of its
>> length character.  The length character of a counted string shall
>> contain a binary representation of the number of data characters,
>> between zero and the implementation-defined maximum length for a counted
>> string. The maximum length of a counted string shall be at least 255."
>>
>> Does that answer your question?
>>
>> --
>>
>> Rick
>
> yes, thanks. is there a downloadable version of the spec somewhere? then it would be easier looking for stuff in it.

Unlike many specs (VHDL is nearly impossible to read) the Forth spec is 
not too bad.  The level 1 stuff is pretty clear most of the time.  The 
deeper stuff is harder to pull out, but that may be simply because it is 
harder to understand by definition.  I know I never fully follow many 
conversations here about things like what a system should do with  ' if 
.  But it has lots of useful info in the appendix.

Just adopt a positive attitude and look for the info.  It is usually there.

-- 

Rick

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Questions about strings Chris Curl <ccurl609@gmail.com> - 2015-10-17 06:46 -0700
  Re: Questions about strings rickman <gnuarm@gmail.com> - 2015-10-17 11:25 -0400
    Re: Questions about strings Chris Curl <ccurl609@gmail.com> - 2015-10-17 10:43 -0700
      Re: Questions about strings anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-10-17 17:52 +0000
      Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-17 07:56 -1000
      Re: Questions about strings rickman <gnuarm@gmail.com> - 2015-10-17 14:07 -0400
      Re: Questions about strings "HAA" <someone@microsoft.com> - 2015-10-18 12:50 +1000
  Re: Questions about strings Ron Aaron <rambamist@gmail.com> - 2015-10-17 19:30 +0300
  Re: Questions about strings anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-10-17 17:10 +0000
  Re: Questions about strings Jason Damisch <jasondamisch@yahoo.com> - 2015-10-17 10:41 -0700
    Re: Questions about strings foxaudioresearch@gmail.com - 2015-10-17 21:41 -0700
    Re: Questions about strings Johan Kotlinski <kotlinski@gmail.com> - 2015-10-18 15:40 -0700
      Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-18 13:41 -1000
        Re: Questions about strings Johan Kotlinski <kotlinski@gmail.com> - 2015-10-19 07:58 -0700
          Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-19 08:36 -1000
          Re: Questions about strings "HAA" <someone@microsoft.com> - 2015-10-23 00:08 +1000
      Re: Questions about strings anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-10-19 07:15 +0000
        Re: Questions about strings Chris Curl <ccurl609@gmail.com> - 2015-10-19 05:03 -0700
          Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-19 08:38 -1000
            Re: Questions about strings Chris Curl <ccurl609@gmail.com> - 2015-10-19 14:28 -0700
            Re: Questions about strings Alfred Singlestone <vitonis@gmail.com> - 2015-10-21 16:21 -0700
              Re: Questions about strings "HAA" <someone@microsoft.com> - 2015-10-22 11:07 +1000
                Re: Questions about strings Lars Brinkhoff <lars.spam@nocrew.org> - 2015-10-27 11:29 +0100
                Re: Questions about strings Chris Curl <ccurl609@gmail.com> - 2015-10-27 06:14 -0700
                Re: Questions about strings Lars Brinkhoff <lars.spam@nocrew.org> - 2015-10-27 15:04 +0100
                Re: Questions about strings Chris Curl <ccurl609@gmail.com> - 2015-10-27 07:01 -0700
                Re: Questions about strings Lars Brinkhoff <lars.spam@nocrew.org> - 2015-10-27 15:04 +0100
                Re: Questions about strings Chris Curl <ccurl609@gmail.com> - 2015-10-27 14:26 -0700
                Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-27 11:45 -1000
                Re: Questions about strings Lars Brinkhoff <lars.spam@nocrew.org> - 2015-10-28 07:43 +0100
        Re: Questions about strings "HAA" <someone@microsoft.com> - 2015-10-19 23:25 +1000
      Re: Questions about strings rickman <gnuarm@gmail.com> - 2015-10-20 14:47 -0400
        Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-20 09:48 -1000
          Re: Questions about strings rickman <gnuarm@gmail.com> - 2015-10-20 23:25 -0400
            Re: Questions about strings "HAA" <someone@microsoft.com> - 2015-10-21 15:11 +1000
              Re: Questions about strings "HAA" <someone@microsoft.com> - 2015-10-22 11:21 +1000
                Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-21 18:31 -1000
                Re: Questions about strings anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-10-22 05:51 +0000
                Re: Questions about strings "HAA" <someone@microsoft.com> - 2015-10-24 12:44 +1000
                Re: Questions about strings anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-10-25 10:17 +0000
                Re: Questions about strings "HAA" <someone@microsoft.com> - 2015-10-26 15:14 +1100
                Re: Questions about strings anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-10-26 11:20 +0000
                Re: Questions about strings "HAA" <someone@microsoft.com> - 2015-10-31 00:20 +1100
                Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-30 19:06 -1000
                Re: Questions about strings Paul Rubin <no.email@nospam.invalid> - 2015-10-30 23:27 -0700
                Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-30 21:28 -1000
                Re: Questions about strings Paul Rubin <no.email@nospam.invalid> - 2015-10-31 00:37 -0700
                Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-30 21:48 -1000
          Re: Questions about strings anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-10-21 06:10 +0000
  Re: Questions about strings Chris Curl <ccurl609@gmail.com> - 2015-10-31 10:48 -0700
    Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-31 09:57 -1000
      Re: Questions about strings Chris Curl <ccurl609@gmail.com> - 2015-10-31 13:34 -0700
        Re: Questions about strings "Elizabeth D. Rather" <erather@forth.com> - 2015-10-31 12:06 -1000
    Re: Questions about strings "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-11-02 02:34 -0500

csiph-web