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


Groups > comp.lang.forth > #11220 > unrolled thread

:NONAME

Started byMark Wills <markrobertwills@yahoo.co.uk>
First post2012-04-12 13:48 -0700
Last post2012-06-13 08:49 +0000
Articles 20 on this page of 57 — 14 participants

Back to article view | Back to comp.lang.forth


Contents

  :NONAME Mark Wills <markrobertwills@yahoo.co.uk> - 2012-04-12 13:48 -0700
    Re: :NONAME Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2012-04-12 23:08 +0100
    Re: :NONAME Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-04-12 16:53 -0500
      Re: :NONAME The Beez <the.beez.speaks@gmail.com> - 2012-04-12 23:50 -0700
      Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-04-13 05:34 -0700
        Re: :NONAME Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-04-13 08:02 -0500
          Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-04-13 07:26 -0700
    Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-04-12 14:54 -0700
      Re: :NONAME Mark Wills <markrobertwills@yahoo.co.uk> - 2012-04-12 23:58 -0700
        Re: :NONAME "Elizabeth D. Rather" <erather@forth.com> - 2012-04-12 21:11 -1000
          Re: :NONAME Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-04-22 23:13 -0700
        Re: :NONAME Ian Osgood <iano@quirkster.com> - 2012-04-13 04:31 -0700
          Re: :NONAME Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-04-13 19:40 +0000
        Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-04-13 05:15 -0700
        Re: :NONAME Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-04-13 08:00 -0500
          Re: :NONAME Mark Wills <markrobertwills@yahoo.co.uk> - 2012-04-13 06:19 -0700
            Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-04-13 07:33 -0700
    Re: :NONAME "Elizabeth D. Rather" <erather@forth.com> - 2012-04-12 13:54 -1000
      Re: :NONAME "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-04-13 11:54 -0400
        Re: :NONAME Mark Wills <markrobertwills@yahoo.co.uk> - 2012-04-13 10:23 -0700
        Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-04-13 13:02 -0700
        Re: :NONAME Mark Wills <markrobertwills@yahoo.co.uk> - 2012-04-13 13:06 -0700
          Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-04-13 15:57 -0700
          Re: :NONAME Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-04-14 01:05 +0000
          Re: :NONAME "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-04-14 17:23 -0400
            Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-04-14 16:22 -0700
              Re: :NONAME "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-04-15 12:50 -0400
                Re: :NONAME "Elizabeth D. Rather" <erather@forth.com> - 2012-04-15 08:12 -1000
                Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-04-15 11:17 -0700
          Re: :NONAME Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-04-17 16:21 -0700
        Re: :NONAME "Rod Pemberton" <do_not_have@notemailntt.cmm> - 2012-06-01 20:13 -0400
          Re: :NONAME "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-06-01 21:09 -0400
            Re: :NONAME "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-06-01 21:41 -0400
              Re: :NONAME Coos Haak <chforth@hccnet.nl> - 2012-06-02 15:06 +0200
                Re: :NONAME "Rod Pemberton" <do_not_have@notemailntt.cmm> - 2012-06-11 05:42 -0400
                  Re: :NONAME Coos Haak <chforth@hccnet.nl> - 2012-06-11 19:08 +0200
          Re: :NONAME "Rod Pemberton" <do_not_have@notemailntt.cmm> - 2012-06-11 05:46 -0400
            Re: :NONAME Alex McDonald <blog@rivadpm.com> - 2012-06-11 03:46 -0700
            Re: :NONAME Josh Grams <josh@qualdan.com> - 2012-06-11 12:17 +0000
              Re: :NONAME Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-06-12 01:09 +0000
                Re: :NONAME "Rod Pemberton" <do_not_have@notemailntt.cmm> - 2012-06-11 21:39 -0400
                  Re: :NONAME Alex McDonald <blog@rivadpm.com> - 2012-06-12 02:08 -0700
                    Re: :NONAME "Rod Pemberton" <do_not_have@notemailntt.cmm> - 2012-06-12 23:20 -0400
                      Re: :NONAME Alex McDonald <blog@rivadpm.com> - 2012-06-13 00:32 -0700
                      Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-06-13 10:25 -0700
                        Re: :NONAME Coos Haak <chforth@hccnet.nl> - 2012-06-14 19:24 +0200
                          Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-06-15 07:05 -0700
                            Re: :NONAME Coos Haak <chforth@hccnet.nl> - 2012-06-15 20:40 +0200
                              Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-06-15 11:56 -0700
                                Re: :NONAME Coos Haak <chforth@hccnet.nl> - 2012-06-15 21:15 +0200
                                  Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-06-15 12:43 -0700
                        Re: :NONAME "Rod Pemberton" <do_not_have@notemailntt.cmm> - 2012-06-14 20:31 -0400
                          Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-06-15 07:03 -0700
                            Re: :NONAME "Rod Pemberton" <do_not_have@notemailntt.cmm> - 2012-06-19 21:10 -0400
                          Re: :NONAME Coos Haak <chforth@hccnet.nl> - 2012-06-15 20:45 +0200
                Re: :NONAME BruceMcF <agila61@netscape.net> - 2012-06-12 16:00 -0700
                  Re: :NONAME Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-06-13 08:49 +0000

Page 2 of 3 — ← Prev page 1 [2] 3  Next page →


#11272

FromBruceMcF <agila61@netscape.net>
Date2012-04-13 13:02 -0700
Message-ID<9b973321-b14c-4b35-b11a-a25e5c37b46e@h12g2000yqi.googlegroups.com>
In reply to#11260
On Apr 13, 11:54 am, "Rod Pemberton" <do_not_h...@notemailnot.cmm>
wrote:

> You stated that somewhat differently than the other replies and that brings
> up an interesting question.  I.e., I took some of the other replies to
> indicate that :NONAME creates a headerless word.

:NONAME *permits* a system to create a headerless word. It doesn't
*require* a system to create a headerless word. For instance, if your
FIND traps up front for zero length words, you could just create a
header with a 0-length name. You have a redundant dictionary entry
link, but don't have to modify a compiler model that assumes that all
definitions have a dictionary entry.

