-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-ROT not in 2012 Standard #61
Comments
On 10/03/2018 at 12:15 AM, "Budsy" ***@***.***> wrote:
I was puzzled to see that -ROT is not in the 2012 Forth core word
list. Ok, I know that ROT ROT would be the equivalent, and 2 ROLL
would do the same thing. But, gosh, I have been using -ROT from
various Forths for a long time, and use it a lot. If it were part
of a standard Forth, it could be optimized in ML, for example. So,
arguments for not relying on the inline code:
: -ROT ( n1 n2 n3 -- n3 n2 n1 ) ROT ROT ; \ a pity to
have to use this. slower
: -ROT ( n1 n2 n3 -- n3 n2 n1) 2 ROLL ; \ sobbing now... have
to push a value on stack, slower
Thoughts?
Just had a quick scan and it is not even in the 2012 standard. If you
are creating a standard system, there is nothing to prevent you from
making a more optimised -ROT available if you properly declare its
existence and any dependences your programmes may have on it
being there.
Regards
Paul E. Bennett IEng MIET
Systems Engineer
Lunar Mission One Ambassador
--
********************************************************************
Paul E. Bennett IEng MIET.....
Forth based HIDECS Consultancy.............
Mob: +44 (0)7811-639972
Tel: +44 (0)1392-426688
Going Forth Safely ..... EBA. www.electric-boat-association.org.uk..
********************************************************************
|
On Sat, Mar 10, 2018 at 12:15:10AM +0000, Budsy wrote:
I was puzzled to see that -ROT is not in the 2012 Forth core word list.
It's not in Forth 2012 at all. Nobody proposed it.
If you think it's worth the effort, propose it at forth-standard.org.
Arguments:
For: It is widely available.
Against: It adds a word. There are compilers that produce the same
code for ROT ROT as for -ROT. It's not among the stack manipulation
words that Chuck Moore brought down from the mountain.
Be prepared for a lot of nonsense from others when making a proposal.
- anton
|
[DEFINED] should be your friend. Only define -ROT if it is not already defined.
Am 10. März 2018 01:15:08 MEZ schrieb Budsy <notifications@github.com>:
…I was puzzled to see that -ROT is not in the 2012 Forth core word list.
Ok, I know that ROT ROT would be the equivalent, and 2 ROLL would do
the same thing. But, gosh, I have been using -ROT from various Forths
for a long time, and use it a lot. If it were part of a standard Forth,
it could be optimized in ML, for example. So, arguments for not relying
on the inline code:
: -ROT ( n1 n2 n3 -- n3 n2 n1 ) ROT ROT ; \ a pity to have to
use this. slower
: -ROT ( n1 n2 n3 -- n3 n2 n1) 2 ROLL ; \ sobbing now... have to
push a value on stack, slower
Thoughts?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#61
--
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*
http://bernd-paysan.de/
|
Yes, I do that sort of thing in my code-- conditionally compiling -- but I might be having to do this all the time for what 'feels' like it should be a standard primitive. Acttually, -ROT is in my system (SwiftForth), so it's more of an academic argument for me at this point. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was puzzled to see that -ROT is not in the 2012 Forth core word list. Ok, I know that ROT ROT would be the equivalent, and 2 ROLL would do the same thing. But, gosh, I have been using -ROT from various Forths for a long time, and use it a lot. If it were part of a standard Forth, it could be optimized in ML, for example. So, arguments for not relying on the inline code:
: -ROT ( n1 n2 n3 -- n3 n2 n1 ) ROT ROT ; \ a pity to have to use this. slower
: -ROT ( n1 n2 n3 -- n3 n2 n1) 2 ROLL ; \ sobbing now... have to push a value on stack, slower
Thoughts?
The text was updated successfully, but these errors were encountered: