13.2. ExHTML Expressions

Text-constants are text-expressions:

  [text] -> [tex]
       


There is the empty-list-constant:

  'NIL' -> [list]
       


Depending on the context, variables have type [tex] or type [list]:

  [variable] -> [tex]        -- returns the text-value of a text-variable
  [variable] -> [lex]        -- returns the list-value of a list-variable
       


Expressions [tex] resp. [lex] can be build according the signature of the following functions:

13.2.1. General Predicates

To build conditional expressions we provide some predicates:

equal(t1, t2) : [tex] x [tex] -> [bex]

return "true" if t1 = t2 else "false"

empty(l) : [lex] -> [bex]

return "true" if l is NIL-list else "false"

isList(t1) : [tex] -> [bex]

<=> variable named t1 is of type list

isText(t1) : [tex] -> [bex]

<=> variable named t1 is of type text

isNat(t1) : [tex] -> [bex]

<=> variable named t1 is of type nat

isMember(l1, t1) : [lex] -> [bex]

<=> text t1 is member of the list l1



13.2.2. Text Manipulation Functions

To manipulate text-values, we provide:

cat(t1, .. , tN) : [tex] x .. x [tex] -> [tex]

concate t1 and .. and tN, with N > 0

pathnameJoin(d, f) : [tex] x [tex] -> [tex]

return a pathname formed by prepending f to base d

write(t) : [tex] -> [tex]

returns t with side-effect: output of t via Msg.V

text(l) : [lex] -> [tex]

returns quoted text-representation of list l

subst(t1, t2, t3, c1) : [tex] x [tex] x [tex] x [card] -> [tex]

substitute first c1/all orccurences of t2 by t3 in text t1

pos(t1, t2) : [tex] x [tex] -> [card]

position of a subtext in a text

contains(t1, t2) : [tex] x [tex] -> [bex]

<=> text contains a subtext

sub(t1, c1, c2) : [tex] x [card] x [card] -> [tex]

extract a subtext starting at c1 of length c2

pathnameAbsolute(pn) : [tex] -> [bex]

<=> pn is an absolute pathname



13.2.3. List Functions

list-values can be build by the following functions:

list(t1, .. , tN) : [tex] x ... x [tex] -> [lex]

constructs a list of text-values t1, ... , tN, with N > 0



list-values can be manipulated by the following functions:

listSize(l1) : [lex] -> [card]

length of a list

tail(l1) : [lex] -> [lex]

tail of a list, i.e. the list without the first element

cons(t1, l1) : [tex] x [lex] -> [lex]

prepend element t1 to the head of the list l1

get(l1, c1) : [lex] x [card] -> [tex]

get the c1-th element of list l1

head(l1) : [lex] -> [tex]

get the first element of list l1

sort(l) : [lex] -> [lex]

lex-sort on the list

sortfn(l) : [lex] -> [lex]

lex-sort on the list respecting possible filename-extensions

sorttag(l) : [lex] -> [lex]

sort on the list respecting the tag-semantic

stableBranchTagFilter(l) : [lex] -> [lex]

returns a list of all the elements of source l, that represent release tags

reverse(l) : [lex] -> [lex]

reverse the list

append(l1, l2) : [lex] x [lex] -> [lex]

append l2 to l1

matchFilter(l, regex) : [lex] x [tex] -> [lex]

returns a list like l, where all elements matching regex are deleted

negMatchFilter(l, regex) : [lex] x [tex] -> [lex]

returns a list like l, where all elements match regex

listFilter(l, f) : [lex] x [lex] -> [lex]

returns a list like l, where all elements are also in f

negListFilter(l, f) : [lex] x [lex] -> [lex]

returns a list like l, where no element is also in f

addPrefix(l1, t1) : [lex] [tex] -> [lex]

add prefix t1 to every element of l1

addSuffix(l1, t1) : [lex] x [tex] -> [lex]

add suffix t1 to every element of l1



13.2.4. Conversion Functions

timeFmtShort(t1) : [tex] -> [tex]

short time format of real repr.

timeFmtLong(t1) : [tex] -> [tex]

long time format of real repr.

cardToText(c1) : [card] -> [tex]

convert cardinal c1 to a text

textToCard(t1) : [tex] -> [card]

convert a text to a cardinal

htmlTextFromISO(t) : [tex] -> [tex]

returns a text with HTML special characters escaped

htmlTextToISO(t) : [tex] -> [tex]

returns a text with HTML special characters converted to ISO characters

escapeURLEntry(t) : [tex] -> [tex]

returns a text with URL-special characters escaped

unescapeURLEntry(t) : [tex] -> [tex]

returns a text with escaped URL-special characters converted to ISO

split(t1, t2) : [tex] x [tex] -> [lex]

split text t1 into elements at every occurence of t2

join(l1, t1) : [lex] x [tex] -> [tex]

create a new text such that each element of l1 is separated from the next by t1

makeTag(t1, t2, t3, t4, t5) : [tex] x [tex] x [tex] x [tex] x [tex] -> [tex]

