om OVER MINUS
String fetched from comment
Comment string
( This string is a simple comment)
( The comment can be enhanced to include parethises in the string)
( This string is an (enhanced) comment)
second only to premature optimisation and goto's.
Not understanding where it fits in. Is this meant to be in lieu of
." ," S" etc ?
Buddha said, om is boundless wisdom. ;-)
For us poor novices, could you please share some Forth code
to show how you have implemented your novel nestable comments?
Nested comments is a source of a lot of evil, second only to
premature optimisation and goto's.
I am not a fan of S\" TYPE as it tends to move the parsing and
interpretation problems to parts of the code / library that may
not be prepared for it, or where it would be quite an overhead
to anticipate every present and future possibility.
For instance,
having a backspace in a string has no obvious meaning in most
of the system code
and an application can simply redefine BS
to have it do what is necessary.
second only to premature optimisation and goto's.
How to code a state-machine without goto's?
-marcel
albeit not idiot-proof ... ( ) needs to be balanced.
For me the other issue was non-graphic characters. Unable to avoid it
I adopted a simplified form of 200x escapes whereby " becomes \22 .
On 04/03/2025 15:55, mhx wrote:...
How to code a state-machine without goto's?
But you probably knew about that so why doesn't it count as gotoless?
Does it make a difference in understandability whether you implement a
state transition as "goto state123" or in the Dijkstra-compatible
"state = state123"? So why should I care whether it is gotoless?
.( Use this when () are balanced )
@( Use this when "foo(" left () unblanced)) 1- type
foo (bar) "bat("
foo (bar) "bat)"--
On Wed, 5 Mar 2025 16:50:13 +0000, Anton Ertl wrote:
Does it make a difference in understandability whether you implement a
state transition as "goto state123" or in the Dijkstra-compatible
"state = state123"? So why should I care whether it is gotoless?
The syntax is fine (the one is just as unreadable as the other) but what >about the implementation?
I couldn't locate the pertinent subject at >https://www.cs.utexas.edu/~EWD/welcome.html, do you have a hint?
Gerry Jackson <do-not-use@swldwa.uk> writes:
On 04/03/2025 15:55, mhx wrote:...
How to code a state-machine without goto's?
But you probably knew about that so why doesn't it count as gotoless?
Does it make a difference in understandability whether you implement a
state transition as "goto state123" or in the Dijkstra-compatible
"state = state123"? So why should I care whether it is gotoless?
I couldn't locate the pertinent subject at >>https://www.cs.utexas.edu/~EWD/welcome.html, do you have a hint?
https://dl.acm.org/doi/10.1145/362929.362947
On 5/03/2025 6:57 pm, mhx wrote:
...
I am not a fan of S\" TYPE as it tends to move the parsing and
interpretation problems to parts of the code / library that may
not be prepared for it, or where it would be quite an overhead
to anticipate every present and future possibility.
What finally drove me to implement escapes was this:
: RC$ ( -- a n ) \ row/col string
bin? if s" \00" end s" 000" drop #asc ;
Every other way of doing it looked like a hack. ... And it solved
the embedded double-quote problem.
I couldn't locate the pertinent subject at >>>https://www.cs.utexas.edu/~EWD/welcome.html, do you have a hint?
https://dl.acm.org/doi/10.1145/362929.362947
That was a nice read! I see Dijkstra's argument that a goto as
we know it is lacking necessary functionality.
However, a state machine has well defined rules based on a
state's stored information and its inputs, causing it to go to
another well-defined state while generating outputs. In that
context a goto is harmless and merely serves as a crutch when
there are not enough computing nodes to serve all states in
parallel. How to make such an efficient crutch in Forth?
-marcel
However, a state machine has well defined rules based on a
state's stored information and its inputs, causing it to go to
another well-defined state while generating outputs. In that
context a goto is harmless and merely serves as a crutch when
there are not enough computing nodes to serve all states in
parallel. How to make such an efficient crutch in Forth?
String fetched from comment
Notes
i. Print "-->"
ul(...) Underline output of enclosed code
tell COUNT TYPE
om OVER MINUS
-fin-
Note The underline didn't show in the post.
mhx@iae.nl (mhx) writes:
However, a state machine has well defined rules based on a
state's stored information and its inputs, causing it to go to
another well-defined state while generating outputs. In that
context a goto is harmless and merely serves as a crutch when
there are not enough computing nodes to serve all states in
parallel. How to make such an efficient crutch in Forth?
You lost me. Why would one "serve all states in parallel"?
mhx@iae.nl (mhx) writes:
I am not a fan of S\" TYPE as it tends to move the parsing and >>interpretation problems to parts of the code / library that may
not be prepared for it, or where it would be quite an overhead
to anticipate every present and future possibility.
Can you elaborate on that, especially about the overhead?
For instance,
having a backspace in a string has no obvious meaning in most
of the system code
Nobody forces you you to use \b if it's inappropriate.
and an application can simply redefine BS
to have it do what is necessary.
One would have to define BS first; otherwise you cannot redefine it.
What is BS supposed to do, and what is redefining BS supposed to
achieve?
- anton
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 475 |
Nodes: | 16 (2 / 14) |
Uptime: | 18:30:51 |
Calls: | 9,487 |
Calls today: | 6 |
Files: | 13,617 |
Messages: | 6,121,092 |