home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
EFFO
/
pd6.lzh
/
DOC
/
ranges.doc
< prev
next >
Wrap
Text File
|
1989-12-21
|
4KB
|
121 lines
RANGES(3) NUMBER RANGES FUNCTIONS RANGES(3)
NAME
ranges - number intervals definitions and functions
SYNOPSIS
#include ranges.f83
ranges ( -- )
RANGE ( from to -- )
+from ( range -- from) private
+to ( range -- to) private
?empty ( range -- flag)
?member ( value range -- flag)
?intersection ( x y -- flag)
length ( range -- length)
union ( x y -- from to)
intersection ( x y -- from to)
map ( range block[index -- ] -- )
?map ( range block[index -- flag] -- )
print ( range -- )
.range ( range -- )
DESCRIPTION
Number interval functions. Allows definition and manipulation of
ranges of numbers.
ranges ( -- )
Range definitions vocabulary.
RANGE ( from to -- )
Used in the following form to create a range:
<from> <to> RANGE <ranges-name>
The range is a structure type thus structure operations
are allowed (e.g. sizeof).
+from ( range -- from) private
Access field of "from" value of a range structure. Stored as a long.
+to ( range -- to) private
Access field of "to" value of a range structure. Stored as a long.
?empty ( range -- flag)
Returns true if the "from" and "to" values are equal, i.e., the
range is empty else false.
?member ( value range -- flag)
Returns true if the value is within the range else false.
?intersection ( x y -- flag)
Returns true if there exists an intersection range between
the ranges "x" and "y" else false.
length ( range -- length)
Returns the length of the range.
union ( x y -- from to)
Given two ranges "x" and "y" returns the "from" and "to" values
of the union of the ranges.
intersection ( x y -- from to)
Given two ranges "x" and "y" returns the "from" and "to" values
of the intersection of the ranges. If an intersection does not
exist the value zero is returned for "from" and "to".
map ( range block[index -- ] -- )
Used in the following form:
<range> <block> map
Map function on a range. The block is called for each value of
the range starting with "from" and ending with "to". The block
receives the index as a parameter.
?map ( range block[index -- flag] -- )
Used in the following form:
<range> <conditional-block> ?map
Conditional map function on a range. The block is called for
each value of the range starting with "from" and ending with "to"
while the block returns true. The block receives the index as a
parameter.
print ( range -- )
Print all range values.
.range ( range -- )
Prints information about the given range.
SEE ALSO
forth(1), structures(2), blocks(2)
COPYING
Copyright (C) 1989 Mikael R.K. Patel
Permission is granted to make and distribute verbatim copies
of this manual provided the copyright notice and this permission
notice are preserved on all copies.
Permission is granted to copy and distribute modified versions
of this manual under the conditions for verbatim copying,
provided also that the section entitled "GNU General Public
License" is included exactly as in the original, and provided
that the entire resulting derived work is distributed under
the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of
this manual into another language, under the above conditions
for modified versions, except that the section entitled "GNU
General Public License" may be included in a translation approved
by the author instead of in the original English.
AUTHOR
Mikael R.K. Patel
Computer Aided Design Laboratory (CADLAB)
Department of Computer and Information Science
Linkoping University
S-581 83 LINKOPING
SWEDEN
Email: mip@ida.liu.se