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


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

16.6.2.0715 ALSO

Started byMark Wills <markrobertwills@yahoo.co.uk>
First post2012-07-31 05:33 -0700
Last post2012-08-15 12:14 -0700
Articles 20 on this page of 56 — 12 participants

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


Contents

  16.6.2.0715 ALSO Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-31 05:33 -0700
    Re: 16.6.2.0715 ALSO anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-31 14:43 +0000
      Re: 16.6.2.0715 ALSO Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-31 08:08 -0700
        Re: 16.6.2.0715 ALSO "David N. Williams" <williams@umich.edu> - 2012-07-31 11:35 -0400
    Re: 16.6.2.0715 ALSO Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-31 11:03 -0500
    ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-08 16:28 +1000
      Re: ALSO - anything better? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-08-08 01:22 -0700
        Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-08 10:33 +0000
        Re: ALSO - anything better? Alex McDonald <blog@rivadpm.com> - 2012-08-08 03:52 -0700
          Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-11 22:13 +1000
            Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-11 12:15 +0000
              Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-13 21:22 +1000
                Re: ALSO - anything better? Alex McDonald <blog@rivadpm.com> - 2012-08-13 04:44 -0700
                  Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-14 18:46 +1000
                Re: ALSO - anything better? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-08-13 10:03 -0500
            Re: ALSO - anything better? Spam@ControlQ.com - 2012-08-11 11:31 -0400
              Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-11 16:01 +0000
                Re: ALSO - anything better? Spam@ControlQ.com - 2012-08-12 16:02 -0400
              Re: ALSO - anything better? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-08-11 11:37 -0500
            Re: ALSO - anything better? "Elizabeth D. Rather" <erather@forth.com> - 2012-08-11 08:04 -1000
              Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-12 13:26 +1000
                Re: ALSO - anything better? "Elizabeth D. Rather" <erather@forth.com> - 2012-08-11 21:55 -1000
                  Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-14 17:18 +1000
                    Re: ALSO - anything better? "Elizabeth D. Rather" <erather@forth.com> - 2012-08-13 21:53 -1000
                      Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-14 19:25 +1000
                        Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-14 19:40 +1000
                    Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-15 12:57 +0000
                      Re: ALSO - anything better? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-08-15 10:09 -0500
                        Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-15 15:12 +0000
                          Re: ALSO - anything better? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-08-15 10:21 -0500
                            Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-15 16:26 +0000
                              Re: ALSO - anything better? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-08-15 12:08 -0500
                                Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-15 17:38 +0000
                                  Re: ALSO - anything better? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-08-15 13:10 -0500
                            Re: ALSO - anything better? mhx@iae.nl - 2012-08-15 13:49 -0700
                              Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-16 12:34 +0000
                                Re: ALSO - anything better? mhx@iae.nl (Marcel Hendrix) - 2012-08-16 20:13 +0200
                                  Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-17 14:07 +0000
                      Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-16 14:08 +1000
                        Re: ALSO - anything better? Alex McDonald <blog@rivadpm.com> - 2012-08-16 02:30 -0700
                          Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-16 11:51 +0000
                          Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-18 03:09 +1000
                            Re: ALSO - anything better? Alex McDonald <blog@rivadpm.com> - 2012-08-17 17:13 -0700
                              Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-19 14:13 +1000
                                Re: ALSO - anything better? Alex McDonald <blog@rivadpm.com> - 2012-08-19 09:57 -0700
                        Re: ALSO - anything better? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-08-16 10:28 +0000
                          Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-16 12:38 +0000
                            Re: ALSO - anything better? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-08-16 11:07 -0500
                          Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-17 22:12 +1000
                        Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-16 12:45 +0000
                          Re: ALSO - anything better? "Ed" <invalid@nospam.com> - 2012-08-18 03:14 +1000
                            Re: ALSO - anything better? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-17 17:31 +0000
                            Re: ALSO - anything better? Alex McDonald <blog@rivadpm.com> - 2012-08-17 17:14 -0700
                          Re: ALSO - anything better? BruceMcF <agila61@netscape.net> - 2012-08-18 10:16 -0700
                            Re: ALSO - anything better? "David N. Williams" <williams@umich.edu> - 2012-08-18 15:41 -0400
                Re: ALSO - anything better? BruceMcF <agila61@netscape.net> - 2012-08-15 12:14 -0700

