RPL stackrobatics decoder
|
07-10-2018, 07:17 AM
Post: #4
|
|||
|
|||
RE: RPL stackrobatics decoder
(07-09-2018 04:14 PM)Claudio L. Wrote: Any more rules or suggestions to improve on this? Not a suggestion but looking at Thomas Okken's program here: Code: << DUP 1 - -> n n1 I wonder how you would ever end up with something like this: Code: double[][] hilbert(int n) { Commands like DUPN, ->LIST or ->ARRY consume or produce an arbitrary number of parameters. We know their exact numbers only at runtime. Thus using local variables like in case of + or MOD wouldn't work. And then there are idiomatic ways to do something like looping through an array. C Code: const char* name = "Claudio"; Python Code: name = "Claudio" Of course we could mimic the same behaviour in Python: Code: name = "Claudio" But that would not be considered Pythonic. Thus I'm not sure if it really helps to automatically translate RPL into other languages. Most probably you end up with something that is not idiomatic and will be hard to understand. However it could be helpful to automatically create stack-diagrams, e.g. when calculating the complex arccos function. Cheers Thomas |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
RPL stackrobatics decoder - Claudio L. - 07-09-2018, 04:14 PM
RE: RPL stackrobatics decoder - Thomas Klemm - 07-09-2018, 05:29 PM
RE: RPL stackrobatics decoder - Claudio L. - 07-09-2018, 06:12 PM
RE: RPL stackrobatics decoder - Thomas Klemm - 07-10-2018 07:17 AM
RE: RPL stackrobatics decoder - Claudio L. - 07-10-2018, 04:42 PM
RE: RPL stackrobatics decoder - pier4r - 07-11-2018, 11:24 AM
|
User(s) browsing this thread: 1 Guest(s)