Post Reply 
Walkthrough of an RPL program for an RPN programmer
08-20-2018, 01:09 PM
Post: #17
RE: Walkthrough of an RPL program for an RPN programmer
(08-19-2018 07:02 PM)Albert Chan Wrote:  Wait a second.

Expression -> x y z << ... >>, the overloaded symbol were ->, not << ... >> ?

<< ... >> still means code object, execution delayed until the locals are setup.

Now it make sense.

Otherwise, we created the locals before opening the scope, which make no sense.

I think the easiest way to understand it (at least for me) is as an unnamed (lambda) function arguments declaration.

-> x y z << ... >>

is equivalent to:

function(x,y,z) { ... }

and it does the same thing, takes "external" values (from the stack), assigns them local names then executes what's in scope. Defining locals out of the scope wouldn't make sense, but arguments on the other hand, are usually declared out of the scope.
And this is actually consistent with using an algebraic object as the scope, more like a mathematical function declaration:
f(x,y,z) '...'

In my RPL head this is how I "see" it.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Walkthrough of an RPL program for an RPN programmer - Claudio L. - 08-20-2018 01:09 PM



User(s) browsing this thread: 2 Guest(s)