  
  [1X1 [33X[0;0YThe Example Package[133X[101X
  
  [33X[0;0YThis  chapter  describes the [5XGAP[105X package [5XExample[105X. As its name suggests it is
  an  example  of  how  to  create  a [5XGAP[105X package. It has little functionality
  except for being a package.[133X
  
  [33X[0;0YSee  Sections [14X2.1[114X,  [14X2.2[114X  and [14X2.3[114X  for  how  to install, compile and load the
  [5XExample[105X package, or Appendix [14XA[114X for guidelines on how to write a [5XGAP[105X package.[133X
  
  [33X[0;0YIf you are viewing this with on-line help, type:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27X?Example package[127X[104X
  [4X[32X[104X
  
  [33X[0;0Yto see the functions provided by the [5XExample[105X package.[133X
  
  
  [1X1.1 [33X[0;0YThe Main Functions[133X[101X
  
  [33X[0;0YThe following functions are available:[133X
  
  [1X1.1-1 ListDirectory[101X
  
  [29X[2XListDirectory[102X( [[3Xdir[103X] ) [32X function
  
  [33X[0;0Ylists  the  files  in  directory  [3Xdir[103X (a string) or the current directory if
  called with no arguments.[133X
  
  [1X1.1-2 FindFile[101X
  
  [29X[2XFindFile[102X( [3Xdirectory_name[103X, [3Xfile_name[103X ) [32X function
  
  [33X[0;0Ysearches   for   the   file  [3Xfile_name[103X  in  the  directory  tree  rooted  at
  [3Xdirectory_name[103X  and  returns  the  absolute path names of all occurrences of
  this file as a list of strings.[133X
  
  [1X1.1-3 LoadedPackages[101X
  
  [29X[2XLoadedPackages[102X(  ) [32X function
  
  [33X[0;0Yreturns  a list with the names of the packages that have been loaded so far.
  All this does is execute[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XRecNames( GAPInfo.PackagesLoaded );[127X[104X
  [4X[32X[104X
  
  [33X[0;0YYou  might  like  to  check out some of the other information in the [10XGAPInfo[110X
  record (see [14X'Reference: GAPInfo'[114X).[133X
  
  [1X1.1-4 Which[101X
  
  [29X[2XWhich[102X( [3Xprg[103X ) [32X function
  
  [33X[0;0Yreturns the path of the program executed if [10XExec([3Xprg[103X[10X);[110X is called, e.g.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XWhich("date");         [127X[104X
    [4X[28X"/bin/date"[128X[104X
    [4X[25Xgap>[125X [27XExec("date");[127X[104X
    [4X[28XFri 28 Jan 2011 16:22:53 GMT[128X[104X
  [4X[32X[104X
  
  [1X1.1-5 WhereIsPkgProgram[101X
  
  [29X[2XWhereIsPkgProgram[102X( [3Xprg[103X ) [32X function
  
  [33X[0;0Yreturns  a  list  of paths of programs with name [3Xprg[103X in the current packages
  loaded. Try:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XWhereIsPkgProgram( "hello" );[127X[104X
  [4X[32X[104X
  
  [1X1.1-6 HelloWorld[101X
  
  [29X[2XHelloWorld[102X(  ) [32X function
  
  [33X[0;0Yexecutes the C program [10Xhello[110X provided by the [5XExample[105X package.[133X
  
  [1X1.1-7 FruitCake[101X
  
  [29X[2XFruitCake[102X[32X global variable
  
  [33X[0;0Yis a record with the bits and pieces needed to make a boiled fruit cake. Its
  fields satisfy the criteria for [2XRecipe[102X ([14X1.1-8[114X).[133X
  
  [1X1.1-8 Recipe[101X
  
  [29X[2XRecipe[102X( [3Xcake[103X ) [32X operation
  
  [33X[0;0Ydisplays  the  recipe  for  cooking  [3Xcake[103X, where [3Xcake[103X is a record satisfying
  certain  criteria  explained  here: its recognised fields are [10Xname[110X (a string
  giving the type of cake or cooked item), [10XovenTemp[110X (a string), [10XcookingTime[110X (a
  string),  [10Xingredients[110X  (a list of strings each containing an [10X_[110X which is used
  to line up the entries and is replaced by a blank), [10Xmethod[110X (a list of steps,
  each  of  which  is  a  string  or  list  of  strings), and [10Xnotes[110X (a list of
  strings).  The global variable [2XFruitCake[102X ([14X1.1-7[114X) provides an example of such
  a string.[133X
  
