Is there a way to access a stack element by its index in Forth without selecting all the elements above it?
For example, if I have numbers from 1 to 1000 pushed onto the stack, how can I get the 500th element?
500 PICK
... will copy the 500 level item down the stack to the top of the stack in Forth79.
And if you use PICK at Fort, you can define it as
: PICK ?DUP IF SWAP >R 1- RECURSE R> SWAP EXIT THEN DUP ;
(Of course, an iterative version is also possible.)
Source: https://habr.com/ru/post/1500596/More articles:How to deserialize xml created by to_xml () in google appengine - pythonIterating files with boost :: filesystem 3.0 - c ++Powershell call through C # in a web application - problems with application pool id - c #Xcode - How to switch view in storyboard - iossynonym data structure - algorithmhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1500597/how-to-batch-convert-sph-files-to-wav-with-sox&usg=ALkJrhgUfisk_JZED1yHTafEacOrvbI6qwIs it possible to query the database using the value passed in the url and write the result of the query to the url using mod_rewirite? - phpHow to serve static objects without image from readthedocs site? - gitLogger, power line output - python.dat instead of text using mailx on RedHat Linux - linuxAll Articles