[toc] | [prev] | [next] | [standalone]


#11273

FromMark Wills <markrobertwills@yahoo.co.uk>
Date2012-04-13 13:06 -0700
Message-ID<cbc60ea8-0362-4436-a4b6-a14b41d78031@w5g2000vbp.googlegroups.com>
In reply to#11260
>   :NONAME XX 1 . ;
>
> Now, I just need to figure out how to automatically fill the name in with
> something ... unless it needs to be headerless too ...
>
> Rod Pemberton

Hopefully you have a word such as HEADER, which takes a string length/
address pair and creates a linked entry in the dictionary. It's a
useful factor for : CREATE CONSTANT VARIABLE et al.

My earlier suggestion of negating the length won't work - it'll break
FIND. Might as well create a word with two spaces as its name... Find
won't find it

[toc] | [prev] | [next] | [standalone]


#11278

FromBruceMcF <agila61@netscape.net>
Date2012-04-13 15:57 -0700
Message-ID<99830270-6b36-48da-af57-f1299375529f@35g2000yqq.googlegroups.com>
In reply to#11273
On Apr 13, 4:06 pm, Mark Wills <markrobertwi...@yahoo.co.uk> wrote:
> >   :NONAME XX 1 . ;
>
> > Now, I just need to figure out how to automatically fill the name in with
> > something ... unless it needs to be headerless too ...
>
> > Rod Pemberton
>
> Hopefully you have a word such as HEADER, which takes a string length/
> address pair and creates a linked entry in the dictionary. It's a
> useful factor for : CREATE CONSTANT VARIABLE et al.

> My earlier suggestion of negating the length won't work - it'll break
> FIND. Might as well create a word with two spaces as its name... Find
> won't find it

Wrapping a FIND (or equivalent) that does not trap zero-length strings
to fail immediately on a zero-length string is straightforward:

: FIND ( c-addr -- c-addr 0  |  xt 1  |  xt -1 )
   DUP C@ IF FIND EXIT THEN 0 ;

Then as long as HEADER when presented with a nul string stores the
length but does not attempt to fetch any text ...
   0 0 HEADER

... when :NONAME is being defined.

[toc] | [prev] | [next] | [standalone]


#11280

FromAlbert van der Horst <albert@spenarnc.xs4all.nl>
Date2012-04-14 01:05 +0000
Message-ID<m2g31e.37d@spenarnc.xs4all.nl>
In reply to#11273
In article <cbc60ea8-0362-4436-a4b6-a14b41d78031@w5g2000vbp.googlegroups.com>,
Mark Wills  <markrobertwills@yahoo.co.uk> wrote:
>
>> =A0 :NONAME XX 1 . ;
>>
>> Now, I just need to figure out how to automatically fill the name in with
>> something ... unless it needs to be headerless too ...
>>
>> Rod Pemberton
>
>Hopefully you have a word such as HEADER, which takes a string length/
>address pair and creates a linked entry in the dictionary. It's a
>useful factor for : CREATE CONSTANT VARIABLE et al.
>
>My earlier suggestion of negating the length won't work - it'll break
>FIND. Might as well create a word with two spaces as its name... Find
>won't find it
>

The non-tricky thing to do it is to just call it `` NONAME ''.
Then do `` LATEST HIDDEN '' such that the entry is ignored because
of a flag in the header.  (Or you may have SMUDGE )

Groetjes Albert

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#11293

From"Rod Pemberton" <do_not_have@notemailnot.cmm>
Date2012-04-14 17:23 -0400
Message-ID<jmcpsa$fq2$1@speranza.aioe.org>
In reply to#11273
"Mark Wills" <markrobertwills@yahoo.co.uk> wrote in message
news:cbc60ea8-0362-4436-a4b6-a14b41d78031@w5g2000vbp.googlegroups.com...
> RP wrote:
...

> > Now, I just need to figure out how to automatically fill the name in
> > with something ... unless it needs to be headerless too ...
>
> Hopefully you have a word such as HEADER, which takes a string
> length/ address pair and creates a linked entry in the dictionary. It's a
> useful factor for : CREATE CONSTANT VARIABLE et al.

CREATE and : (colon) use (CREATE) .  fig-Forth uses CREATE directly in :
(colon) .  For some reason, mine uses (CREATE) and either ENTER compiled for
: (colon) or DOVAR compiled for CREATE ...  It may be because of the
definitions I chose to use for VARIABLE and CONSTANT .  I've been meaning to
look into why exactly and also figure out why fig-Forth is different here.
It's like (CREATE) really should be CREATE ...

CONSTANT VARIABLE VALUE 2CONSTANT 2VARIABLE SET use CREATE
directly.  DEFER will too, if I decide it's definition is useful.

> My earlier suggestion of negating the length won't work - it'll break
> FIND. Might as well create a word with two spaces as its name... Find
> won't find it

:-)

As Albert van der Horst pointed out, we could've used SMUDGE.  Sigh ...
I guess I'll have to keep it in mind to find out which is trivially quicker.


Rod Pemberton

[toc] | [prev] | [next] | [standalone]


#11297

FromBruceMcF <agila61@netscape.net>
Date2012-04-14 16:22 -0700
Message-ID<0a0b2095-bab4-41c4-b674-3cc03cec6d67@9g2000yqp.googlegroups.com>
In reply to#11293
On Apr 14, 5:23 pm, "Rod Pemberton" <do_not_h...@notemailnot.cmm>
wrote:

> CREATE and : (colon) use (CREATE)

I don't see (CREATE) in either the z80 or 6502 fig-forth assembly
listing ~ what is its stack picture?

>> My earlier suggestion of negating the length won't work - it'll break
>> FIND. Might as well create a word with two spaces as its name... Find
>> won't find it

Why two spaces?

CREATE SPACE$ 1 C, 32 C,
: noname ( -- ca u ) SPACE$ COUNT ;