build a tag from kind, package name, major, minor, and patchlevel numbers

makeStableTag(t1, t2, t3, t4) : [tex] x [tex] x [tex] x [tex] -> [tex]

build a stable branch tag from kind, package name, major, and minor numbers

tagKind(t1) : [tex] -> [tex]

return the kind component of tag t1

tagPkgName(t1) : [tex] -> [tex]

return the package name component of tag t1

tagMajor(t1) : [tex] -> [tex]

return the major version number of tag t1

tagMinor(t1) : [tex] -> [tex]

return the minor version number of tag t1

tagPL(t1) : [tex] -> [tex]

return the patch level number of tag t1

tagVersion(t1) : [tex] -> [tex]

return the version number component of tag t1



13.2.5. Cardinal Functions

eq(c1, c2) : [card] x [card] -> [bex]

c1 = c2

lt(c1, c2) : [card] x [card] -> [bex]

c1 < c2

le(c1, c2) : [card] x [card] -> [bex]

c1 <= c2

gt(c1, c2) : [card] x [card] -> [bex]

c1 > c2

ge(c1, c2) : [card] x [card] -> [bex]

c1 >= c2



13.2.6. Layout Functions

computeColPartion(l, n) : [lex] x [cex] -> [cex]

returns the number of columns to represent l as a table with maxLineLen

substInListNth(l, t, n) : [lex] x [tex] x [cex] -> [lex]

substitutes all entries of l that have an index i = x*n by a text which is like t, where all occurences of $$$ are substituted by the corresponding entry t' of l and all occurences of ### are substituted by the modified corresponding entry escapeURLEntry(t') of l

substInListMatch(l, t, regex) : [lex] x [tex] x [tex] -> [lex]

substitutes all entries of l that match regex by a text which is like t, where all occurences of $$$ are substituted by the corresponding entry t' of l and all occurences of ### are substituted by the modified corresponding entry escapeURLEntry(t') of l

optionsList(l, p) : [lex] x [tex] -> [lex]

returns a list like l, where every entry is preceded by the OPTION-Tag except the entry p which is tagged as the preselected OPTION.

doColPartion(l, n) : [lex] x [cex] -> [lex]

returns a list like l, which is partionated in n columns where each first entry of a line is prefixed by "<TR>\n"; empty entries in the last column are represented by the value "".



13.2.7. File System Access Functions

dirContextDefined(pn) : [tex] -> [bex]

<=> a valid directory context exists for directory pn

directories(pn) : [tex] -> [lex]

returns all dir-entries in dir pn except "CVS"

files(pn) : [tex] -> [lex]

returns all file-entries in dir pn

directoriesFP(pn) : [tex] -> [lex]

full pathname directory list, i.e. all directories of directory pn with absolute pathnames

filesFP(pn) : [tex] -> [lex]

full pathname files list, i.e. all files of directory pn with absolute pathnames

exists(pn) : [tex] -> [bex]

<=> given file pn exists

isDir(pn) : [tex] -> [bex]

<=> pn is a directory

isFile(pn) : [tex] -> [bex]

<=> pn is an ordinary file

dcFileExists(pn) : [tex] -> [bex]

<=> file pn exists according to the cache

dcIsDir(pn) : [tex] -> [bex]

<=> pn is a directory according to the cache

dcIsFile(pn) : [tex] -> [bex]

<=> pn is an ordinary file according to the cache

readable(pn) : [tex] -> [bex]

file pn is readable (currently broken)

writeable(pn) : [tex] -> [bex]

file pn is writeable (currently broken)

fileModTime(pn) : [tex] -> [tex]

modification time of file pn as real repr.

fileContents(pn) : [tex] -> [tex]

contents of file pn or error text

fileSize(pn) : [tex] -> [card]

size of file pn

fileIgnorePattern(pn) : [tex] -> [tex]

file ignore patterns of given context

dirIgnorePattern(pn) : [tex] -> [tex]

directory ignore patterns of given context

setIgnorePatterns(t1, t2) : [tex] x [tex] -> [bex]

change the directory and file ignore patterns of the current context (bool)



13.2.8. Package Management Functions

To access version-control-info the following functions are defined:

pkgContextDefined(pn) : [tex] -> [bex]

<=> a valid package context exists for directory pn

pkgmAdminFiles() : -> [lex]

returns the list of ComPact-files for adminstration

pkgKinds() : -> [lex]

returns the list of possible package kinds

predTag(l, t) : [lex] x [tex] -> [tex]

returns the element from list l, that is the highest tag which is less than tag t. returns "" if such an element does not exist.

pkgvmAllVCTags() : -> [lex]

returns the list of all tags relative to 'package'

pkgvmCurDevelTag() : -> [tex]

returns the current development tag relative to 'package'

pkgvmLatestReleaseTag() : -> [tex]

returns the latest release tag relative to 'package' resp. the text 'no release up to now', if no release of 'package' exists

pkgvmCheckedOutInfo() : -> [tex]

returns info about the checked out status of relative to 'package'

pkgvmLocallyModified() : -> [bex]

<=> 'package' is locally modyfied