Page 1 of 3  [1] 2 3  Next page →


#14570 — 16.6.2.0715 ALSO

FromMark Wills <markrobertwills@yahoo.co.uk>
Date2012-07-31 05:33 -0700
Subject16.6.2.0715 ALSO
Message-ID<15a38b5e-6a02-435e-ad0f-6ff3f38748de@e9g2000yqi.googlegroups.com>
( -- )
Transform the search order consisting of widn, ... wid2, wid1 (where
wid1 is searched first) into widn, ... wid2, wid1, wid1. An ambiguous
condition exists if there are too many word lists in the search order.
--------------------------------------------------

Why is wid1 duplicated? I'm not sure what this means - what is the
purpose behind this?

(I do realise the spec isn't the right place for a wordlists 101,
hence the question here).

Thanks

[toc] | [next] | [standalone]


#14578

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2012-07-31 14:43 +0000
Message-ID<2012Jul31.164332@mips.complang.tuwien.ac.at>
In reply to#14570
Mark Wills <markrobertwills@yahoo.co.uk> writes:
>( -- )
>Transform the search order consisting of widn, ... wid2, wid1 (where
>wid1 is searched first) into widn, ... wid2, wid1, wid1. An ambiguous
>condition exists if there are too many word lists in the search order.
>--------------------------------------------------
>
>Why is wid1 duplicated?

So that the next invocation of a vocabulary can replace it.

E.g., after ALSO FORTH you then have

widn, ..., wid2, wid1, FORTH

> I'm not sure what this means - what is the
>purpose behind this?

ALSO is a DUP on the search order stack.

Vocabularies and ALSO are ususual in their handling.  Better don't
think too much about it.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2012: http://www.euroforth.org/ef12/

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


#14581

FromMark Wills <markrobertwills@yahoo.co.uk>
Date2012-07-31 08:08 -0700
Message-ID<88d86e94-cf95-4587-8f3e-5926cc93f8aa@j9g2000vbk.googlegroups.com>
In reply to#14578
On Jul 31, 3:43 pm, an...@mips.complang.tuwien.ac.at (Anton Ertl)
wrote:
> Mark Wills <markrobertwi...@yahoo.co.uk> writes:
> >( -- )
> >Transform the search order consisting of widn, ... wid2, wid1 (where
> >wid1 is searched first) into widn, ... wid2, wid1, wid1. An ambiguous
> >condition exists if there are too many word lists in the search order.
> >--------------------------------------------------
>
> >Why is wid1 duplicated?
>
> So that the next invocation of a vocabulary can replace it.
>
> E.g., after ALSO FORTH you then have
>
> widn, ..., wid2, wid1, FORTH
>
> > I'm not sure what this means - what is the
> >purpose behind this?
>
> ALSO is a DUP on the search order stack.
>
> Vocabularies and ALSO are ususual in their handling.  Better don't
> think too much about it.
>
> - anton
> --
> M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
> comp.lang.forth FAQs:http://www.complang.tuwien.ac.at/forth/faq/toc.html
>      New standard:http://www.forth200x.org/forth200x.html
>    EuroForth 2012:http://www.euroforth.org/ef12/

Okay. So naming a vocab does not append it to the search order. It
over-writes the last one?

That's a bit strange.

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


#14583

From"David N. Williams" <williams@umich.edu>
Date2012-07-31 11:35 -0400
Message-ID<jv8u00$c28$1@dont-email.me>
In reply to#14581
On 7/31/12 11:08 AM, Mark Wills wrote:
 > On Jul 31, 3:43 pm, an...@mips.complang.tuwien.ac.at (Anton Ertl)
 > wrote:
 >> [...]
 >>
 >> ALSO is a DUP on the search order stack.
 >>
 >> Vocabularies and ALSO are ususual in their handling.  Better don't
 >> think too much about it.
 >> [...]
 >
 > Okay. So naming a vocab does not append it to the search order. It
 > over-writes the last one?
 >
 > That's a bit strange.