... there's a noname for :NONAME that would only use one.

[toc] | [prev] | [next] | [standalone]


#11321

From"Rod Pemberton" <do_not_have@notemailnot.cmm>
Date2012-04-15 12:50 -0400
Message-ID<jmeu8t$75f$1@speranza.aioe.org>
In reply to#11297
"BruceMcF" <agila61@netscape.net> wrote in message
news:0a0b2095-bab4-41c4-b674-3cc03cec6d67@9g2000yqp.googlegroups.com...
> On Apr 14, 5:23 pm, "Rod Pemberton" <do_not_h...@notemailnot.cmm>
> wrote:
...

> > CREATE and : (colon) use (CREATE)
>
> I don't see (CREATE) in either the z80 or 6502 fig-forth
> assembly listing ~ what is its stack picture?

Ok, I wasn't clear enough ...

fig-Forth only uses CREATE .  My CREATE and my : (colon) call (CREATE) with
a compiled DOVAR or ENTER , respectively.  I was trying to figure out why my
CREATE is "split".  I.e., fig-Forth must be compiling only a DOVAR or only a
ENTER/DOCOL, but not both.  I'm selectively compiling one or the other.
Why?

> >> My earlier suggestion of negating the length won't work
> >> - it'll break FIND. Might as well create a word with two
> >> spaces as its name... Find won't find it
>
> Why two spaces?
>

I don't know.  That was Mark Wills who said that.  I'd suspect that either
1) he has a minimum name length issue or 2) he is using a 16-bit Forth and
must write at least 16-bits at a time.


Rod Pemberton



[toc] | [prev] | [next] | [standalone]


#11328

From"Elizabeth D. Rather" <erather@forth.com>
Date2012-04-15 08:12 -1000
Message-ID<SPadnds9gOsGkhbSnZ2dnUVZ_r2dnZ2d@supernews.com>
In reply to#11321
On 4/15/12 6:50 AM, Rod Pemberton wrote:
> "BruceMcF"<agila61@netscape.net>  wrote in message
> news:0a0b2095-bab4-41c4-b674-3cc03cec6d67@9g2000yqp.googlegroups.com...
>> On Apr 14, 5:23 pm, "Rod Pemberton"<do_not_h...@notemailnot.cmm>
>> wrote:
> ...
>
>>> CREATE and : (colon) use (CREATE)
>>
>> I don't see (CREATE) in either the z80 or 6502 fig-forth
>> assembly listing ~ what is its stack picture?
>
> Ok, I wasn't clear enough ...
>
> fig-Forth only uses CREATE .  My CREATE and my : (colon) call (CREATE) with
> a compiled DOVAR or ENTER , respectively.  I was trying to figure out why my
> CREATE is "split".  I.e., fig-Forth must be compiling only a DOVAR or only a
> ENTER/DOCOL, but not both.  I'm selectively compiling one or the other.
> Why?

If I'm not mistaken (I'm no expert on figForth) it's because they had 
<BUILDS ... DOES> for making defining words, which was a different (and 
far less efficient factoring).  When CREATE ... DOES> was adopted, the 
figForth CREATE had to be factored differently, hence (CREATE) for the 
sharable factor that constructs the basic dictionary entry.

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

[toc] | [prev] | [next] | [standalone]


#11329

FromBruceMcF <agila61@netscape.net>
Date2012-04-15 11:17 -0700
Message-ID<a3c11a06-d823-455e-88cc-2adcf4a0df1c@f17g2000yqj.googlegroups.com>
In reply to#11321
On Apr 15, 12:50 pm, "Rod Pemberton" <do_not_h...@notemailnot.cmm>
wrote:
> fig-Forth only uses CREATE .  My CREATE and my : (colon) call (CREATE) with
> a compiled DOVAR or ENTER , respectively.  I was trying to figure out why
> my CREATE is "split".  I.e., fig-Forth must be compiling only a DOVAR or
> only a ENTER/DOCOL, but not both.  I'm selectively compiling one or the
> other.
> Why?

Part of updating fig Forth to support CREATE DOES> maybe?

[toc] | [prev] | [next] | [standalone]


#11370

FromHugh Aguilar <hughaguilar96@yahoo.com>
Date2012-04-17 16:21 -0700
Message-ID<9dc1418b-31cb-4424-aefe-0f6cec1b0f90@p6g2000yqi.googlegroups.com>
In reply to#11273
On Apr 13, 2:06 pm, Mark Wills <markrobertwi...@yahoo.co.uk> wrote:
> Hopefully you have a word such as HEADER, which takes a string length/
> address pair and creates a linked entry in the dictionary. It's a
> useful factor for : CREATE CONSTANT VARIABLE et al.

That is what my :NAME does --- the Forth-200x committee hated it and
refused to standardize any such thing.

I agree that it makes sense to standardize low-level words such
as :NAME, and to then define the high-level words (colon, etc.) in
terms of the low-level words. As it stands however, colon is defined,
but :NAME is not defined --- in my novice package I have to
define :NAME in terms of colon by constructing a string and then
giving that string to EVALUATE --- this turns the concept of factoring
completely upside-down!

Anton Ertl said that :NAME was trivial to implement in ANS-Forth
(using string construction and EVALUATE) and hence was something that
application programmers could do themselves --- but that there would
be no standard way to do it, so it would be different for everybody
that implemented it --- he's hoping that, given a mish-mash of
incompatible implementations, the casual Forth community will be
discouraged from adopting *any* implementation. Anton Ertl's plan is
to defeat the general Forth community through balkanization, but to
promote Forth Inc. by standardizing everything in SwiftForth
(including trivialities such as BUFFER:) so that SwiftForth
effectively becomes the standard.

Note that when you call it HEADER, and you require an adr/cnt pair,
you are not compatible with my :NAME --- this is the balkanization
that Anton Ertl was hoping for. I don't really care if it is called
HEADER or :NAME (I actually used HEADER originally), or about other
details --- but I do think that it would be a good idea for everybody
to be compatible rather than to differ in trivial details such as the
name of the word.

