List Commands Library for 50g
|
07-30-2018, 10:26 PM
Post: #376
|
|||
|
|||
RE: List Commands Library for 50g
(07-30-2018 08:16 PM)Didier Lachieze Wrote: SL→S: converts a list of characters to a string => ΣLIST(list) This reminds me of another opportunity to reinforce a point I made in the previous post (the one about base conversions). ΣLIST can be used on a 50g to accomplish the same goal. It's what I normally use for concatenating lists of strings in RPL code if any of the strings are longer than 1 character. ΣLIST is a ROMPTR in RPL code, so it takes up the same 5.5 bytes that any library call does. No advantage there. { "A" "B" "C" "D" } ΣLIST returns a result in about .023s, and { "A" "B" "C" "D" } SL→S does the same thing in about .018s. SL→S is marginally faster for that list, but not anything to get excited about. The real benefit comes as the input list grows larger. A list of 500 characters takes ΣLIST 1.521s, but that same list is completed by SL→S in .0385s. SL→S is more limiting in what it accepts as input (it only accepts a list of single characters), but the payoff for that limitation is enhanced performance. This is a common theme to many of the ListExt commands. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)