pkgvmUpToDate() : -> [bex]

<=> 'package' is up-to-date

pkgvmConflicts() : -> [bex]

<=> 'package' has pkgvmConflicts

pkgCurDevelTag(pn) : [tex] -> [tex]

current development tag of package at directory pn

pkgLatestReleaseTag(pn) : [tex] -> [tex]

latest release tag of package at directory pn

pkgCheckedOutInfo(pn) : [tex] -> [tex]

descriptive text of package state

pkgLocallyModified(pn) : [tex] -> [bex]

<=> package at directory pn is locally modified

pkgConflicts(pn) : [tex] -> [bex]

<=> package at directory pn conflicts with the repository

pkgUpToDate(pn) : [tex] -> [bex]

<=> package at directory pn is up-to-date

pkgAllVCTags(pn) : [tex] -> [lex]

list of all valid tags for package at directory pn

pkgFiles(pn, t1) : [tex] x [tex] -> [lex]

get files from package context pn with special status t1 ("added", "removed", "modified", "conflicting", "outofdate", "unknown', "known")



13.2.9. Project Management Functions

To access project-manager-info the following functions are defined:

prjContextDefined(pn) : [tex] -> [bex]

<=> a valid project context exists for directory pn

prjCollections() : -> [lex]

returns the list of all project-collections relative to 'project'

prjCollectionLocation(c) : [tex] -> [tex]

mapping from collection c to its pathname

prjPackages() : -> [lex]

returns the list of all project-packages relative to 'project'

prjPackageCollection(p) : [tex] -> [tex]

mapping from packagename p to its collection

prjModifiedPackages() : -> [lex]

returns the list of all modified project-packages relative to 'project'

prjModifiedAndDependingPackages() : -> [lex]

returns the list of all modified and depending project-packages relative to 'project'

prjOutOfDatePackages() : -> [lex]

returns the list of all out-of-date project-packages relative to 'project'

prjOutOfDateAndDependingPackages() : -> [lex]

returns the list of all out-of-date and depending project-packages relative to 'project'

prjUpToDatePackages() : -> [lex]

returns the list of all up-to-date project-packages relative to 'project'

prjPackagesWithConflicts() : -> [lex]

returns the list of all project-packages relative to 'project' that are conflicting with the repository

updateProjectCache() : -> [tex]

update the internal project state cache of the HTTP server and returns a string containing the update time

prjLocallyModified(pn) : [tex] -> [bex]

<=> project in directory pn contains one or more modified packages

prjConflicts(pn) : [tex] -> [bex]

<=> project in directory pn contains one or more packages with conflicts

prjUpToDate(pn) : [tex] -> [bex]

<=> project in directory pn contains only up-to-date packages (which may be locally modified)



13.2.10. Pool Management Functions

poolContextDefined(pn) : [tex] -> [bex]

<=> a valid pool context exists for directory pn

poolTPC(pn) : [tex] -> [tex]

the current TPC of pool located at directory pn

poolPkgVersions(pn) : [tex] -> [lex]

all package version pairs in pool located at directory pn

poolMatchingPkgs(pn, t1) : [tex] x [tex] -> [lex]

all package versions pairs of pool located at directory pn matching expression t1



13.2.11. Environment Functions

env(t1) : [tex] -> [tex]

lookup a value named t1 in the current ExHTML environment

qenv(t1) : [tex] -> [tex]

lookup a value named t1 in the query environment

delGlobalVal(t1) : [tex] -> [tex]

delete value named t1 from the global environment

delSessionVal(t1) : [tex] -> [tex]

delete value named t1 from the session environment

delContextVal(t1) : [tex] -> [tex]

delete value named t1 from the context environment

defGlobal(t1, t2) : [tex] x [tex] -> [tex]

define a global text variable named t1 with value t2 and return the old value or nil

defSession(t1, t2) : [tex] x [tex] -> [tex]

define a session text variable named t1 with value t2 and return the old value or nil

defContext(t1, t2) : [tex] x [tex] -> [tex]

define a context text variable named t1 with value t2 and return the old value or nil

defGlobalList(t1, l1) : [tex] x [lex] -> [lex]

define a global list variable named t1 with value l1 and return the old value or nil

defSessionList(t1, l1) : [tex] x [lex] -> [lex]

define a session list variable named t1 with value l1 and return the old value or nil

defContextList(t1, l1) : [tex] x [lex] -> [lex]

define a context list variable named t1 with value l1 and return the old value or nil



13.2.12. Miscellaneous Functions

history(t1) : [tex] -> [lex]

history of edit|exec|load

historyPop(t1) : [tex] -> [tex]

pop last entry from history

historyPush(t1, t2) : [tex] x [tex] -> [lex]

add to history of edit|exec|load

envFileName() : -> [tex]

the most probable location of the environment file compact-env-rc

quote(t1) : [tex] -> [tex]

do not interpret ExHTML construct t1, rather use its syntax directly

resource(pn) : [tex] -> [tex]

return the named resource pn either from the internal bundle or the contents of a file found on the resource path