Use of Smart Public Functions

Table of Contents

1 Abstract

This paper is obsolescent. It is too much work to name and segregate smart function names. A smart function is detected in its syntax. Typically:

someSmartFunction () { : abstract ...; ${@:-echo} someFile,orDirectory name; }

My practice has evolved, managing upwards of 2000 functions, many are now in a rarely sourced retiredlib. Also, with rapidly advancing computing speed, I've now added unpacking function libraries into individual files.

The evolutionary thread takes us to the Directory Function Grep practice.

Using smart public functions a developer designates local and public functions. A public function may be accessed from any directory on the user PATH, a local function is accessed via a relative path.

2 TODO Smart Functions

Before proceeding, find the stand-alone smart function

3 Implementation

The first requirement of a smart function is it's first argument must also be a function or a command. It must fulfill this bit of shell syntax:

smart_fun () { ${@:-echo} namea nameb ... ; } 
declare -f $(smart_fun)    # shows the function bodies, or
smart_fun declare -f       # also works, so the default 
smart_fun                  # simply lists their names.

3.1 TODO list maintenance

No MORE smart_lists

4 TODO History, retire

The smart list is a generalization of what I'd previously called a smart file. A smartfile is, in effect, a smart_list with a single element. It might be called a smart_value.

This practice is now obsolescent. Collecting the smartfiles in a central repository was more trouble than it was worth. These paragraphs will soon become COMMENTs in this document.

5 references

6 history

event date comment
opened <2017-07-18 Tue> cloned from development library
first main edit <2017-10-26 Thu> simplified smart, public
closing down <2021-03-11 Thu> looking for simple smart names

Author: Marty McGowan

Created: 2021-03-11 Thu 11:01

Validate