This is my :NAME word:

: :name ( str wid -- )
    get-current >r  set-current
    <cstr
    c" : " +cstr  +cstr  c"  " +cstr
    cstr> count  evaluate
    r> set-current ;

This depends upon <CSTR for string construction. All of this is in the
novice package:
http://www.forth.org/novice.html
Note that "wid" is the ANS-Forth term for "word-list identifier" ---
basically a vocabulary number.

[toc] | [prev] | [next] | [standalone]


#12659

From"Rod Pemberton" <do_not_have@notemailntt.cmm>
Date2012-06-01 20:13 -0400
Message-ID<jqblpa$au0$1@speranza.aioe.org>
In reply to#11260
"Rod Pemberton" <do_not_have@notemailnot.cmm> wrote in message
news:jm9i7n$u44$1@speranza.aioe.org...
> "Elizabeth D. Rather" <erather@forth.com> wrote in message
> news:LOOdnQg-lPDU9hrSnZ2dnUVZ_rOdnZ2d@supernews.com...
> > On 4/12/12 10:48 AM, Mark Wills wrote:
> > > [asked about :NONAME]
> >
> > As others have pointed out, the code very definitely goes in the
> > dictionary and is there permanently (unless discarded by, e.g., MARKER).
> > HERE will be modified if the implementation combines code and data
> > space. LATEST will definitely change.  In other words, this is a
> > definition like any other colon definition except that it does not have
> > a FINDable name; access is only through its xt.
> >
>
> "... except that it does not have a FINDable name ..."
>
> Interesting...
>
> You stated that somewhat differently than the other replies and that
> brings up an interesting question.  I.e., I took some of the other replies
> to indicate that :NONAME creates a headerless word.   However, your reply
> indicates it only needs to be unFINDable.  I see no requirement in ANS
> that :NONAME words be headerless.  So, if a name field is empty for a
> normal : (colon) definition, then the word is not findable even though
> the name field itself is still present.  (yes?)  So, is it possible to
> define :NONAME using : (colon) and then clear out the name field
> afterwards?  E.g., after : (colon) definition has called CREATE it should
> be possible to use LATEST and >NAME and FILL to wipe the name.
> Alternately, maybe :NONAME should be defined using CREATE ...  E.g.,
> I'd probably attempt to start with a rough definition somewhat like so,
> just guessing:
>
>   : :NONAME : LATEST >NAME COUNT FILL ;
>
> In fact, with one remaining error, this works for my Forth (with LAST
> instead of LATEST):
>
>   : :NONAME : LAST @ LINK> DUP >NAME DUP BL SWAP C!
> CHAR+ 0 SWAP C! ;
>
> "LAST @ LINK>" gets the CFA, i.e., "xt", and DUP leaves a copy for "xt" on
> the stack, as required.  >NAME gets the NFA.  The rest clears the name.
> I'm using C style null-terminated strings, not counted strings like nearly
> ever[y] Forth.  So, it writes a space and zero to clear the name string.
> You'd have to write a count of one and a space, and remove the zero char
> code if modifying it for a normal Forth.
>
> The remaining error, which I think is fixable, is that it still needs a
> name.
>
> I.e., instead of:
>   :NONAME 1 . ;
>
> It needs, using XX for the name:
>   :NONAME XX 1 . ;
>
> Now, I just need to figure out how to automatically fill the name in with
> something ... unless it needs to be headerless too ...
>

Apparently, the solution is to not create the header in the first place ...
I.e., headerless.

It seems that that's done by using the definition for : (colon) but
replacing CREATE or (CREATE) with HERE.


In my case, : (colon) is (written in high-level Forth):

: : (CREATE) COMPILE ENTER ] SMUDGE ;

So, :NONAME becomes:

: :NONAME HERE COMPILE ENTER ] SMUDGE ;

Or, if replacing COMPILE with LIT <word> , (comma) sequence:

: :NONAME HERE LIT ENTER , ] SMUDGE ;


Rod Pemberton


[toc] | [prev] | [next] | [standalone]


#12660

