Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Testing Environment?

17 views
Skip to first unread message

Peter Knaggs

unread,
Feb 13, 2012, 7:56:56 PM2/13/12
to
Yesterday I changed the method by which my system populates the
environment query. I was wanting to test the system and came to the
conclusion that the standard actually places a number of restrictions on
the content of these queries. Consequently, I have developed the
following set of tests, that not only test the ENVIRONMENT? word but also
the values returned by the core environment quires.

I present them here for comment and criticism.

TESTING ENVIRONMENT?
DECIMAL

: tnv PARSE-NAME ENVIRONMENT? 0= ?DUP DROP ;

T{ tnv Unknown -> <TRUE> }T \ tnv inverts the flag

\ 3.1.2: Character types
\ Characters shall have the following properties:
\ at least one address unit wide;
\ contain at least eight bits;
\ have a size less than or equal to cell size;

T{ tnv ADDRESS-UNIT-BITS tnv MAX-CHAR BITS > -> <FALSE> }T
T{ 8 tnv MAX-CHAR BITS > -> <FALSE> }T
T{ tnv MAX-CHAR 1S U> -> <FALSE> }T

\ 3.1.3: Single-cell types
\ Cells shall be at least one address unit wide and contain at least
\ sixteen bits.

T{ tnv ADDRESS-UNIT-BITS 1S BITS U> -> <FALSE> }T
T{ 16 MAX-UINT BITS U> -> <FALSE> }T

\ The size of a cell shall be an integral multiple of the size of a
\ character.

T{ 1S BITS tnv MAX-CHAR BITS MOD -> 0 }T

\ 3.1.3.4: Counted strings
\ The maximum length of a counted string shall be at least 255.

T{ 255 tnv /COUNTED-STRING > -> <FALSE> }T

\ 3.2.6: Environmental queries

T{ tnv MAX-N -> MAX-INT }T \ Largest usable signed integer
T{ tnv MAX-U -> MAX-UINT }T \ Largest usable unsigned integer
T{ tnv MAX-D -> -1 MAX-INT }T \ Largest usable signed double number
T{ tnv MAX-UD -> -1 MAX-UINT }T \ Largest usable unsigned double number

T{ tnv FLOORED -> -3 2 / -2 = }T \ True if floored division is the default

\ The standard does not specify a minimum number of cells for either
\ the Data or Return stacks, but a system should provide this
\ information, and it is safe to assume at least 1 cell.

T{ 1 tnv STACK-CELLS > -> <FALSE> }T
T{ 1 tnv RETURN-STACK-CELLS > -> <FALSE> }T

\ 3.3.3.6: Other transient regions
\ The size of the scratch area whose address is returned by PAD shall
\ be at least 84 characters.

T{ 84 tnv /PAD > -> <FALSE> }T

\ The size of the pictured numeric output string buffer shall be at
\ least (2n)+2 characters, where n is the number of bits in a cell.

T{ 1S BITS 2* 2 + tnv /HOLD > -> <FALSE> }T


--
Peter Knaggs

Marcel Hendrix

unread,
Feb 14, 2012, 1:19:12 PM2/14/12
to
"Peter Knaggs" <p...@bcs.org.uk> writes Re: Testing Environment?

> Yesterday I changed the method by which my system populates the
> environment query. I was wanting to test the system and came to the
> conclusion that the standard actually places a number of restrictions on
> the content of these queries. Consequently, I have developed the
> following set of tests, that not only test the ENVIRONMENT? word but also
> the values returned by the core environment quires.

> I present them here for comment and criticism.

To use your words, I needed to:

-- ---------------------------------
NEEDS -ttester

TRUE constant <TRUE>
FALSE constant <FALSE>
0 INVERT constant 1S
0 INVERT constant MAX-UINT
0 INVERT 1 RSHIFT constant MAX-INT

: BITS ( n -- popcount ) ... ;
\ : BITS #BITS ; ( iForth )
-- ---------------------------------

-marcel

Peter Knaggs

unread,
Feb 14, 2012, 2:36:19 PM2/14/12
to
Marcel Hendrix wrote:

> To use your words, I needed to:
>
> -- ---------------------------------
> NEEDS -ttester
>
> TRUE constant <TRUE>
> FALSE constant <FALSE>
> 0 INVERT constant 1S
> 0 INVERT constant MAX-UINT
> 0 INVERT 1 RSHIFT constant MAX-INT
>
> : BITS ( n -- popcount ) ... ;
> \ : BITS #BITS ; ( iForth )
> -- ---------------------------------

All of which are defined in the Hayes test suite, as you give them.
Which is why I did not include them in my post, although, John
defines BITS as:

1S 1 RSHIFT INVERT CONSTANT MSB

: BITS ( X -- U )
0 SWAP BEGIN DUP WHILE DUP MSB AND IF >R 1+ R> THEN 2* REPEAT DROP ;

--
Peter Knaggs

Rod Pemberton

unread,
Feb 14, 2012, 7:19:00 PM2/14/12
to
"Peter Knaggs" <p...@bcs.org.uk> wrote in message
news:op.v9m8w6dhsu5d0p@david...
> Yesterday I changed the method by which my system populates the
> environment query. I was wanting to test the system and came to the
> conclusion that the standard actually places a number of restrictions on
> the content of these queries. Consequently, I have developed the
> following set of tests, that not only test the ENVIRONMENT? word
> but also the values returned by the core environment quires.
>

