HDTenEightyP/NetNews huggingface dataset:
Newsgroups: comp.lang.forth
Subject: NUMBER? word in EFORTH
From: mentink@wronz.org.nz
Date: 16 Dec 92 14:39:20 +1300



          Can anyone help, the standard EFORTH word-set includes the word
NUMBER? which converts a number string entered interactivly by the user.
Although it accepts hex numbers e.g $4000, it does not conform to the
usual FORTH and allow you to enter a double number e.g 123.45

Can anyone help by providing a modification of the EFORTH source for the
word. Follows below ....... 

  Alternatively....
  Provide a seperate word to allow you to enter a double number on the
  stack.


  Thanks in advance.

/ --------------------- Source starts here -----------------------------


: NUMBER? ( a -- n T, a F )
  BASE @ >R  0 OVER COUNT ( a 0 b n)
  OVER C@ [ CHAR $ ] LITERAL =
  IF HEX SWAP BYTE+ SWAP 1 - THEN ( a 0 b' n')
  OVER C@ [ CHAR - ] LITERAL = >R ( a 0 b n)
  SWAP R@ - SWAP R@ + ( a 0 b" n") ?DUP
  IF 1 - ( a 0 b n)
    FOR DUP >R C@ BASE @ DIGIT?
      WHILE SWAP BASE @ * +  R> BYTE+
    NEXT R@ ( ?sign) NIP ( b) IF NEGATE THEN SWAP
      ELSE R> R> ( b index) 2DROP ( digit number) 2DROP 0
      THEN DUP
  THEN R> ( n ?sign) 2DROP R> BASE ! ;

  --------------------------------------------------------------------------
	Bernie Mentink   ( Christchurch N.Z. )
	email: mentink@wronz.org.nz

	      .... Some things have to be seen to be believed,
     	           Most things have to be believed to be seen ....
  -------------------------------------------------------------------------
From: kpjeacle@MATHS.TCD.IE
Newsgroups: comp.lang.forth
Subject: Re: ANS Forth
Date: 15 Dec 92 20:38:25 GMT
Reply-To: FIGI-L%BRUSPVM.BITNET@cmsa.Berkeley.EDU
Distribution: world
Organization: The Internet

Hi, I'm afraid I can't help you as I am looking for the same information
as you! Can you let me know if you find out where the latest ANS Forth
specs are?

Thanks,
--
Karl Jeacle  EI1169           //
                            \X/       kpjeacle@maths.tcd.ie
Newsgroups: comp.lang.forth
From: paf@porto.inescn.pt (Paulo Alexandre Duarte Ferreira)
Subject: Trouble with Fpc 3.55 memory allocation
Keywords: FPC, Msdos
Reply-To: paf@porto.inescn.pt
Organization: INESC-Porto, Portugal
Date: Mon, 14 Dec 92 18:45:24 GMT


In Fpc 3.35 i used the following code to grab 64 kbytes of memory,
needed by an application ( 8051 assembler and disassembler ), but
after correcting bugs :-( , and giving the application a decent 
memory editor :-) the code to grab the memory has side-effects on
Fpc 3.55 that don't exist on Fpc 3.35
 
 After executing this code on Fpc 3.55 OPEN only works with filenames, 
( no file selection tool ) and the editor doesn't work ( no memory ).

In Fpc 3.35 everything works fine.

Can somebody please correct my code ? 
Should i release my code with the warning "Use only Fpc 3.35" ?

Thanks for any kind of answer. 

\ ----------------- start of code 
decimal
      
   variable     8051-seg         \  pointer to the 8051 "fake memory"

       : get-memory            ( -- )

           defers initstuff
           4096  alloc                     \ requests 64 kbytes of memory
           0 = not
           if
               drop drop ." Not enough memory ! " cr
               ."  Leaving Forth now !!! "       cr
               ."  You cannot use the 8051 Disassembler " cr
               bye
           else
               nip  8051-seg !
           then  ;


       ' get-memory is initstuff       \ insert get-memory in
                                       \ the initialization chain


       : rel-memory           ( -- )     \ release the memory
           8051-seg @ dealloc
           0 = not
           if
                ." Memory release failed !"  cr
                ." You should reboot your PC !"
           then  ;

   \ It is not necessary to reboot the PC, but is safer because your memory
   \ is fragmented and/or corrupted and memory management does not
   \ exist in MS-DOS machines ( in the real meaning of the word ).


     : bye  rel-memory bye ;           ( -- )

         \  release the memory before we exit Forth

\ ------------- end of code 