From"Rod Pemberton" <do_not_have@notemailnot.cmm>
Date2012-06-01 21:09 -0400
Message-ID<jqbp3b$hrq$1@speranza.aioe.org>
In reply to#12659
"Rod Pemberton" <do_not_have@notemailntt.cmm> wrote in message
news:jqblpa$au0$1@speranza.aioe.org...
> "Rod Pemberton" <do_not_have@notemailnot.cmm> wrote in message
> news:jm9i7n$u44$1@speranza.aioe.org...
> > "Elizabeth D. Rather" <erather@forth.com> wrote in message
> > news:LOOdnQg-lPDU9hrSnZ2dnUVZ_rOdnZ2d@supernews.com...
> > > On 4/12/12 10:48 AM, Mark Wills wrote:
> > > > [asked about :NONAME]
> > >
> > > As others have pointed out, the code very definitely goes in the
> > > dictionary and is there permanently (unless discarded by, e.g.,
> > > MARKER). HERE will be modified if the implementation
> > > combines code and data space. LATEST will definitely change.
> > > In other words, this is a definition like any other colon definition
> > > except that it does not have a FINDable name; access is only
> > > through its xt.
> >
> > "... except that it does not have a FINDable name ..."
> >
> > Interesting...
> >
> > You stated that somewhat differently than the other replies and that
> > brings up an interesting question.  I.e., I took some of the other
> > replies to indicate that :NONAME creates a headerless word.
> > However, your reply indicates it only needs to be unFINDable.
> > I see no requirement in ANS that :NONAME words be headerless.
> > So, if a name field is empty for a normal : (colon) definition, then
> > the word is not findable even though the name field itself is still
> > present.  (yes?)  So, is it possible to define :NONAME using
> > : (colon) and then clear out the name field afterwards?  E.g.,
> > after : (colon) definition has called CREATE it should
> > be possible to use LATEST and >NAME and FILL to wipe the name.
> > Alternately, maybe :NONAME should be defined using CREATE ...  E.g.,
> > I'd probably attempt to start with a rough definition somewhat like so,
> > just guessing:
> >
> >   : :NONAME : LATEST >NAME COUNT FILL ;
> >
> > In fact, with one remaining error, this works for my Forth (with LAST
> > instead of LATEST):
> >
> >   : :NONAME : LAST @ LINK> DUP >NAME DUP BL SWAP C!
> > CHAR+ 0 SWAP C! ;
> >
> > "LAST @ LINK>" gets the CFA, i.e., "xt", and DUP leaves a copy for "xt"
> > on the stack, as required.  >NAME gets the NFA.  The rest clears the
> > name.  I'm using C style null-terminated strings, not counted strings
> > like nearly ever[y] Forth.  So, it writes a space and zero to clear the
> > name string.  You'd have to write a count of one and a space, and
> > remove the zero char code if modifying it for a normal Forth.
> >
> > The remaining error, which I think is fixable, is that it still needs a
> > name.
> >
> > I.e., instead of:
> >   :NONAME 1 . ;
> >
> > It needs, using XX for the name:
> >   :NONAME XX 1 . ;
> >
> > Now, I just need to figure out how to automatically fill the name in
> > with something ... unless it needs to be headerless too ...
> >
>
> Apparently, the solution is to not create the header in the first place
> ... I.e., headerless.
>
> It seems that that's done by using the definition for : (colon) but
> replacing CREATE or (CREATE) with HERE.
>
>
> In my case, : (colon) is (written in high-level Forth):
>
> : : (CREATE) COMPILE ENTER ] SMUDGE ;
>
> So, :NONAME becomes:
>
> : :NONAME HERE COMPILE ENTER ] SMUDGE ;
>
> Or, if replacing COMPILE with LIT <word> , (comma) sequence:
>
> : :NONAME HERE LIT ENTER , ] SMUDGE ;
>

Well, it's got no header any longer, so it shouldn't need SMUDGE anymore...

Fortunately, the way I wrote SMUDGE it doesn't corrupt the body of the prior
word in the dictionary.  It will SMUDGE the last valid definition with a
header via LAST, though.  So, that's not good, but not serious, and quickly
fixable...


Rod Pemberton

[toc] | [prev] | [next] | [standalone]


#12661

From"Rod Pemberton" <do_not_have@notemailnot.cmm>
Date2012-06-01 21:41 -0400
Message-ID<jqbqua$lec$1@speranza.aioe.org>
In reply to#12660
"Rod Pemberton" <do_not_have@notemailnot.cmm> wrote in message
news:jqbp3b$hrq$1@speranza.aioe.org...
> "Rod Pemberton" <do_not_have@notemailntt.cmm> wrote in message
> news:jqblpa$au0$1@speranza.aioe.org...
> > "Rod Pemberton" <do_not_have@notemailnot.cmm> wrote in message
> > news:jm9i7n$u44$1@speranza.aioe.org...
> > > "Elizabeth D. Rather" <erather@forth.com> wrote in message
> > > news:LOOdnQg-lPDU9hrSnZ2dnUVZ_rOdnZ2d@supernews.com...
> > > > On 4/12/12 10:48 AM, Mark Wills wrote:
> > > > > [asked about :NONAME]
> > > >
> > > > As others have pointed out, the code very definitely goes in the
> > > > dictionary and is there permanently (unless discarded by, e.g.,
> > > > MARKER). HERE will be modified if the implementation
> > > > combines code and data space. LATEST will definitely change.
> > > > In other words, this is a definition like any other colon definition
> > > > except that it does not have a FINDable name; access is only
> > > > through its xt.
> > >
> > > "... except that it does not have a FINDable name ..."
> > >
> > > Interesting...
> > >
> > > You stated that somewhat differently than the other replies and that
> > > brings up an interesting question.  I.e., I took some of the other
> > > replies to indicate that :NONAME creates a headerless word.
> > > However, your reply indicates it only needs to be unFINDable.
> > > I see no requirement in ANS that :NONAME words be headerless.
> > > So, if a name field is empty for a normal : (colon) definition, then
> > > the word is not findable even though the name field itself is still
> > > present.  (yes?)  So, is it possible to define :NONAME using
> > > : (colon) and then clear out the name field afterwards?  E.g.,
> > > after : (colon) definition has called CREATE it should
> > > be possible to use LATEST and >NAME and FILL to wipe the name.
> > > Alternately, maybe :NONAME should be defined using CREATE ...  E.g.,
> > > I'd probably attempt to start with a rough definition somewhat like
> > > so, just guessing:
> > >
> > >   : :NONAME : LATEST >NAME COUNT FILL ;
> > >
> > > In fact, with one remaining error, this works for my Forth (with LAST
> > > instead of LATEST):
> > >
> > >   : :NONAME : LAST @ LINK> DUP >NAME DUP BL SWAP C!
> > > CHAR+ 0 SWAP C! ;
> > >
> > > "LAST @ LINK>" gets the CFA, i.e., "xt", and DUP leaves a copy for
> > > "xt" on the stack, as required.  >NAME gets the NFA.  The rest clears
> > > the name.  I'm using C style null-terminated strings, not counted
> > > strings like nearly ever[y] Forth.  So, it writes a space and zero to
> > > clear the name string.  You'd have to write a count of one and a
> > > space, and remove the zero char code if modifying it for a normal
> > > Forth.
> > >
> > > The remaining error, which I think is fixable, is that it still needs
> > > a name.
> > >
> > > I.e., instead of:
> > >   :NONAME 1 . ;
> > >
> > > It needs, using XX for the name:
> > >   :NONAME XX 1 . ;
> > >
> > > Now, I just need to figure out how to automatically fill the name in
> > > with something ... unless it needs to be headerless too ...
> > >
> >
> > Apparently, the solution is to not create the header in the first place
> > ... I.e., headerless.
> >
> > It seems that that's done by using the definition for : (colon) but
> > replacing CREATE or (CREATE) with HERE.
> >
> >
> > In my case, : (colon) is (written in high-level Forth):
> >
> > : : (CREATE) COMPILE ENTER ] SMUDGE ;
> >
> > So, :NONAME becomes:
> >
> > : :NONAME HERE COMPILE ENTER ] SMUDGE ;
> >
> > Or, if replacing COMPILE with LIT <word> , (comma) sequence:
> >
> > : :NONAME HERE LIT ENTER , ] SMUDGE ;
> >
>
> Well, it's got no header any longer, so it shouldn't need SMUDGE
> anymore...
>
> Fortunately, the way I wrote SMUDGE it doesn't corrupt the body of the
> prior word in the dictionary.  It will SMUDGE the last valid definition
> with a header via LAST, though.  So, that's not good, but not serious, and
> quickly fixable...
>

