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
 
Elizabeth D. Rather  
View profile  
 More options Nov 12 2012, 12:57 pm
Newsgroups: comp.lang.forth
From: "Elizabeth D. Rather" <erat...@forth.com>
Date: Mon, 12 Nov 2012 07:57:19 -1000
Local: Mon, Nov 12 2012 12:57 pm
Subject: Re: Words consuming arguments, was [Re: Is there a better way?]
On 11/11/12 11:48 PM, Andrew Haley wrote:

> 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.

> Andrew.

You are right, I wrote that late at night and in haste.

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."
==================================================


 
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.