--
--------------------------------------------------------------------------
Paulo Ferreira |  paf@porto.inescn.pt| INESC Porto Grupo CG&CAD
--------------------------------------------------------------------------
" ... a metafisica e' uma consequencia de estar mal disposto."
                                                   Alvaro de Campos
Organization: Queen's University at Kingston
Date: Sun, 13 Dec 1992 21:39:56 EST
From: <3034871@QUCDN.QueensU.CA>
Newsgroups: comp.lang.forth
Subject:    Defining variables automatically

I'm wondering if it is possible to define a word that then defines
new variables when it is executed.  That is,

: NewWord    100 [COMPILE] VARIABLE ;

The problem is, that when you call `NewWord' it prompts you for
a variable name (as it should, logically speaking).

The question then, is, can the input be redirected somehow for
the purpose of entering the variable names?

Thanks!
  Ralph Siemsen
  E-Mail:  <303-4871@QUCDN.QueensU.CA>
Newsgroups: comp.lang.forth
From: jax@well.sf.ca.us (Jack J. Woehr)
Subject: Re: Forth books (was "ANS Forth")
Organization: Whole Earth 'Lectronic Link
Date: Sun, 20 Dec 1992 00:07:31 GMT

In <9212191829.AA15097@im4> dmiller@im.lcs.mit.edu (Dick and Jill Miller) writes:

>Jaxfanz and others have noted it.  I would urge you to notify your lawyers 
>that their newly-proposed title for your book is uncomfortably close to the 
>preexisting title, "FORTH: A TEXT AND REFERENCE".  That is, unless you and 
>its authors/publisher have some agreement on why your book is a follow-on 
>to theirs, or unless you hope to cash in by construing an imagined linkage 
>of that sort.  

	Back in the 1940's, Warner Bros., makers of "Casablanca", threatened
to sue the Marx Bros. for making a film called "A Night in Casablanca".

	Groucho Marx fired back a letter threatening to sue Warner Bros.
for calling themselves "brothers", since the Marx Bros. were brothers first.

	Thank you for sharing, Dick. Best luck in 1993 selling Forth-79.

		Regards,

		=jax=

	
-- 
 # jax@well.{UUCP,sf.ca.us}  # #  Member  # # Vice President,       #
 # du!isis!koscej!jax        # # X3J14 TC # #  Forth Interest Group #
 # JAX on GEnie              # # for ANS  # #   P.O. Box 2154       #
 # SYSOP RCFB (303) 278-0364 # #  Forth   # #    Oakland, CA 94621  #
From: mic@fclub.mordovia.su (Michael B. Montvelishsky)
Newsgroups: comp.lang.forth
Subject: Is BASIS-17's Error Handling descriptions correct?
Date: 18 Dec 92 08:36:59 GMT
Reply-To: mic@fclub.mordovia.su
Organization: Forth Club

Hi all!
In BASIS-17's Error Handling proposed to use "error interception
frame" on the return stack to remember depth of data and return
stacks in CATCH points.

What is "error interception frame"?

How to implement it and avoid possibility of some data on the
return stack and "error interception frame" likeness?

Is latest dpANS proposes to use just "error interception frame on
the return stack"?

thanks, mic
From: sorry no email address (Peters, Randolph)
Newsgroups: comp.lang.forth
Subject: Pocket Forth bug fix
Date: 14 Dec 92 15:00:02 GMT
Followup-To: comp.lang.forth
Organization: Hospital of the University of Pennsylvania

I came up with my own answer to a question I posted on the net a few weeks
ago. Basically, for users of Pocket forth, there is  a problem with the
word interpret (which interprets the contents of the text input buffer).
Specifically, you can fill the text input buffer, but you can't reset the
input stream easily because there is no user variable to mark current
position in the input stream. I have come up with a simple fix:

: 0>is ( -- ) ( resets the input stream to the text input buffer )
     tib            ( -- buffer.addr )
     a>r            ( single --     r: -- double )
     2r>            ( -- double.length.buffer.addr    r: -- )
     ,$ 285E        ( compile inline code for MOVEA.L [A6]+, A4 )
     ; macro        ( in pocket forth, the top of the parameter stack )
                    ( is in A6 and the absolute position of the text  )
                    ( input buffer in memory is in A4 )

( example of usage of the above )
: query   tib 80 32 fill   ( empty the tib)
          0>is             ( reset the input stream pointer)
          tib 80 expect interpret ." hello" ;

This only solves one problem; now text can be transferred to the input
buffer
and correctly interpreted. Afterwards, however, control does not return to
the
word in which 'interpret' is contained. "hello" would never appear on the
display. This is because interpret empties out the return stack and the
parameter stack ( arrgh! ). Is this standard (for this question, I mean F83
or MMSFORTH standard) behavior for this word? And is there any way to patch
this behavior?

Comments and insight appreciated.

                                 Randolph Peters
                                 Suite C, 3rd Floor Silverstein
                                 Hospital of the University of Pennsylvania
                                 34th and Spruce Streets, Phila PA 19104
Newsgroups: comp.lang.forth
From: jax@well.sf.ca.us (Jack J. Woehr)
Subject: Re: Defining variables automatically
Organization: Whole Earth 'Lectronic Link
Date: Mon, 14 Dec 1992 07:50:26 GMT

In <92348.2139563034871@QUCDN.QueensU.CA> <3034871@QUCDN.QueensU.CA> writes:

>I'm wondering if it is possible to define a word that then defines
>new variables when it is executed.  That is,

	You ask if input to the VARIABLE''s name generation can be
redirected. It can, in most systems. The trick is to change the source
of the input stream.

	This can be done in a number of ways. In ANS Forth, it will
be regularized. SAVE-INPUT and RESTORE-INPUT handle preserving
the current input stream. Then input can be obtained from the user,
from a file, from an arbitrary character-address + count.

		=jax=
-- 
 # jax@well.{UUCP,sf.ca.us}  # #  Member  # # Vice President,       #
 # du!isis!koscej!jax        # # X3J14 TC # #  Forth Interest Group #
 # JAX on GEnie              # # for ANS  # #   P.O. Box 2154       #
 # SYSOP RCFB (303) 278-0364 # #  Forth   # #    Oakland, CA 94621  #
From: dmiller@im.lcs.mit.edu (Dick and Jill Miller)
Newsgroups: comp.lang.forth
Subject: Forth books (was "ANS Forth")
Date: 19 Dec 1992 12:29:37 -0600
Organization: UTexas Mail-to-News Gateway
NNTP-Posting-Host: cs.utexas.edu

jax@well.sf.ca.us (Jack J. Woehr) says:
>         you can read about the draft proposed standard in my book
> 
>         _Forth: the New Model_, M&T Books, 1992, ISBN 1-55851-277-2,
> available in January at your favorite bookstore.
> 
>         Longtime jaxfanz, please note new title of book. I wrote it,
> the lawyers re-wrote it :-)
 
Jaxfanz and others have noted it.  I would urge you to notify your lawyers 
that their newly-proposed title for your book is uncomfortably close to the 
preexisting title, "FORTH: A TEXT AND REFERENCE".  That is, unless you and 
its authors/publisher have some agreement on why your book is a follow-on 
to theirs, or unless you hope to cash in by construing an imagined linkage 
of that sort.  
 
Whether or not your Forth book is in the same class as this excellent one, 
I don't expect that it will be in the same series.  If this is correct, 
please honor prior Forth authors by considering some different and more 
original style than the "FORTH:" opening word for your book's title.  
Thank you.
 
--Dick Miller
 
A. Richard & Jill A. Miller            | Miller Microcomputer Services |
InterNet: dmiller@im.lcs.mit.edu       | 61 Lake Shore Road            |
Voice: 508/653-6136, 9am-9pm EasternTZ | Natick, MA 01760-2099, USA    |
MMSFORTH: The cure for the common code.| 42 17 N, 71 21 W, Earth, Sol  | 
 
Newsgroups: comp.lang.forth
From: winter@island.COM (Steve Winter)
Subject: Re: 68HC11 Max-Forth Reading analog inputs
Organization: /usr/local/rn/organization
Date: Wed, 16 Dec 1992 22:38:15 GMT



	I'm making a data aquistion box for a racing motorcycle
	and I'm using a New Micros 68HC11 with on-board forth. 
	I need a simple chunk of code to let me read off of 
	one of the analog inputs. Something I could put in a 
	polling loop. I am just learning forth and I could not
	find anything in the documentation to help me.


	Thanks
	Steve Winter
	Island Graphics Corp.
	winter@island.com




-- 
+-----------------------------------------------------------------------------+
|   "By divine right, hail and kill!"               
|                   Man-O-War  Kings of Metal
|
Newsgroups: comp.lang.visual
From: strohm@mksol.dseg.ti.com (john r strohm)
Subject: Re: Accurate Timing in Visual Basic
Keywords: Visual Basic, Timing
Organization: Texas Instruments, Inc
Date: Tue, 15 Dec 1992 15:52:24 GMT

In article <29569@castle.ed.ac.uk> wbg@festival.ed.ac.uk (W Geake) writes:
>In order to run an analogue to digital convertor module from a serial
>port, I want to send a byte from the port every 10 ms.  This sets the
>sampling rate, so the accuracy of the interval is very important.  The
>VB Programmer's Guide mentions BUILT IN POTENTIAL FOR ERROR in timer
>controls, a great euphemism if ever I heard one.  Can I get good precision
>from VB, or do I need to work in C (please not!) or C++(worse still) or
>write a VxD (I'd rather sell life insurance)?

Bill, you have a fairly hairy problem on your hands.  In order to get that
rate, you are going to have to grab one of the timers (probably the keyboard
scan timer) and reprogram it to 100 Hz.  Then you are going to have to install
a custom interrupt handler to pump the serial port.  And you STILL have to
worry about DOS or something else taking over your machine for many milliseconds
while it does something it thinks is more important.

If I were in your shoes, I would grab a microcontroller or a single-chip
microcomputer and dedicate it to pumping the ADC.  If all you need is a pulse,
just so the ADC module gets SOMETHING, then something like a Motorola 68HC705K1
would probably work just fine.  If you need a real-live character, then an 8751
or something along those lines (68HC11, say) would work well.  (Note: I am
extremely fond of the New Micros Inc. F68HC11: it comes with Forth blown into
the on-board ROM.)
From: jvn@fermi.clas.Virginia.EDU (Julian V. Noble)
Newsgroups: comp.lang.misc
Subject: Re: Easy Extension Language Wanted
Date: 15 Dec 92 23:15:05 GMT
Organization: University of Virginia

Dear Mathias,

Smallest language I know, therefore easiest to write a compiler for, is Forth.
If you insist on writing the main app in C or C++, there are several Forth's
written in C, which gives extreme portability. Also a recent book by Smith
(I forget 1st name) called "Write your own compiler in C++" includes a disk
with code for producing a --you're way ahead of me!!-- Forth interpreter. I
don't know any specifically C++ features that are required for this, i.e.
you ought to be able to translate to plain C if necessary.

--jvn
From: paj@uk.co.gec-mrc (Paul Johnson)
Newsgroups: comp.lang.misc
Subject: Re: who should specify languages?
Date: 15 Dec 92 09:42:13 GMT
Reply-To: paj@uk.co.gec-mrc (Paul Johnson)
Organization: GEC-Marconi Research Centre, Great Baddow, UK

In article <1gbau5INN53d@network.ucsd.edu> mbk@lyapunov.ucsd.edu (Matt Kennel) writes:

>Why do language designers never consider the interface to another language
>worthy of the slightest standardization?  

Eiffel has a standard interface defined through the "external"
keyword.  The interface between objects and C is well defined in
"Eiffel: The Language".

Not all language designers are dumb.

Paul.
-- 
Paul Johnson (paj@gec-mrc.co.uk).	    | Tel: +44 245 73331 ext 3245
--------------------------------------------+----------------------------------
These ideas and others like them can be had | GEC-Marconi Research is not
for $0.02 each from any reputable idealist. | responsible for my opinions
From: dik@cwi.nl (Dik T. Winter)
Newsgroups: comp.lang.misc
Subject: Re: Safety.  Was: Re: Pointers
Date: 11 Dec 92 22:59:50 GMT
Organization: CWI, Amsterdam

In article <Bz1rFw.9s1@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
 >                                                     The hardware has
 > deteriorated, except for speed, for the number theorist; when Lehmer
 > wrote his criticism, virtually all computers had double-length integer
 > arithmetic.
You asserted that before, and I asked you to name a few computers from the
beginning of Fortran that had those capabilities.  I never saw a response.
Can you respond now?
 >              Many computers today do not have decent integer arithmetic
 > at all.  The CRAYs are arch examples of that; one has to do a lot of
 > extracting fields, packing and unpacking to even get at 24x24 -> 48
 > multiplication.
What extracting, packing and unpacking?
	S3	S1<24
	S4	S2<24
	S5	S3*S4
and look: the 48 bit product of the 24 bit quantities in S1 and S2 is now
in S5.  (And what where your complaints about the syntax for assemblers?)
-- 
dik t. winter, cwi, kruislaan 413, 1098 sj  amsterdam, nederland
home: bovenover 215, 1025 jn  amsterdam, nederland; e-mail: dik@cwi.nl
Newsgroups: comp.lang.misc
From: pmr@rock.concert.net (Paul M Reilly -- Personal Account)
Subject: Turing
Organization: Pajato Systems Group
Date: Fri, 18 Dec 1992 05:25:36 GMT

I recently came across the Turing language, which appears to be an Ada
derivative.  Can anyone tell me if it is freely available and where
one might access it (archie came up empty)?  It was being used in a CS
intro course at UNC-CH.
Thanks.
--
Paul M. Reilly				Pajato Systems Group
(919)847-7294				pmr@rock.concert.net
-- 
Paul M. Reilly				Pajato Systems Group
From: "elliott chapin" <elliott.chapin@canrem.com>
Subject: accurate timing in vi
Reply-To: "elliott chapin" <elliott.chapin@canrem.com>
Organization: Canada Remote Systems
Distribution: comp
Date: 15 Dec 92 18:13:57 EST

If there is ON TIMER() GOSUB you can use it to time an empty loop of
some kind or other then adjust the count.  You can make it portable from
machine to machine by having the program start with a speed test of its
own platform.

Elliott Chapin
---
  DeLuxe 1.12 #4315  elliott.chapin@canrem.com
--
Canada Remote Systems  - Toronto, Ontario
World's Largest PCBOARD System - 416-629-7000/629-7044
From: nimcompu@oneb.almanac.bc.ca
Newsgroups: comp.lang.misc
Subject: Sorting Algorithm Needed
Date: 19 Dec 92 04:23:48 GMT
Article-I.D.: oneb.D3H1VB1w164w
Organization: The Old Frog's Almanac, Nanaimo, B.C.

Does anyone have an algorithm in Pascal that sorts names/words 
alphabetically?  I would like one that does items that are three (3) words 
in length, such as 'Firstname Middlename Lastname.'  It may be a simple 
algorithm but being a programmer who has not done much programming, I have 
not figured it out yet.
                Thanks in advance.
                        nimcompu@oneb.almanac.bc.ca


           nimcompu@oneb.almanac.bc.ca (Eric van Wiltenburg)
     The Old Frog's Almanac  (Home of The Almanac UNIX Users Group)    
(604) 245-3205 (v32)    <Public Access UseNet>    (604) 245-4366 (2400x4)
        Vancouver Island, British Columbia    Waffle XENIX 1.64  
Xref: sparky comp.lang.misc:4017 comp.sys.super:1123
From: jlg@cochiti.lanl.gov (J. Giles)
Subject: Re: who should specify languages?
Organization: Los Alamos National Laboratory
Date: Mon, 14 Dec 1992 20:11:55 GMT

In article <id.L8RV.IQC@ferranti.com>, peter@ferranti.com (peter da silva) writes:
|> In article <1992Dec10.192524.25311@newshost.lanl.gov> jlg@cochiti.lanl.gov (J. Giles) writes:
|> [...]
|> > It works *really* well in programming environments in which several
|> > languages are available and are all compatible at the procedure call
|> > level.
|> 
|> It also works really well in UNIX, where programs are expected to work
|> together. I write tools in whatever language is best suited for the task.
|> Sometimes I write them several times as the requirements change: starting
|> as a shell script, then moving to awk/perl/tcl/..., and then to C. I have
|> one tool that's a combination of shell and C that started as Fortran and
|> PL/M and migrated bit by bit as time went on...

Having languages compatible only at the pipe-I/O level is not 
really acceptable.  It's too clumsy, slow, and inflexible to
be of any real use for production purposes.  Operationally,
a pipe is a weak subset of the functionality that should be
present in an interprocess communications package.  Semantically,
pipes are a very weak subset of function composition.  Among the
problems is the lack of type-checking across the protocol - all your
data must be reduced to byte streams (you *could* encode the type 
information into the stream, but who does?).  Another problem
is that all the communication requires two system calls, and on
most implementations: a trip through the system buffers for all
the data (both of these are *slow* and it's preferable not to
move the data at all).

No, all things considered, the level of compatibility needs to
be at the procedure call (or closer) for adequate interlanguage
operation.  This could be accomplished on each system by standardization
of the internal representation of data types which are common to most
languages, standardization of the procedure call protocol (if your
system hasn't already done so), and standardization of the format of
relocatables (which is already the most common way to proceed).
Finally, standardization of the most common data structuring 
mechanisms (structs, lists, unions, etc.) at least with regard
to their internal storage would be required.  None of these are
inherently beyond the realm of possibility.

Of course, part of my objection to UNIX is that many of the languages
and/or tools you mentioned are so poorly designed, hard to learn and
use, and so full of tricky incompatibilities that they are not really
acceptable even if they were more efficient, etc..

-- 
J. Giles
Xref: sparky comp.lang.misc:4024 comp.arch:11623