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:
You are right, I wrote that late at night and in haste.
>> "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
>> 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
> 6.1.0980 COUNT
> ( c-addr1 -- c-addr2 u )
> Return the character string specification for the counted string
>> There is only a requirement that COUNT returns an address to the
> The count precedes the string, as COUNT's glossary entry makes clear.
> Andrew.
Cheers,
-- "Forth-based products and Services for real-time
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.
| ||||||||||||||