[SOLVED] DSRN (dog slow roman numerals)
|
06-15-2014, 12:03 PM
(This post was last modified: 06-15-2014 12:04 PM by Claudio L..)
Post: #34
|
|||
|
|||
RE: DSRN (dog slow roman numerals)
(06-13-2014 05:15 PM)DavidM Wrote: So I had to insert an empty string into the list ("" +) just before \GSLIST was called to make sure it always had something to add. This is a neat trick, and it also solves the problem of an empty list: if the list is empty, by adding the additive zero object (in whatever object type you are working on, on your case strings), the list ends up with the element zero of the correct type, so \GSLIST implemented to work on one element would return the proper value. For the current implementation you'd have to append the zero object twice to make sure it doesn't fail for empty lists: Code:
And the same trick works by adding the unity object for the product of a list. I'll make sure to remember this trick to put in the documentation of these commands (I hope you are not planning to patent this trick!). Claudio |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)