prefix notation and () on newRPL project
|
04-20-2020, 02:01 AM
(This post was last modified: 04-22-2020 08:43 PM by Albert Chan.)
Post: #8
|
|||
|
|||
RE: prefix notation and () on newRPL project
Here is a *fast* rpn macro for Chez Scheme
Instead of using macro pattern matching, the code rearrange the list of syntax objects. Code: (define ^ expt) scheme> (load "rpn.ss") scheme> (define phi (rpn 5 sqrt @ 1 + 2 /)) scheme> (define (fib n) (rpn phi n ^ 1 phi - n ^ - 5 sqrt @ /)) scheme> (fib 10) 55.000000000000014 scheme> (fib 20) 6765.000000000005 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)