Hits since 2025-02-03 15:44:10:
12

Rosevear Software



dofun:

Changes to dofun

I modified this function definition.  This was an important change.  It corrected a mistake.  My SAM was not always correctly following a principle that I think it should follow.  Namely, I wanted it to always allow new additions to the command set (as shown at the top of the screen when you use the "menu" command") to take priority over older additions when there is a conflict.

It was behaving correctly for the case of executables that are governed by the PATH.  But it was not always behaving correctly for qualified function definitions.  It turned out I had to invert one of my processes.  I was processing directories from left to right in the PATH when looking for qualified function definitions (files that end in .sam, have "#OK SAM" in the first ten lines and define a function with a name that agrees with the base of the file name).  I should have been processing them in the other direction—from right to left.

For executables those named at the left of the PATH have priority, but for functions, those defined last have priority.  This mistake was natural, as it is harder to process in the reverse—right to left—direction.  But I accomplished it and made the change.

© Joseph Rosevear
  |   Source touched: 2025-02-05 13:06:05