Re: Why is 4+ legal?

From: Elizabeth D. Rather <erather_at_forth.com>
Date: Fri, 01 Jun 2001 13:34:23 -0700

It is always preferable to enter numbers the way you're accustomed to
seeing them. If you're using things like phone numbers, angular amounts,
dates, etc. as initial values in your code, for example, it's certainly
more readable to see them in the way they're normally represented. Many of
these do need to be double numbers, too, in 16-bit implementations such as
many of our SwiftX targets. Not to mention that the additional logic in
your versions takes both space and execution time (better to handle at
compile time!).

Cheers,
Elizabeth

At 01:20 PM 6/1/01 -0700, David Graham wrote:

>Why not?
>
> : FOO ( d1 -- d2) 100 S>D D+ ;
>or
>: FOO ( d1 -- d2) 100 0 D+ ;
>
>David
>
> > Double number conversion is indeed used while compiling. Without it you
> > could not enter double literals.
> >
> > : FOO ( d1 -- d2) 100. D+ ;
> >
> > > -----Original Message-----
> > > From: swiftx-bounce_at_forth.com [mailto:swiftx-bounce_at_forth.com]On Behalf
> > > Of David Graham
> > > Sent: Friday, June 01, 2001 12:17 PM
> > > To: swiftx_at_forth.com
> > > Subject: [swiftx] Re: Why is 4+ legal?
> > >
> > >
> > >
> > > Kevin and Elizabeth,
> > > Thanks for the feedback. I did find the explanation in the SwiftX
> > > documentation. It is neat to know that a double value
> > > -101 can be entered as -1..:-0-:..1-. I can write some really
> > > cryptic code
> > > with that <g>.
> > >
> > > My problem was not being aware that there were double number flags, i.e.
> > > punctuation. I graduated to SwiftX from Vesta and New Micro
> > > Forth that had
> > > dedicated words for the conversion, such as S>D. That works fine with
> > > source code, but I can see that the SwiftX method would be convenient
> > > dealing with user input. I had expected 4+ would have
> > generated an error
> > > message alerting me to the typo, and was curious why SwiftX did not
> > > complain. It would help me avoid my typos if SwiftX disabled the double
> > > number flags while compiling, where they are not really needed, and only
> > > used them when interpreting user input, but I can live with how
> > it is now
> > > that I understand what is going on.
> > >
> > > David Graham
> > >
> > > ----------------------------------------------------------------------
> > > swiftx_at_forth.com The SwiftX programming discussion email list
> > > To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
> > > For help with listar commands, send subject "help" to listar_at_forth.com
> > > Archives are located at http://www.forth.com/swiftx -- check them out!
> >
> > ----------------------------------------------------------------------
> > swiftx_at_forth.com The SwiftX programming discussion email list
> > To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
> > For help with listar commands, send subject "help" to listar_at_forth.com
> > Archives are located at http://www.forth.com/swiftx -- check them out!
>
>----------------------------------------------------------------------
>swiftx_at_forth.com The SwiftX programming discussion email list
>To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
>For help with listar commands, send subject "help" to listar_at_forth.com
>Archives are located at http://www.forth.com/swiftx -- check them out!

================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310-491-3356
5155 W. Rosecrans Ave. #1018 Fax: +1 310-978-9454
Hawthorne, CA 90250
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
================================================

----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/swiftx -- check them out!
Received on Fri Jun 01 2001 - 13:32:40 PDT


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.