Unfortunately, ; (semicol) will still SMUDGE.  SMUDGE needs to be paired,
but SMUDGE is no longer paired with the SMUDGE in ; (semicol) if :NONAME has
no SMUDGE.  Let's see what happens.

a)  : (colon) and ; (semicol)
: (colon) will SMUDGE the current definition.
; (semicol) will SMUDGE the current definition.
SMUDGE is paired.
For this situation, it doesn't matter if SMUDGE sets or toggles.

b) :NONAME with SMUDGE and ; (semicol)
:NONAME with SMUDGE will SMUDGE the last definition with a header.
; (semicol) will SMUDGE the last definition with a header.
SMUDGE is paired.
For this situation, it doesn't matter if SMUDGE sets or toggles.

c) :NONAME without SMUDGE and ; (semicol)
:NONAME without SMUDGE won't SMUDGE.
; (semicol) will SMUDGE the last definition with a header.
SMUDGE is not paired.  It's only in ; (semicol).
A SMUDGE which sets won't corrupt the state of SMUDGE.
A SMUDGE which toggles will corrupt the state of SMUDGE.

I recently asked about SMUDGE setting or toggling.  Apparently, the
introduction of :NONAME created a situation where setting may be preferred
to toggling.  Alternately, keeping SMUDGE in :NONAME should work too.


Rod Pemberton


[toc] | [prev] | [next] | [standalone]


#12663

FromCoos Haak <chforth@hccnet.nl>
Date2012-06-02 15:06 +0200
Message-ID<1aemzp8elrrl1.h3f7miwi4xs6.dlg@40tude.net>
In reply to#12661
Op Fri, 1 Jun 2012 21:41:18 -0400 schreef Rod Pemberton:

> "Rod Pemberton" <do_not_have@notemailnot.cmm> wrote in message
> news:jqbp3b$hrq$1@speranza.aioe.org...
>> "Rod Pemberton" <do_not_have@notemailntt.cmm> wrote in message
>> news:jqblpa$au0$1@speranza.aioe.org...
>>> "Rod Pemberton" <do_not_have@notemailnot.cmm> wrote in message
>>> news:jm9i7n$u44$1@speranza.aioe.org...
>>> > "Elizabeth D. Rather" <erather@forth.com> wrote in message
>>> > news:LOOdnQg-lPDU9hrSnZ2dnUVZ_rOdnZ2d@supernews.com...
>>> > > On 4/12/12 10:48 AM, Mark Wills wrote:
>>> > > > [asked about :NONAME]
>>> > >
>>> > > As others have pointed out, the code very definitely goes in the
>>> > > dictionary and is there permanently (unless discarded by, e.g.,
>>> > > MARKER). HERE will be modified if the implementation
>>> > > combines code and data space. LATEST will definitely change.
>>> > > In other words, this is a definition like any other colon definition
>>> > > except that it does not have a FINDable name; access is only
>>> > > through its xt.
>>> >
>>> > "... except that it does not have a FINDable name ..."
>>> >
>>> > Interesting...
>>> >
>>> > You stated that somewhat differently than the other replies and that
>>> > brings up an interesting question.  I.e., I took some of the other
>>> > replies to indicate that :NONAME creates a headerless word.
>>> > However, your reply indicates it only needs to be unFINDable.
>>> > I see no requirement in ANS that :NONAME words be headerless.
>>> > So, if a name field is empty for a normal : (colon) definition, then
>>> > the word is not findable even though the name field itself is still
>>> > present.  (yes?)  So, is it possible to define :NONAME using
>>> > : (colon) and then clear out the name field afterwards?  E.g.,
>>> > after : (colon) definition has called CREATE it should
>>> > be possible to use LATEST and >NAME and FILL to wipe the name.
>>> > Alternately, maybe :NONAME should be defined using CREATE ...  E.g.,
>>> > I'd probably attempt to start with a rough definition somewhat like
>>> > so, just guessing:
>>> >
>>> >   : :NONAME : LATEST >NAME COUNT FILL ;
>>> >
>>> > In fact, with one remaining error, this works for my Forth (with LAST
>>> > instead of LATEST):
>>> >
>>> >   : :NONAME : LAST @ LINK> DUP >NAME DUP BL SWAP C!
>>> > CHAR+ 0 SWAP C! ;
>>> >
>>> > "LAST @ LINK>" gets the CFA, i.e., "xt", and DUP leaves a copy for
>>> > "xt" on the stack, as required.  >NAME gets the NFA.  The rest clears
>>> > the name.  I'm using C style null-terminated strings, not counted
>>> > strings like nearly ever[y] Forth.  So, it writes a space and zero to
>>> > clear the name string.  You'd have to write a count of one and a
>>> > space, and remove the zero char code if modifying it for a normal
>>> > Forth.
>>> >
>>> > The remaining error, which I think is fixable, is that it still needs
>>> > a name.
>>> >
>>> > I.e., instead of:
>>> >   :NONAME 1 . ;
>>> >
>>> > It needs, using XX for the name:
>>> >   :NONAME XX 1 . ;
>>> >
>>> > Now, I just need to figure out how to automatically fill the name in
>>> > with something ... unless it needs to be headerless too ...
>>> >
>>>
>>> Apparently, the solution is to not create the header in the first place
>>> ... I.e., headerless.
>>>
>>> It seems that that's done by using the definition for : (colon) but
>>> replacing CREATE or (CREATE) with HERE.
>>>
>>>
>>> In my case, : (colon) is (written in high-level Forth):
>>>
>>> : : (CREATE) COMPILE ENTER ] SMUDGE ;
>>>
>>> So, :NONAME becomes:
>>>
>>> : :NONAME HERE COMPILE ENTER ] SMUDGE ;
>>>
>>> Or, if replacing COMPILE with LIT <word> , (comma) sequence:
>>>
>>> : :NONAME HERE LIT ENTER , ] SMUDGE ;
>>>
>>
>> Well, it's got no header any longer, so it shouldn't need SMUDGE
>> anymore...
>>
>> Fortunately, the way I wrote SMUDGE it doesn't corrupt the body of the
>> prior word in the dictionary.  It will SMUDGE the last valid definition
>> with a header via LAST, though.  So, that's not good, but not serious, and
>> quickly fixable...
>>
> 
> Unfortunately, ; (semicol) will still SMUDGE.  SMUDGE needs to be paired,
> but SMUDGE is no longer paired with the SMUDGE in ; (semicol) if :NONAME has
> no SMUDGE.  Let's see what happens.
> 
> a)  : (colon) and ; (semicol)
>: (colon) will SMUDGE the current definition.
> ; (semicol) will SMUDGE the current definition.
> SMUDGE is paired.
> For this situation, it doesn't matter if SMUDGE sets or toggles.
> 
> b) :NONAME with SMUDGE and ; (semicol)
>:NONAME with SMUDGE will SMUDGE the last definition with a header.
> ; (semicol) will SMUDGE the last definition with a header.
> SMUDGE is paired.
> For this situation, it doesn't matter if SMUDGE sets or toggles.
> 
> c) :NONAME without SMUDGE and ; (semicol)
>:NONAME without SMUDGE won't SMUDGE.
> ; (semicol) will SMUDGE the last definition with a header.
> SMUDGE is not paired.  It's only in ; (semicol).
> A SMUDGE which sets won't corrupt the state of SMUDGE.
> A SMUDGE which toggles will corrupt the state of SMUDGE.
> 
> I recently asked about SMUDGE setting or toggling.  Apparently, the
> introduction of :NONAME created a situation where setting may be preferred
> to toggling.  Alternately, keeping SMUDGE in :NONAME should work too.
> 
> 
> Rod Pemberton

