Post Reply 
Walkthrough of an RPL program for an RPN programmer
08-19-2018, 02:16 PM (This post was last modified: 08-19-2018 02:16 PM by Thomas Klemm.)
Post: #6
RE: Walkthrough of an RPL program for an RPN programmer
(08-19-2018 01:13 PM)Albert Chan Wrote:  You mean like this ?

Except that the Clojure implementation provides more:
Quote:(partition n coll) (partition n step coll) (partition n step pad coll)

Returns a lazy sequence of lists of n items each, at offsets step
apart. If step is not supplied, defaults to n, i.e. the partitions
do not overlap.
If a pad collection is supplied, use its elements as
necessary to complete last partition upto n items. In case there are
not enough padding elements, return a partition with less than n items.

What I meant is that I wasn't aware of a built-in function similar to that in Python.
Of course we can always craft something by ourselves if in need as you demonstrated.

Quote:Perhaps we do not need partitioned list, map, and sum.

The point of using examples in Python or Clojure was to show code similar to the RPL program.
That might help someone to understand how DOSUBS works if they are familiar with either language.

Cheers
Thomas
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 - Thomas Klemm - 08-19-2018 02:16 PM



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