I use gforth in a terminal window to type in some quick conversions between decimal and hexadecimal numbers. After a recent upgrade to a new gforth version I see:
$ gforth
Gforth 0.7.9_20240104
$ff ok 1
. 255 ok
255 ok 1
hex.
*terminal*:4:1: warning: hex. is obsolete$FF ok
What am I supposed to be using in place of "hex." to display a number in hexadecimal?
I use gforth in a terminal window to type in some quick conversions
between decimal and hexadecimal numbers. After a recent upgrade to a new >gforth version I see:
$ gforth
Gforth 0.7.9_20240104
$ff ok 1
. 255 ok
255 ok 1
hex.
*terminal*:4:1: warning: hex. is obsolete$FF ok
What am I supposed to be using in place of "hex." to display a number in >hexadecimal?
I see some recommendations like "Don’t use hex, use
base-execute instead." in the manual, but I don't understand what that
is trying to tell me.
Buzz McCool <buzz_mccool@yahoo.com> writes:
What am I supposed to be using in place of "hex." to display a number in >>hexadecimal?
H.
BTW (I don't know gforth well enough) is there any formatted output in gforth >e.g. similar to C printf?
Contrived: 12 dup "This is %d in hex: %X" -> This is 12 in hex: C
Buzz McCool <buzz_mccool@yahoo.com> writes:
I use gforth in a terminal window to type in some quick conversions >>between decimal and hexadecimal numbers. After a recent upgrade to a new >>gforth version I see:
$ gforth
Gforth 0.7.9_20240104
$ff ok 1
. 255 ok
255 ok 1
hex.
*terminal*:4:1: warning: hex. is obsolete$FF ok
What am I supposed to be using in place of "hex." to display a number in >>hexadecimal?
H.
This is in line with common practice in other Forth systems.
What am I supposed to be using in place of "hex." to display a number in >>>hexadecimal?
H.
This is in line with common practice in other Forth systems.
lxf/ntf has had h. from the beginning. It is one of the most used debugging tools!
There is also h.s which show the stack items in hex and .. that dumps and clears the stack
On 22/03/2024 8:06 am, Buzz McCool wrote:
I use gforth in a terminal window to type in some quick conversionsbetween decimal and hexadecimal numbers. After a recent upgrade to a new >gforth version I see:
in hexadecimal?
$ gforth
Gforth 0.7.9_20240104
$ff ok 1
. 255 ok
255 ok 1
hex.
*terminal*:4:1: warning: hex. is obsolete$FF ok
What am I supposed to be using in place of "hex." to display a number
Did you try h. ?
As for docs 'locate hex.' will point you to the file where it's defined and >alternatives might exist.
Anton Ertl wrote:
Buzz McCool <buzz_mccool@yahoo.com> writes:
I use gforth in a terminal window to type in some quick conversions >>>between decimal and hexadecimal numbers. After a recent upgrade to a new >>>gforth version I see:
$ gforth
Gforth 0.7.9_20240104
$ff ok 1
. 255 ok
255 ok 1
hex.
*terminal*:4:1: warning: hex. is obsolete$FF ok
What am I supposed to be using in place of "hex." to display a number in >>>hexadecimal?
H.
This is in line with common practice in other Forth systems.
lxf/ntf has had h. from the beginning. It is one of the most used
debugging tools!
There is also h.s which show the stack items in hex and .. that dumps
and clears the stack
BR
Peter
In article <65fcd9a8$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
On 22/03/2024 8:06 am, Buzz McCool wrote:
I use gforth in a terminal window to type in some quick conversionsbetween decimal and hexadecimal numbers. After a recent upgrade to a new
gforth version I see:
in hexadecimal?
$ gforth
Gforth 0.7.9_20240104
$ff ok 1
. 255 ok
255 ok 1
hex.
*terminal*:4:1: warning: hex. is obsolete$FF ok
What am I supposed to be using in place of "hex." to display a number
Did you try h. ?
As for docs 'locate hex.' will point you to the file where it's defined and >> alternatives might exist.
Neither will work with 0.7.3 that most people have.
Groetjes Albert
In article <65fcd9a8$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:[...]
On 22/03/2024 8:06 am, Buzz McCool wrote:
*terminal*:4:1: warning: hex. is obsolete$FF ok
Did you try h. ?
As for docs 'locate hex.' will point you to the file where it's defined and >>alternatives might exist.
Neither will work with 0.7.3 that most people have.
Buzz McCool <buzz_mccool@yahoo.com> writes:
What am I supposed to be using in place of "hex." to display a number in
hexadecimal?
H.
This is in line with common practice in other Forth systems.
but not h.
https://gforth.org/manual/Word-Index.html#Word-Index_fn_letter-H
H.
This is in line with common practice in other Forth systems.
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
H.
This is in line with common practice in other Forth systems.
The warning message about HEX. is annoying in a system that has been
around for so long. IMHO it would be better for HEX. and H. to both
work, without HEX. generating unnecessary warning messages.
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
H.
This is in line with common practice in other Forth systems.
The warning message about HEX. is annoying in a system that has been
around for so long. IMHO it would be better for HEX. and H. to both
work, without HEX. generating unnecessary warning messages.
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
H.
This is in line with common practice in other Forth systems.
The warning message about HEX. is annoying in a system that has been
around for so long. IMHO it would be better for HEX. and H. to both
work,
without HEX. generating unnecessary warning messages.
Buzz McCool <buzz_mccool@yahoo.com> writes:
but not h.
https://gforth.org/manual/Word-Index.html#Word-Index_fn_letter-H
Yes, I only added H. to the documentation yesterday. In general, >documentation is quite a bit behind development, and the state of the >documentation is why we have not released Gforth 1.0 yet. I document
as I find the time.
- anton
I am guessing that NIP came in with TOS caching, because with it
NIP is just a stack pointer in- or decrement
On 25/03/2024 6:53 am, minforth wrote:
I am guessing that NIP came in with TOS caching, because with it
NIP is just a stack pointer in- or decrement
Likely it was frequency. In the F83 distribution NIP occurs 21 times.
(F83 being the replacement for FigForth).
... IMHO it would be better for HEX. and H. to both
work, without HEX. generating unnecessary warning messages.
On 3/23/2024 12:49 AM, Paul Rubin wrote:
... IMHO it would be better for HEX. and H. to both
work, without HEX. generating unnecessary warning messages.
Given there is a DEC. word, having a HEX. word (that doesn't throw
errors) does seem more intuitive / orthogonal than just the H. found in
other Forth systems.
If you design a Forth-like language from scratch that is consistent and orthogonal, there is a whole bunch more that you have to do.
albert@spenarnc.xs4all.nl wrote:
If you design a Forth-like language from scratch that is consistent and
orthogonal, there is a whole bunch more that you have to do.
For instance, start with a grammar, and with dynamic strings as fundamental data type ... ;-)
In article <utumib$1s4nd$1@dont-email.me>,
Buzz McCool <buzz_mccool@yahoo.com> wrote:
On 3/23/2024 12:49 AM, Paul Rubin wrote:
... IMHO it would be better for HEX. and H. to both
work, without HEX. generating unnecessary warning messages.
Given there is a DEC. word, having a HEX. word (that doesn't throw
errors) does seem more intuitive / orthogonal than just the H. found in
other Forth systems.
Tradition trumps intuition.
If you design a Forth-like language from scratch that is consistent and orthogonal, there is a whole bunch more that you have to do.
Intuition is memory - nothing more.
... If you design a Forth-like language from scratch that is consistent and orthogonal, there is a whole bunch more that you have to do.
Backtrace:h.<<<
Given there is a DEC. word, having a HEX. word (that doesn't throw
errors) does seem more intuitive / orthogonal than just the H. found in >other Forth systems.
minforth wrote:
albert@spenarnc.xs4all.nl wrote:
If you design a Forth-like language from scratch that is consistent and
orthogonal, there is a whole bunch more that you have to do.
For instance, start with a grammar, and with dynamic strings as fundamental >> data type ... ;-)
How to define a grammar for a language that allows to change every word in both
name and behavior, depending on various contexts?
dxf wrote:
[..]
Intuition is memory - nothing more.
It includes reptile memory.
-marcel
... So I have unobsoleted HEX.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 914 |
Nodes: | 10 (1 / 9) |
Uptime: | 237:24:35 |
Calls: | 12,162 |
Calls today: | 5 |
Files: | 186,518 |
Messages: | 2,232,733 |