Can't you use a word that HIDE a definition and REVEAL it when needed. They
may be implemented by resetting of setting a flag in the header (or
breaking and making a link, as I do) respectively.

Get rid of that antique and hopelessly disturbing word SMUDGE that may set
or reset a bit but also can toggle a bit. There is not a recent standard in
sight that defines SMUDGE.

My :NONAME does not make a header, it only generates an xt (or cfa as
want).

-- 
Coos

CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html 

[toc] | [prev] | [next] | [standalone]


#12872

From"Rod Pemberton" <do_not_have@notemailntt.cmm>
Date2012-06-11 05:42 -0400
Message-ID<jr4eg2$r6o$1@speranza.aioe.org>
In reply to#12663
"Coos Haak" <chforth@hccnet.nl> wrote in message
news:1aemzp8elrrl1.h3f7miwi4xs6.dlg@40tude.net...
> Op Fri, 1 Jun 2012 21:41:18 -0400 schreef Rod Pemberton:
...

> > [snip]
>
> My :NONAME does not make a header, it only generates an xt
> (or cfa as want).

Does your :NONAME work with RECURSE?


Rod Pemberton


[toc] | [prev] | [next] | [standalone]


#12894

FromCoos Haak <chforth@hccnet.nl>
Date2012-06-11 19:08 +0200
Message-ID<1c3kb27wrtm9q$.1glb301r478ty$.dlg@40tude.net>
In reply to#12872
Op Mon, 11 Jun 2012 05:42:25 -0400 schreef Rod Pemberton:

> "Coos Haak" <chforth@hccnet.nl> wrote in message
> news:1aemzp8elrrl1.h3f7miwi4xs6.dlg@40tude.net...
>> Op Fri, 1 Jun 2012 21:41:18 -0400 schreef Rod Pemberton:
> ...
> 
>>> [snip]
>>
>> My :NONAME does not make a header, it only generates an xt
>> (or cfa as want).
> 
> Does your :NONAME work with RECURSE?
> 
> 
> Rod Pemberton

Of course, Alex McDonald and Josh Grams give the reason why.

-- 
Coos

CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html 

[toc] | [prev] | [next] | [standalone]


#12873

From"Rod Pemberton" <do_not_have@notemailntt.cmm>
Date2012-06-11 05:46 -0400
Message-ID<jr4enb$rug$1@speranza.aioe.org>
In reply to#12659
"Rod Pemberton" <do_not_have@notemailntt.cmm> wrote in message
news:jqblpa$au0$1@speranza.aioe.org...
> "Rod Pemberton" <do_not_have@notemailnot.cmm> wrote in message
> news:jm9i7n$u44$1@speranza.aioe.org...

[snip]

> > I.e., I took some of the other replies to indicate that :NONAME
> > creates a headerless word.   However, [ER's] reply indicates it only
> > needs to be unFINDable.  I see no requirement in ANS
> > that :NONAME words be headerless.
> >
> > [RP solution]
> >
>
> Apparently, the solution is to not create the header in the first place
> ... I.e., headerless.
>

Well, *that* doesn't work...

If LAST is used to provide the xt for RECURSE, then LAST needs to work for
both : (colon) and :NONAME words, not just : (colon) words.  That means
:NONAME words need to have LAST set to them too.  If LAST is also used in
locating dictionary fields and initiating searches, then :NONAME words need
a correctly linked header too.  A header also ensures SMUDGE on :NONAME
words, if LAST can point to :NONAME words, doesn't corrupt prior dictionary
data.

So, in order to make :NONAME work for my interpreter, *all* of the following
things must work together:

1) :NONAME
2) RECURSE
3) LAST
4) SMUDGE(s)