The traditional, nonstandard VOCABULARY word creates named
vocabularies which replace the top item on the search-order
stack (ostack) when invoked.  So after

   VOCABULARY B

you would do

   ALSO B

to add the B wid to the top of the ostack.

I personally don't like that behavior, although Krishna and I
used it in our modules library, so named modules would behave
like the standard word FORTH.

-- David

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


#14584

FromAndrew Haley <andrew29@littlepinkcloud.invalid>
Date2012-07-31 11:03 -0500
Message-ID<z7adnWIrJbEjnIXNnZ2dnUVZ8vudnZ2d@supernews.com>
In reply to#14570
Mark Wills <markrobertwills@yahoo.co.uk> wrote:
> ( -- )
> Transform the search order consisting of widn, ... wid2, wid1 (where
> wid1 is searched first) into widn, ... wid2, wid1, wid1. An ambiguous
> condition exists if there are too many word lists in the search order.
> --------------------------------------------------
> 
> Why is wid1 duplicated? I'm not sure what this means - what is the
> purpose behind this?

Because it's used in this form:

   ALSO FORTH

Note that FORTH overwrites the top item on the search order stack.
ALSO is just DUP for the search order stack.

Andrew.

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


#14819 — ALSO - anything better?

From"Ed" <invalid@nospam.com>
Date2012-08-08 16:28 +1000
SubjectALSO - anything better?
Message-ID<jvt0p1$n52$1@speranza.aioe.org>
In reply to#14570
I'm looking for alternatives to ANS wordlists and search order.
It's costly to implement and confusing in use.  There has to be
a better way.

LMI disliked ONLY ALSO and appeared to get by with a scheme
that involved searching just  CONTEXT CURRENT FORTH.
As they implemented cross-compilers with it, it can't have been
too bad!

Can anyone point me to other forths with simple but effective
search schemes?




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


#14826 — Re: ALSO - anything better?

FromMark Wills <markrobertwills@yahoo.co.uk>
Date2012-08-08 01:22 -0700
SubjectRe: ALSO - anything better?
Message-ID<edffef22-da23-43b9-8c05-343bbbe7b9a0@b10g2000vbj.googlegroups.com>
In reply to#14819
On Aug 8, 7:28 am, "Ed" <inva...@nospam.com> wrote:
> I'm looking for alternatives to ANS wordlists and search order.
> It's costly to implement and confusing in use.  There has to be
> a better way.
>
> LMI disliked ONLY ALSO and appeared to get by with a scheme
> that involved searching just  CONTEXT CURRENT FORTH.
> As they implemented cross-compilers with it, it can't have been
> too bad!
>
> Can anyone point me to other forths with simple but effective
> search schemes?

Personally I would be up for a completely new paradigm with regards to
wordlists. The current system is cryptic, and, well, awful quite
frankly!

Maybe I'll sketch a few ideas down on paper. Too late now to write a
paper for EuroForth...

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


#14838 — Re: ALSO - anything better?

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2012-08-08 10:33 +0000
SubjectRe: ALSO - anything better?
Message-ID<2012Aug8.123331@mips.complang.tuwien.ac.at>
In reply to#14826
Mark Wills <markrobertwills@yahoo.co.uk> writes:
>Maybe I'll sketch a few ideas down on paper. Too late now to write a
>paper for EuroForth...

Only if you want to submit a refereed paper.  For non-refereed papers
(industrial stream) the deadline is September 5, so you have 4 weeks,
which should be enough.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2012: http://www.euroforth.org/ef12/

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


#14839 — Re: ALSO - anything better?

FromAlex McDonald <blog@rivadpm.com>
Date2012-08-08 03:52 -0700
SubjectRe: ALSO - anything better?
Message-ID<fcedd422-eb8d-4fea-947b-bad6b4dd91e1@m13g2000vbd.googlegroups.com>
In reply to#14826
On Aug 8, 9:22 am, Mark Wills <markrobertwi...@yahoo.co.uk> wrote:
> On Aug 8, 7:28 am, "Ed" <inva...@nospam.com> wrote:
>
> > I'm looking for alternatives to ANS wordlists and search order.
> > It's costly to implement and confusing in use.  There has to be
> > a better way.
>
> > LMI disliked ONLY ALSO and appeared to get by with a scheme
> > that involved searching just  CONTEXT CURRENT FORTH.
> > As they implemented cross-compilers with it, it can't have been
> > too bad!
>
> > Can anyone point me to other forths with simple but effective
> > search schemes?
>
> Personally I would be up for a completely new paradigm with regards to
> wordlists. The current system is cryptic, and, well, awful quite
> frankly!
>
> Maybe I'll sketch a few ideas down on paper. Too late now to write a
> paper for EuroForth...