... quires ? What in the world is a "quires" ... ?

Well, it seems "quires" is actually word. Imagine that! Apparently, it
means a folded section of leaves in book for binding or set of 24 sheets of
paper ... I don't believe thats what you meant to use. Should we assume
you meant "queries" or "inquiries" or less likely "inquires" or (something
else) ... ? So, a "yes" to to "queries" then?


Rod Pemberton



Coos Haak

unread,
Feb 14, 2012, 7:48:49 PM2/14/12
to
Op Tue, 14 Feb 2012 19:19:00 -0500 schreef Rod Pemberton:
.6.1.1345 ENVIRONMENT? .....“environment-query”.....CORE........ 38
--
Coos

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

Rod Pemberton

unread,
Feb 14, 2012, 8:23:57 PM2/14/12
to
"Coos Haak" <chf...@hccnet.nl> wrote in message
news:1pbkrjevb83iz$.s6la8q9v4nt0$.dlg@40tude.net...
> Op Tue, 14 Feb 2012 19:19:00 -0500 schreef Rod Pemberton:
> > "Peter Knaggs" <p...@bcs.org.uk> wrote in message
> > news:op.v9m8w6dhsu5d0p@david...
> >> Yesterday I changed the method by which my system populates the
> >> environment query. I was wanting to test the system and came to the
> >> conclusion that the standard actually places a number of restrictions
> >> on the content of these queries. Consequently, I have developed the
> >> following set of tests, that not only test the ENVIRONMENT? word
> >> but also the values returned by the core environment quires.
> >>
> >
> > ... quires ? What in the world is a "quires" ... ?
> >
> > Well, it seems "quires" is actually word. Imagine that! Apparently, it
> > means a folded section of leaves in book for binding or set of 24 sheets
> > of paper ... I don't believe thats what you meant to use. Should we
> > assume you meant "queries" or "inquiries" or less likely "inquires" or
> > (something else) ... ? So, a "yes" to to "queries" then?
> >
> >
>
> .6.1.1345 ENVIRONMENT? .....´environment-query¡.....CORE........ 38
>

That's "query", not "quires". Plural of "query" is "queries". PK correctly
used "query" and "queries" in his paragraph. Where "quires" came
from is anyone's guess ...


Rod Pemberton



Peter Knaggs

unread,
Feb 14, 2012, 8:26:49 PM2/14/12
to
Rod Pemberton wrote:

> "Peter Knaggs" <p...@bcs.org.uk> wrote in message
> news:op.v9m8w6dhsu5d0p@david...
>> Yesterday I changed the method by which my system populates the
>> environment query. I was wanting to test the system and came to the
>> conclusion that the standard actually places a number of restrictions on
>> the content of these queries. Consequently, I have developed the
>> following set of tests, that not only test the ENVIRONMENT? word
>> but also the values returned by the core environment quires.
>>
>
> ... quires ? What in the world is a "quires" ... ?
>
> Well, it seems "quires" is actually word. Imagine that! Apparently, it
> means a folded section of leaves in book for binding or set of 24 sheets
> of paper ...

It is also the original spelling of what we now call choirs.

> I don't believe thats what you meant to use. Should we assume
> you meant "queries" or "inquiries" or less likely "inquires" or
> (something else) ... ? So, a "yes" to to "queries" then?

Yes.

--
Peter Knaggs

Doug Hoffman

unread,
Feb 14, 2012, 11:13:47 PM2/14/12
to
On 2/14/12 7:19 PM, Rod Pemberton wrote:
> "Peter Knaggs"<p...@bcs.org.uk> wrote in message
> news:op.v9m8w6dhsu5d0p@david...
>> Yesterday I changed the method by which my system populates the
>> environment query. I was wanting to test the system and came to the
>> conclusion that the standard actually places a number of restrictions on
>> the content of these queries. Consequently, I have developed the
>> following set of tests, that not only test the ENVIRONMENT? word
>> but also the values returned by the core environment quires.
>>
>
> ... quires ? What in the world is a "quires" ... ?

It's a simple typo. He meant "squires" but his finger missed the "s".
So, in context, it all makes perfect sense. A squire historically has
been a young nobleman acting as an attendant to a knight. Here it would
mean subservient core words acting as attendants to the higher-status
environment "knight" words.

-Doug

Anton Ertl

unread,
Feb 15, 2012, 6:06:44 AM2/15/12
to
"Peter Knaggs" <p...@bcs.org.uk> writes:
>Rod Pemberton wrote:
>> ... quires ? What in the world is a "quires" ... ?
...
>It is also the original spelling of what we now call choirs.

Interesting:

Greek: Choros ->
Latin: Chorus ->
Old French: cuer ->
Middle English: quer, quire ->
Modern English: choir

So the modern spelling is closer to the root than the Middle English
and Old French spelling.

- 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 2011: http://www.euroforth.org/ef11/

Alex McDonald

unread,
Feb 15, 2012, 10:25:16 AM2/15/12
to
On Feb 15, 3:06 am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
wrote:
Old French also had quer, and most English words that were not of
Latin origin but ended up with a qu simply aped the spelling of the
French; an example is cwen to queen. The word quire, like many others,
was respelled in the 1700s in the Latin style, an effect of early
grammarians of that era to make English rigorously follow a Latin
model. Modern English spelling of these words is closer to the root
only because of their insistence and influence.
0 new messages