Replies: 3 comments 6 replies
-
|
Hi Tony,
I love the behaviour which is akin to HERE< in the Unix
shell. I looked up my database of Forth standards. Only
79-STANDARD ('EXPECT') specified that input is to be read
from "the terminal." Later standards say nothing about
what the input stream is--they do not even refer to an
input stream.
Clearly, you are in unspecified territory. The prevailing
theory goes like this: if you can pass Gerry Jackson's test
suite, then your implementation is acceptable. It's some
argument from authority but there you go...
Adding a clarification to the specification has, of course,
political implications. Being on the Forth2012 standardization
committee, I see two options at this point:
[1] we leave it open as it is and your implementation is
compliant.
[2] we specify that the input had to be supplied by the
system console (BLK @ is zero). In which case your
code would be not compliant.
Please keep me informed as to which avenue would
best suit you.
[Note] My own implementation reads from the console.
Which absolutely does not mean you could operate in
a different way. Right now, I do not understand how this
could be done in block context. It might; I'm just not
there yet!
All the best.
Francois
Ref: https://github.com/gerryjackson/forth2012-test-suite

|
Beta Was this translation helpful? Give feedback.
-
|
6.1.0695 The word "receive" is a formal term, the meaning of which is defined in the section 2.1 Definitions of terms:
A file included via This means that |
Beta Was this translation helpful? Give feedback.
-
|
I ultimately came up with a solution, limited to one line, in block context. This was hard! |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When
ACCEPTis called byINCLUDEorLOAD(or redirected standard input) should it read input from that source?Consider this fragment
a.4th:PAD /PAD ACCEPT Say something clever. PAD SWAP '>' EMIT TYPENow
INCLUDEit:Is this correct expected behaviour?
Update 0
Created some test cases for thought:
t{ INCLUDE accept.p4 PAD SWAP S\" Say something clever.\n" COMPARE -> 0 }t PAD /PAD ERASE t{ PAD /PAD S\" ACCEPT\nSalut tout monde." EVALUATE PAD SWAP S" Salut tout monde." COMPARE -> 0 }tBeta Was this translation helpful? Give feedback.
All reactions