The simplicity of ALSO and friends can be seen in the implementation;
it's not complex at all. Untested.

( assumes existence of a ROOT vocabulary )
\ vocabulary root

n ( pick your n ) cells allot here 0 , constant context-
base
variable context context-base context ! ( stack )
variable current

: definitions   ( -- ) context @ @ current ! ;
: previous      ( -- ) cell context +! ;
: also          ( -- ) context @ dup @ swap cell- dup ! ! ;
: only          ( -- ) context-base context ! also root also ;
: vocabulary    ( -- <name> ) create wordlist , does> context @ ! ;

vocabulary forth

only forth definitions

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


#14924 — Re: ALSO - anything better?

From"Ed" <invalid@nospam.com>
Date2012-08-11 22:13 +1000
SubjectRe: ALSO - anything better?
Message-ID<k05i42$re0$1@speranza.aioe.org>
In reply to#14839
Alex McDonald wrote:
> ...
> The simplicity of ALSO and friends can be seen in the implementation;
> it's not complex at all. Untested.
>
> ( assumes existence of a ROOT vocabulary )
> \ vocabulary root
>
> n ( pick your n ) cells allot here 0 , constant context-
> base
> variable context context-base context ! ( stack )
> variable current
>
> : definitions   ( -- ) context @ @ current ! ;
> : previous      ( -- ) cell context +! ;
> : also          ( -- ) context @ dup @ swap cell- dup ! ! ;
> : only          ( -- ) context-base context ! also root also ;
> : vocabulary    ( -- <name> ) create wordlist , does> context @ ! ;
>
> vocabulary forth
>
> only forth definitions

I want to know whether these things are necessary.  The underlying
premise of ANS' ONLY ALSO and associated tools is that Forth
*requires* complicated search orders to get a job done.  Does it?
Apparently LMI didn't feel it did.

I don't have the background to give a definitive answer.  If it boils
down to a choice between ANS compliance and simplicity then
I want to know.


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


#14925 — Re: ALSO - anything better?

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2012-08-11 12:15 +0000
SubjectRe: ALSO - anything better?
Message-ID<2012Aug11.141529@mips.complang.tuwien.ac.at>
In reply to#14924
"Ed" <invalid@nospam.com> writes:
>I want to know whether these things are necessary.  The underlying
>premise of ANS' ONLY ALSO and associated tools is that Forth
>*requires* complicated search orders to get a job done.  Does it?

My impression is that in most cases we don't need to use several
wordlists; we can just choose lots of non-conflicting names (the
hyphen-haters hate that).

OTOH, when you need several wordlists, the search order stack is a
good concept; however, I prefer dealing with Wids and using >ORDER to
having named vocabularies and ALSO.  The fig-Forth approach was
definitely lacking.

>I don't have the background to give a definitive answer.  If it boils
>down to a choice between ANS compliance and simplicity then
>I want to know.

The search order word set is not a required word set.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2012: http://www.euroforth.org/ef12/

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


#14946 — Re: ALSO - anything better?

From"Ed" <invalid@nospam.com>
Date2012-08-13 21:22 +1000
SubjectRe: ALSO - anything better?
Message-ID<k0anut$fd5$1@speranza.aioe.org>
In reply to#14925
Anton Ertl wrote:
> ...
> The search order word set is not a required word set.

So people keep asserting.

Partly implementing a Standard is futile.  Implementing it in whole
would have advantage *if* there were libraries of routines to use.
This never happened in Forth for the reason that whereas other
languages are swamped with users - Forth is swamped with
implementers.