To do that, a fake or "dummy" header must be constructed for :NONAME words.
If RECURSE in :NONAME words is unnecessary, then no header is needed, i.e.,
truly headerless instead of faked headerless via a blank name or SMUDGE bit.


Rod Pemberton




[toc] | [prev] | [next] | [standalone]


#12875

FromAlex McDonald <blog@rivadpm.com>
Date2012-06-11 03:46 -0700
Message-ID<50c16c9d-0032-4d4d-9037-95e264a65c70@fr28g2000vbb.googlegroups.com>
In reply to#12873
On Jun 11, 5:46 am, "Rod Pemberton" <do_not_h...@notemailntt.cmm>
wrote:
> "Rod Pemberton" <do_not_h...@notemailntt.cmm> wrote in message
>
> news:jqblpa$au0$1@speranza.aioe.org...
>
> > "Rod Pemberton" <do_not_h...@notemailnot.cmm> wrote in message
> >news:jm9i7n$u44$1@speranza.aioe.org...
>
> [snip]
>
> > > I.e., I took some of the other replies to indicate that :NONAME
> > > creates a headerless word.   However, [ER's] reply indicates it only
> > > needs to be unFINDable.  I see no requirement in ANS
> > > that :NONAME words be headerless.
>
> > > [RP solution]
>
> > Apparently, the solution is to not create the header in the first place
> > ... I.e., headerless.
>
> Well, *that* doesn't work...
>
> If LAST is used to provide the xt for RECURSE, then LAST needs to work for
> both : (colon) and :NONAME words, not just : (colon) words.  That means
> :NONAME words need to have LAST set to them too.  If LAST is also used in
> locating dictionary fields and initiating searches, then :NONAME words need
> a correctly linked header too.  A header also ensures SMUDGE on :NONAME
> words, if LAST can point to :NONAME words, doesn't corrupt prior dictionary
> data.
>
> So, in order to make :NONAME work for my interpreter, *all* of the following
> things must work together:
>
> 1) :NONAME
> 2) RECURSE
> 3) LAST
> 4) SMUDGE(s)
>
> To do that, a fake or "dummy" header must be constructed for :NONAME words.
> If RECURSE in :NONAME words is unnecessary, then no header is needed, i.e.,
> truly headerless instead of faked headerless via a blank name or SMUDGE bit.
>
> Rod Pemberton

One solution is to have LAST-NAMED-XT and LATEST-XT (or whatever you
wish to call them).

All words that generate a named XT (such as CREATE : and so on) set
both LATEST-XT and LAST-NAMED-XT; then IMMEDIATE and those words that
only work on words with headers utilise LAST-NAMED-XT.

:NONAME only sets LATEST-XT. Words that work with either named or
headerless words such as RECURSE use LATEST-XT. This is the approach
taken by Win32Forth where :NONAMEs are headerless.

: X ... recurse ( uses LATEST-XT ) ;
:noname ... recurse ( uses LATEST-XT ) ; immediate ( uses LAST-NAMED-
XT and acts on X )

[toc] | [prev] | [next] | [standalone]


#12877

FromJosh Grams <josh@qualdan.com>
Date2012-06-11 12:17 +0000
Message-ID<4fd5e1f0$0$6615$882e7ee2@usenet-news.net>
In reply to#12873
Rod Pemberton wrote: <jr4enb$rug$1@speranza.aioe.org>
> In order to make :NONAME work for my interpreter, *all* of the following
> things must work together:
>
> 1) :NONAME
> 2) RECURSE
> 3) LAST
> 4) SMUDGE(s)
>
> To do that, a fake or "dummy" header must be constructed for :NONAME words.
> If RECURSE in :NONAME words is unnecessary, then no header is needed, i.e.,
> truly headerless instead of faked headerless via a blank name or SMUDGE bit.

RECURSE just needs the address of the code, so if you separate that from
LAST then you can get away without a dummy header.

--Josh

[toc] | [prev] | [next] | [standalone]


#12910

FromAlbert van der Horst <albert@spenarnc.xs4all.nl>
Date2012-06-12 01:09 +0000
Message-ID<m5hckc.1ee@spenarnc.xs4all.nl>
In reply to#12877
In article <4fd5e1f0$0$6615$882e7ee2@usenet-news.net>,
Josh Grams  <josh@qualdan.com> wrote:
>Rod Pemberton wrote: <jr4enb$rug$1@speranza.aioe.org>
>> In order to make :NONAME work for my interpreter, *all* of the following
>> things must work together:
>>
>> 1) :NONAME
>> 2) RECURSE
>> 3) LAST
>> 4) SMUDGE(s)
>>
>> To do that, a fake or "dummy" header must be constructed for :NONAME words.
>> If RECURSE in :NONAME words is unnecessary, then no header is needed, i.e.,
>> truly headerless instead of faked headerless via a blank name or SMUDGE bit.
>
>RECURSE just needs the address of the code, so if you separate that from
>LAST then you can get away without a dummy header.

This is not generally true. For indirect threaded code the code address
is docol (the inner interpreter) and there needs to be some pointer to
the threaded code too.
The best solution for Rod is just make dummy headers for his indirect
threaded Forth. I'm very content with my 100% percent consistent headers
and the careful names such that the most essential fields come first
alphabetically:

 CFA
 DFA
 FFA
 LFA
 NFA
 SFA
 XFA

Yes they cost 56 bytes plus the name itself.

>
>--Josh

Groetjes Albert

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


Page 2 of 3 — ← Prev page 1 [2] 3  Next page →

Back to top | Article view | comp.lang.forth


csiph-web