Best name for the procedure "currentpoint newpath moveto"

Question: Do you have any suggestions for improving names for these functions?

Since newpath and stroke cause the current point to become undefined, I usually define procedures such as

/new_path     { currentpoint newpath moveto             } bind def
/close_stroke { currentpoint closepath stroke moveto    } bind def

However, these names are actually examples of how to write unreachable code , and I would like to call them something else, but I can’t come up with any good names (except maybe something like newpath_without_undefining_currentpoint, and then the advantage of using the procedure more or less gone).

In search of existing uses in pdf_ops.ps, the following came from ghostscript:

/ tn {currentpoint newpath moveto} bdef% Obsolete, never used.

and tn is not a better name.

Edit: What I mean, having unsupported characteristics, is that I finish newpath and new_pathboth do the same thing, but a little differently, and there is nothing hint of anything in the names. I know that identifiers often stay short to save space, but this is not a problem for my manually written files.

+3
source share
2 answers

How about using /beginpath(or /startpath) and /completepath?

+2
source

Your names look good to me. I would risk a couple of mine - /newpath_hereand /stroke_here.

tn is not a better name.

- , , PS ( ). , PDF ( ).

+1

Source: https://habr.com/ru/post/1706221/


All Articles