When users get bored they write new apps and libraries.  When
implementers get bored they write a new Standard :)



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


#14947 — Re: ALSO - anything better?

FromAlex McDonald <blog@rivadpm.com>
Date2012-08-13 04:44 -0700
SubjectRe: ALSO - anything better?
Message-ID<dc76eead-0c3c-40b8-b151-4ae632332193@n13g2000vby.googlegroups.com>
In reply to#14946
On Aug 13, 12:22 pm, "Ed" <inva...@nospam.com> wrote:
> Anton Ertl wrote:
> > ...
> > The search order word set is not a required word set.
>
> So people keep asserting.
>
> Partly implementing a Standard is futile.  Implementing it in whole
> would have advantage *if* there were libraries of routines to use.
> This never happened in Forth for the reason that whereas other
> languages are swamped with users - Forth is swamped with
> implementers.

Other languages have a clear divide between the two camps, but not
all. Smalltalk and similar languages have much the same as you
describe at a higher level of abstraction. My observation is that no-
one in that community bothers to divide users from those who
implement, since the language doesn't impose a barrier between
compiler here, application there. The question I have for you is; why
should we or they care about this division?

>
> When users get bored they write new apps and libraries.  When
> implementers get bored they write a new Standard :)

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


#14956 — Re: ALSO - anything better?

From"Ed" <invalid@nospam.com>
Date2012-08-14 18:46 +1000
SubjectRe: ALSO - anything better?
Message-ID<k0d34a$rk$1@speranza.aioe.org>
In reply to#14947
Alex McDonald wrote:
> On Aug 13, 12:22 pm, "Ed" <inva...@nospam.com> wrote:
> > Anton Ertl wrote:
> > > ...
> > > The search order word set is not a required word set.
> >
> > So people keep asserting.
> >
> > Partly implementing a Standard is futile. Implementing it in whole
> > would have advantage *if* there were libraries of routines to use.
> > This never happened in Forth for the reason that whereas other
> > languages are swamped with users - Forth is swamped with
> > implementers.
>
> Other languages have a clear divide between the two camps, but not
> all. Smalltalk and similar languages have much the same as you
> describe at a higher level of abstraction. My observation is that no-
> one in that community bothers to divide users from those who
> implement, since the language doesn't impose a barrier between
> compiler here, application there. The question I have for you is; why
> should we or they care about this division?

The point is that other languages have hobbyists who generate
software and libraries.  Forth never did.

What applications writers exist are vendors' customers and they
have no intention of distributing software and libraries.



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


#14949 — Re: ALSO - anything better?

FromAndrew Haley <andrew29@littlepinkcloud.invalid>
Date2012-08-13 10:03 -0500
SubjectRe: ALSO - anything better?
Message-ID<Ab6dnZ7mWuLLirTNnZ2dnUVZ8jmdnZ2d@supernews.com>
In reply to#14946
Ed <invalid@nospam.com> wrote:
> Anton Ertl wrote:
>> ...
>> The search order word set is not a required word set.
> 
> So people keep asserting.
> 
> Partly implementing a Standard is futile.

Explain why, please.

> Implementing it in whole would have advantage *if* there were
> libraries of routines to use.  This never happened in Forth for the
> reason that whereas other languages are swamped with users - Forth
> is swamped with implementers.

I don't think that's generally true.  Forth is a blue-collar language
for getting work done, and c.l.f. has always been very
unrepresentative.

Andrew.

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


#14927 — Re: ALSO - anything better?

FromSpam@ControlQ.com
Date2012-08-11 11:31 -0400
SubjectRe: ALSO - anything better?
Message-ID<alpine.BSF.2.00.1208111125350.51929@yoko.controlq.com>
In reply to#14924
On Sat, 11 Aug 2012, Ed wrote:

