Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Words consuming arguments, was [Re: Is there a better way?]
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rod Pemberton  
View profile  
 More options Nov 12 2012, 7:44 pm
Newsgroups: comp.lang.forth
From: "Rod Pemberton" <do_not_h...@notemailnotz.cnm>
Date: Mon, 12 Nov 2012 19:49:07 -0500
Local: Mon, Nov 12 2012 7:49 pm
Subject: Re: Words consuming arguments, was [Re: Is there a better way?]
"Andrew Haley" <andre...@littlepinkcloud.invalid> wrote in message

news:lo6dnQzHTZphWD3NnZ2dnUVZ8qqdnZ2d@supernews.com...
> Rod Pemberton <do_not_h...@notemailnotz.cnm> wrote:
> > "Hugh Aguilar" <hughaguila...@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.

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.

Rod Pemberton


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.