Post Reply 
[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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: DSRN (dog slow roman numerals) - HP67 - 06-11-2014, 07:06 PM
RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 11:44 AM
RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 04:49 PM
RE: DSRN (dog slow roman numerals) - HP67 - 06-15-2014, 12:02 PM
RE: DSRN (dog slow roman numerals) - HP67 - 06-16-2014, 06:09 AM
RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 05:46 PM
RE: DSRN (dog slow roman numerals) - Claudio L. - 06-15-2014 12:03 PM



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