> Date: Sat, 11 Aug 2012 22:13:24 +1000
> From: Ed <invalid@nospam.com>
> Newsgroups: comp.lang.forth
> Subject: Re: ALSO - anything better?
> 
> Alex McDonald wrote:
>> ...
>> The simplicity of ALSO and friends can be seen in the implementation;
>> it's not complex at all. Untested.
>>
>> ( assumes existence of a ROOT vocabulary )
>> \ vocabulary root
>>
>> n ( pick your n ) cells allot here 0 , constant context-
>> base
>> variable context context-base context ! ( stack )
>> variable current
>>
>> : definitions   ( -- ) context @ @ current ! ;
>> : previous      ( -- ) cell context +! ;
>> : also          ( -- ) context @ dup @ swap cell- dup ! ! ;
>> : only          ( -- ) context-base context ! also root also ;
>> : vocabulary    ( -- <name> ) create wordlist , does> context @ ! ;
>>
>> vocabulary forth
>>
>> only forth definitions
>
> I want to know whether these things are necessary.  The underlying
> premise of ANS' ONLY ALSO and associated tools is that Forth
> *requires* complicated search orders to get a job done.  Does it?
> Apparently LMI didn't feel it did.
>
> I don't have the background to give a definitive answer.  If it boils
> down to a choice between ANS compliance and simplicity then
> I want to know.



I have long believed that the Forth search order/vocabulary system is 
inferior to a proper namespace.  The major problem addressed by namespaces 
is the ability to unambiguously specify a word name by fully qualifying 
it, rather than relying upon the order of vocabularies on some nebulous 
stack.

This may sound heretic, but Forth isn't dead (yet), and it could stand 
some improvements, and simple modifications, particularly those which 
don't change the character of the language, nor hurt its strengths.

The namespace facility within Tcl is a decent approach which could easily 
be adopted by the Forth language in a natural manner. IMHO.

Cheers,
Rob Sciuk

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


#14928 — Re: ALSO - anything better?

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2012-08-11 16:01 +0000
SubjectRe: ALSO - anything better?
Message-ID<2012Aug11.180150@mips.complang.tuwien.ac.at>
In reply to#14927
Spam@ControlQ.com writes:
>The namespace facility within Tcl is a decent approach which could easily 
>be adopted by the Forth language in a natural manner. IMHO.

For those of us who don't know TCL, maybe you could explain how such
an adoption might look like, and what the advantages would be.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2012: http://www.euroforth.org/ef12/

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


#14942 — Re: ALSO - anything better?

FromSpam@ControlQ.com
Date2012-08-12 16:02 -0400
SubjectRe: ALSO - anything better?
Message-ID<alpine.BSF.2.00.1208121600180.27319@yoko.controlq.com>
In reply to#14928
On Sat, 11 Aug 2012, Anton Ertl wrote:

> Date: Sat, 11 Aug 2012 16:01:50 GMT
> From: Anton Ertl <anton@mips.complang.tuwien.ac.at>
> Newsgroups: comp.lang.forth
> Subject: Re: ALSO - anything better?
> 
> Spam@ControlQ.com writes:
>> The namespace facility within Tcl is a decent approach which could easily
>> be adopted by the Forth language in a natural manner. IMHO.
>
> For those of us who don't know TCL, maybe you could explain how such
> an adoption might look like, and what the advantages would be.
>
> - anton
>

An interesting challenge, Anton.  Give me a day or so to work through the 
difficulties, and I'll try to come up with a namespace "word set" for 
Forth based upon the Tcl implmentation ...

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


#14929 — Re: ALSO - anything better?

FromAndrew Haley <andrew29@littlepinkcloud.invalid>
Date2012-08-11 11:37 -0500
SubjectRe: ALSO - anything better?
Message-ID<0PKdnXCsMc-gF7vNnZ2dnUVZ8u-dnZ2d@supernews.com>
In reply to#14927
Spam@controlq.com wrote:
> On Sat, 11 Aug 2012, Ed wrote:
> 
>> Date: Sat, 11 Aug 2012 22:13:24 +1000
>> From: Ed <invalid@nospam.com>
>> Newsgroups: comp.lang.forth
>> Subject: Re: ALSO - anything better?
>> 
>> Alex McDonald wrote:
>>> ...
>>> The simplicity of ALSO and friends can be seen in the implementation;
>>> it's not complex at all. Untested.
>>>
>>> ( assumes existence of a ROOT vocabulary )
>>> \ vocabulary root
>>>
>>> n ( pick your n ) cells allot here 0 , constant context-
>>> base
>>> variable context context-base context ! ( stack )
>>> variable current
>>>
>>> : definitions   ( -- ) context @ @ current ! ;
>>> : previous      ( -- ) cell context +! ;
>>> : also          ( -- ) context @ dup @ swap cell- dup ! ! ;
>>> : only          ( -- ) context-base context ! also root also ;
>>> : vocabulary    ( -- <name> ) create wordlist , does> context @ ! ;
>>>
>>> vocabulary forth
>>>
>>> only forth definitions
>>
>> I want to know whether these things are necessary.  The underlying
>> premise of ANS' ONLY ALSO and associated tools is that Forth
>> *requires* complicated search orders to get a job done.  Does it?
>> Apparently LMI didn't feel it did.
>>
>> I don't have the background to give a definitive answer.  If it boils
>> down to a choice between ANS compliance and simplicity then
>> I want to know.
> 
> I have long believed that the Forth search order/vocabulary system
> is inferior to a proper namespace.  The major problem addressed by
> namespaces is the ability to unambiguously specify a word name by
> fully qualifying it, rather than relying upon the order of
> vocabularies on some nebulous stack.

What do you mean?  It's perfectly normal to say "using namespace blah"
in non-Forth languages, and that's what wordlists do.  I can't see any
difference.  If it's really important to you to specify exactly Word X
from Wordlist Y, you can do that too.  What's missing?

Andrew.

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


#14931 — Re: ALSO - anything better?

From"Elizabeth D. Rather" <erather@forth.com>
Date2012-08-11 08:04 -1000
SubjectRe: ALSO - anything better?
Message-ID<xOidnehCtoggA7vNnZ2dnUVZ_tadnZ2d@supernews.com>
In reply to#14924
On 8/11/12 2:13 AM, Ed wrote:
> Alex McDonald wrote:
>> ...
>> The simplicity of ALSO and friends can be seen in the implementation;
>> it's not complex at all. Untested.
>>
>> ( assumes existence of a ROOT vocabulary )
>> \ vocabulary root
>>
>> n ( pick your n ) cells allot here 0 , constant context-
>> base
>> variable context context-base context ! ( stack )
>> variable current
>>
>> : definitions   ( -- ) context @ @ current ! ;
>> : previous      ( -- ) cell context +! ;
>> : also          ( -- ) context @ dup @ swap cell- dup ! ! ;
>> : only          ( -- ) context-base context ! also root also ;
>> : vocabulary    ( -- <name> ) create wordlist , does> context @ ! ;
>>
>> vocabulary forth
>>
>> only forth definitions
>
> I want to know whether these things are necessary.  The underlying
> premise of ANS' ONLY ALSO and associated tools is that Forth
> *requires* complicated search orders to get a job done.  Does it?
> Apparently LMI didn't feel it did.
>
> I don't have the background to give a definitive answer.  If it boils
> down to a choice between ANS compliance and simplicity then
> I want to know.

No, of course they aren't necessary. This is an optional wordset. 
Historically, Forthers have found wordlists useful for namespace 
management and the secondary benefit of shortening searches and hence 
speeding up compiles, but if that isn't important to you, don't use it.

There have been several approaches to namespace management over the 
years, starting in 1971 when Chuck's systems at NRAO needed to 
distinguish I (loop counter) from I (register name in assembler) from I 
(insert command in editor) and related conflicts. Bill Ragsdale 
introduced the ONLY/ALSO scheme in the early 80's. FORTH, Inc. used a 
simpler scheme that supported up to 8 wordlists, until the adoption of 
Forth94 when the TC adopted a much improved ONLY/ALSO scheme.

Programmers' styles in this regard differ a lot. FORTH, Inc. was 
perfectly happy with 8 wordlists, and rarely used more than 4 except in 
cross- or meta-compilers, but the Forth94 TC heard from people who used 
"hundreds", and since Forth94 they have become popular mechanisms for 
implementing OOPs. And in SwiftForth, with over 3,000 words as booted, 
they are very helpful.

Nobody is going to force you to use them, though.

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]


Page 1 of 3  [1] 2 3  Next page →

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


csiph-web