nex3 / arc watch
public
Description: Paul Graham's Brand New Lisp
Home | Edit | New

Description of all Anarki macros/functions

Name Description
w/table (from “arc.arc”)
[mac] (w/table var . body)
Creates a table assigned to `var’ for use in `body’.
spanclass (from “html.arc”)
[mac] (spanclass name . body)
firstn-that (from “arc.arc”)
[fn] (firstn-that n f xs)
Returns the first `n’ elements of `xs’ which pass `f’.
output-history-update (from “arc.arc”)
[fn] (output-history-update val)
input-history-update (from “arc.arc”)
[fn] (input-history-update expr)
rpar (from “pprint.arc”)
[fn] nil
zerotable (from “html.arc”)
[mac] (zerotable . body)
spacerow (from “html.arc”)
[fn] (spacerow h)
readfile1 (from “arc.arc”)
[fn] (readfile1 name)
Reads a single expression from the file `name’.
See also read?
addtem (from “arc.arc”)
[mac] (addtem name . fields)
handle-request-thread (from “srv.arc”)
[fn] (handle-request-thread i o ip)
*mbf-all-vars (from “arc.arc”)
[fn] (*mbf-all-vars form)
Extracts all the variables in the fully macro-expanded s-expression `form’.
See also make-br-fn?
saferead (from “arc.arc”)
[fn] (saferead arg)
Reads an expression, blocking any errors.
get-user (from “app.arc”)
[fn] (get-user req)
tree-subst (from “arc.arc”)
[fn] (tree-subst old new tree)
Replaces an element of a list with that list treated as a binary tree.
See also treewise? trav?
fns (from “arc.arc”)
[fn] (fns pfx (o test (make-br-fn (prefix pfx _))))
Print sigs for macros & functions starting with pfx, or that pass test if given.
tokens (from “strings.arc”)
[fn] (tokens s (o sep whitec))
positive (from “arc.arc”)
[fn] (positive x)
Determines if `x’ is a number and is positive.
mismatch (from “arc.arc”)
[fn] (mismatch s1 s2)
Returns the first index where `s1’ and `s2’ do not match.
common-tokens (from “code.arc”)
[fn] (common-tokens files)
mapeach (from “arc.arc”)
[mac] (mapeach var expr . body)
Performs `body’ for each element of the list returned by `expr’,
with each element assigned to `var’; the result of the last expression
in `body’ is stored in a returned list of values.
See also each? map?
single-input (from “html.arc”)
[fn] (single-input label name chars btext (o pwd))
parafy (from “html.arc”)
[fn] (parafy str)
code-block (from “app.arc”)
[fn] (code-block s i)
readfile (from “arc.arc”)
[fn] (readfile name)
Reads the expressions from the file `name’, and returns a list of
expressions read from the file.
See also read?
mac (from “arc.arc”)
[mac] (mac name parms . body)
Defines a macro, a special function which transforms code.
See also def?
errsafe (from “arc.arc”)
[mac] (errsafe expr)
Executes `expr’ and blocks any errors
conswhen (from “arc.arc”)
[mac] (conswhen f x y)
Adds `x’ to the front of `y’ if `x’ passes the test `f’.
consif (from “arc.arc”)
[fn] (consif x y)
Adds `x’ to the front of the list `y’ if `x’ is true.
See also cons? if? adjoin?
urlend (from “app.arc”)
[fn] (urlend s i)
pushnew (from “arc.arc”)
[mac] (pushnew x place . args)
Pushes `x’ into the front of the list in `place’ unless it is
already in that list.
See also push? adjoin? cons? consif?
urform (from “app.arc”)
[mac] (urform user req after . body)
iso (from “arc.arc”)
[fn] (iso x y)
Isomorphic compare – compares structure (can be slow).
See also is?
atwiths (from “arc.arc”)
[mac] (atwiths . args)
Performs a `withs’ atomically, blocking other threads.
See also atomic? atlet? atwith?
prs (from “arc.arc”)
[fn] (prs . args)
Prints several arguments separated by spaces.
See also prall?
sp (from “pprint.arc”)
[fn] (sp (o n 1))
litmatch (from “strings.arc”)
[mac] (litmatch pat string (o start 0))
signop (from “arc.arc”)
[fn] (signop n)
Returns the sign of a number as the function `+’ or `-’.
See also abs?
afnid (from “srv.arc”)
[mac] (afnid f)
form (from “html.arc”)
[mac] (form action . body)
delimc (from “app.arc”)
[fn] (delimc c)
ttest (from “srv.arc”)
[fn] (ttest ip)
pair (from “arc.arc”)
[fn] (pair xs (o f list))
Applies pairs of elements to the function `f’.
See also tuples? map?
each (from “arc.arc”)
[mac] (each var expr . body)
Performs `body’ for each element of the sequence returned by `expr’,
with each element assigned to `var’.
See also forlen? on? map? mapeach? ontable?
md-from-form (from “app.arc”)
[fn] (md-from-form str (o nolinks))
sym (from “arc.arc”)
[fn] (sym x)
Returns the symbol for `x’.
See also string?
new-hspace (from “html.arc”)
[mac] (new-hspace n)
fromstring (from “arc.arc”)
[mac] (fromstring str . body)
Redirects read standard input to `body’ from the given string `str’.
See also tostring? w/stdin? w/instring?
whiler (from “arc.arc”)
[mac] (whiler var expr endval . body)
Performs `body’ while `expr’ is not `endval’, assigning the result of
`expr’ to `var’.
See also while? whilet? drain?
replpage (from “prompt.arc”)
[fn] (replpage req)
goodname (from “app.arc”)
[fn] (goodname str (o min 1) (o max nil))
trim (from “strings.arc”)
[fn] (trim s where (o test whitec))
text-type (from “app.arc”)
[fn] (text-type typ)
when-umatch (from “app.arc”)
[mac] (when-umatch user req . body)
parabreak (from “app.arc”)
[fn] (parabreak s i (o newlines 0))
prall (from “arc.arc”)
[fn] (prall elts (o init ) (o sep , ))
Prints several arguments with an initial header and separated by a
given separator.
See also prs?
only (from “arc.arc”)
[fn] (only f)
atwith (from “arc.arc”)
[mac] (atwith . args)
Performs a `with’ atomically, blocking other threads.
See also atomic? atlet? atwiths?
deftem (from “arc.arc”)
[mac] (deftem tem . fields)
Defines an object template for field values, with inclusion for
existing templates.
See also inst? templatize? temread? temload? temloadall?
pprcode (from “prompt.arc”)
[fn] (pprcode exprs)
file-exists-in-root (from “srv.arc”)
[fn] (file-exists-in-root file)
tokcount (from “code.arc”)
[fn] (tokcount files)
helpstr (from “arc.arc”)
[fn] (helpstr name (o verbose t))
Returns a help string for the symbol `name’.
inputs (from “html.arc”)
[mac] (inputs . args)
in (from “arc.arc”)
[mac] (in x . choices)
Returns true if the first argument is one of the other arguments.
See also some? mem?
uform (from “app.arc”)
[mac] (uform user req after . body)
adjoin (from “arc.arc”)
[fn] (adjoin x xs (o test iso))
Returns a list with `x’ in front of `xs’, unless `test’ returns true
for some element of `xs’ when matched with `x’.
See also cons? pushnew? consif?
atend (from “arc.arc”)
[fn] (atend i s)
Determines if the index `i’ is at or beyond the end of the sequence `s’.
*mbf-arglist-frees (from “arc.arc”)
[fn] (*mbf-arglist-frees arglist)
Returns the free variables used in default values for optional arguments
of an argument list.
See also make-br-fn?
user-exists (from “app.arc”)
[fn] (user-exists u)
most (from “arc.arc”)
[fn] (most f seq)
Selects the element of `seq’ with the highest [f _].
`f’ is a score function for elements of `seq’.
See also best? least?
nilfn (from “arc.arc”)
[fn] (nilfn . args)
Takes any number of arguments and returns nil.
accums (from “arc.arc”)
[mac] (accums accfns . body)
Collects or accumulates the values given to all calls to functions
named in `accfns’ in body. Returns a list of lists of those values.
Order is not preserved.
See also accum?
showvars (from “app.arc”)
[fn] (showvars fields)
map1 (from “arc.arc”)
[fn] (map1 f xs)
Return a sequence with function f applied to every element in sequence xs.
See also map? each? mappend? andmap? ormap?
rlinkf (from “srv.arc”)
[mac] (rlinkf text parms . body)
find (from “arc.arc”)
[fn] (find test seq)
Returns the first element that matches the test function.
See also mem? some? in?
write-spaced (from “pprint.arc”)
[fn] (write-spaced xs)
vhspace (from “html.arc”)
[fn] (vhspace h w)
tr (from “html.arc”)
[mac] (tr . body)
copy (from “arc.arc”)
[fn] (copy x . args)
Creates a copy of an existing argument `x’.
See also rev?
compare (from “arc.arc”)
[fn] (compare comparer scorer)
Creates a function that compares using `comparer’ the result of `scorer’
on its arguments.
atlet (from “arc.arc”)
[mac] (atlet . args)
Performs a `let’ atomically, blocking other threads.
See also atomic? atwith? atwiths?
days-since (from “arc.arc”)
[fn] (days-since t1)
when-umatch/r (from “app.arc”)
[mac] (when-umatch/r user req . body)
drain (from “arc.arc”)
[mac] (drain expr (o eof nil))
Repeatedly evaluates `expr’ until it returns nil, then returns a list
of the true values.
See also while? whiler? whilet?
needrows (from “app.arc”)
[fn] (needrows text cols (o pad 0))
fnid-field (from “srv.arc”)
[fn] (fnid-field id)
input (from “html.arc”)
[fn] (input name (o val ) (o size 10))
union (from “arc.arc”)
[fn] (union f xs ys)
carif (from “arc.arc”)
[fn] (carif x)
Returns the first element of a list if the argument is a list.
See also car? caris?
range (from “arc.arc”)
[fn] (range start end (o step 1))
Return a range of numbers from `start’ to `end’, by `step’.
or= (from “arc.arc”)
[mac] (or= var val)
Performs (or var val) and assigns the result to var.
See also or? =?
repl (from “prompt.arc”)
[fn] (repl exprs url)
filemime (from “srv.arc”)
[fn] (filemime file)
pop (from “arc.arc”)
[mac] (pop place)
Pops a value from the front of the list in `place’.
See also push? car?
varline (from “app.arc”)
[fn] (varline typ id val)
*mbf-arglist-vars (from “arc.arc”)
[fn] (*mbf-arglist-vars arglist)
Returns the variables bound in an argument list.
See also make-br-fn?
timed-fnid (from “srv.arc”)
[fn] (timed-fnid lasts f)
num (from “strings.arc”)
[fn] (num m (o digits 2) (o trail-zeros nil) (o init-zero nil))
readstring1 (from “arc.arc”)
[fn] (readstring1 s (o eof nil))
Reads a single expression from the string.
See also read?
repeat (from “arc.arc”)
[mac] (repeat n . body)
Repeats the `body’ `n’ times.
See also for? forlen? n-of?
warn (from “arc.arc”)
[fn] (warn msg . args)
Displays a warning message on its arguments.
See also ero? pr?
tab (from “html.arc”)
[mac] (tab . body)
hours-since (from “arc.arc”)
[fn] (hours-since t1)
urlencode (from “strings.arc”)
[fn] (urlencode s)
Encodes the string `s’ using application/x-www-form-urlencoded
encodation.
atomic (from “arc.arc”)
[mac] (atomic . body)
Performs `body’ atomically, blocking other threads.
See also atlet? atwith? atwiths?
findsubseq (from “strings.arc”)
[fn] (findsubseq pat seq (o start 0))
defopr-raw (from “srv.arc”)
[mac] (defopr-raw name parms . body)
treewise (from “arc.arc”)
[fn] (treewise f base tree)
Traverses a list as a binary tree.
See also trav? tree-subst? ontree?
helpsearch-core (from “arc.arc”)
[fn] (helpsearch-core str)
Returns a list of symbols whose documentation matches or partly matches
`str’.
shash (from “app.arc”)
[fn] (shash str)
blank (from “strings.arc”)
[fn] (blank s)
vspace (from “html.arc”)
[fn] (vspace n)
load-userinfo (from “app.arc”)
[fn] nil
alist (from “arc.arc”)
[fn] (alist x)
Return true if argument is a possibly empty list
Unlike ’acons, this function returns t when given an empty list
See also atom? acons? dotted? isa? cons? list?
extension (from “srv.arc”)
[fn] (extension file)
bad-newacct (from “app.arc”)
[fn] (bad-newacct user pw)
idfn (from “arc.arc”)
[fn] (idfn x)
Identity function – just returns its argument.
multisubst (from “strings.arc”)
[fn] (multisubst pairs seq)
w/link-if (from “srv.arc”)
[mac] (w/link-if test expr . body)
upcase (from “arc.arc”)
[fn] (upcase x)
Converts `x’ to uppercase, if a character, string, or symbol;
otherwise, raises an error.
for (from “arc.arc”)
[mac] (for v init max . body)
Loops for the variable `v’ from `init’ to `max’.
See also repeat? forlen?
minutes-since (from “arc.arc”)
[fn] (minutes-since t1)
multiple (from “arc.arc”)
[fn] (multiple x y)
Determines if `x’ is a multiple of `y’.
center (from “html.arc”)
[mac] (center . body)
underline (from “html.arc”)
[mac] (underline . body)
prf (from “arc.arc”)
[mac] (prf str . args)
Prints according to a format string, replacing ~* with arguments.
rotate (from “arc.arc”)
[mac] (rotate . places)
Rotates the values of the specified places, from right to left.
See also swap? =?
dehex (from “html.arc”)
[fn] (dehex str)
hello-page (from “app.arc”)
[fn] (hello-page user ip)
summing (from “arc.arc”)
[mac] (summing sumfn . body)
Counts the number of times `sumfn’ is called with a true value
within `body’.
See also accum?
shortlink (from “html.arc”)
[fn] (shortlink url)
fnid (from “srv.arc”)
[fn] (fnid f)
time10 (from “arc.arc”)
[mac] (time10 expr)
Prints the time consumed by executing `expr’ 10 times
defcall (from “arc.arc”)
[mac] (defcall name parms . body)
Defines a function to run when an object of the given type
is encountered in functional position.
The first argument to this function is the `rep’ of the object,
and the rest are passed as arguments to the object.
See also rep? annotate? type?
downcase (from “arc.arc”)
[fn] (downcase x)
Converts `x’ to lowercase, if a character, string, or symbol;
otherwise, raises an error.
number (from “arc.arc”)
[fn] (number n)
Determines if `n’ is a number.
handle-request (from “srv.arc”)
[fn] (handle-request s (o life threadlife*))
pprest (from “pprint.arc”)
[fn] (pprest exprs col (o oneline t))
help-to-wiki (from “lib/help-to-wiki.arc”)
[fn] (help-to-wiki out-name)
since (from “arc.arc”)
[fn] (since t1)
hspace (from “html.arc”)
[fn] (hspace n)
tuples (from “arc.arc”)
[fn] (tuples xs (o n 2))
Returns a list of lists of the elements of `xs’, grouped by `n’.
See also pair?
link (from “html.arc”)
[fn] (link text (o dest text) (o color))
view-app (from “prompt.arc”)
[fn] (view-app user app)
new-fnid (from “srv.arc”)
[fn] nil
write-table (from “arc.arc”)
[fn] (write-table h (o o (stdout)))
Writes a table or object `h’ to the stream `o’.
See also save-table? read-table? tablist?
caris (from “arc.arc”)
[fn] (caris x val)
Determines if (car x) is `val’.
See also is? car? carif?
tostring (from “arc.arc”)
[mac] (tostring . body)
Returns the printed standard output from `body’ as a string.
See also fromstring? w/stdout? w/outstring?
color (from “html.arc”)
[fn] (color r g b)
parse-format (from “arc.arc”)
[fn] (parse-format str)
Parses a simple ~-format string.
atom (from “arc.arc”)
[fn] (atom x)
Determines if `x’ is atomic.
See also acons? isa?
jtime (from “arc.arc”)
[mac] (jtime expr)
Prints the time consumed by `expr’, returning `ok’ when the
expression completes.
orf (from “arc.arc”)
[fn] (orf . fns)
Creates a function which returns true on its argument if any of the
given `fns’ return true on that argument.
loop (from “arc.arc”)
[mac] (loop start test update . body)
First performs `start’; while `test’ is true, performs `body’ then
`update’ in a loop.
See also while?
defopr (from “srv.arc”)
[mac] (defopr name parm . body)
accum (from “arc.arc”)
[mac] (accum accfn . body)
Collects or accumulates the values given to all calls to `accfn’ within
`body’ and returns a list of those values. Order is not preserved.
See also accums? summing?
mismatch-message (from “app.arc”)
[fn] nil
readline (from “arc.arc”)
[fn] (readline (o str (stdin)))
Reads a string terminated by a newline from the stream `str’.
andf (from “arc.arc”)
[fn] (andf . fns)
Creates a function which returns true on its argument if all of the
given `fns’ return true on that argument.
mergesort (from “arc.arc”)
[fn] (mergesort less? lst)
Sorts a list `lst’ according to `less?’.
striptags (from “html.arc”)
[fn] (striptags s)
w/uniq (from “arc.arc”)
[mac] (w/uniq names . body)
Assigns a set of variables to unique symbols.
Generally used for macro functions.
See also uniq?
no (from “arc.arc”)
[fn] (no x)
Determines if `x’ is `nil’.
w/rlink (from “srv.arc”)
[mac] (w/rlink expr . body)
set-pw (from “app.arc”)
[fn] (set-pw user pw)
text-rows (from “app.arc”)
[fn] (text-rows text wid (o pad 3))
isnt (from “arc.arc”)
[fn] (isnt x y)
Inverse of is.
See also no? is?
swap (from “arc.arc”)
[mac] (swap place1 place2)
Swaps the values of the specified places.
See also rotate? =?
br2 (from “html.arc”)
[fn] nil
acons (from “arc.arc”)
[fn] (acons x)
Determines if `x’ is a `cons’ cell or list.
Unlike ’alist, this function will return nil if given an empty list
See also atom? alist? dotted? isa? cons? list?
save-table (from “arc.arc”)
[fn] (save-table h file)
Writes a table or object `h’ to `file’.
See also write-table? load-table? tablist?
disp-all (from “lib/help-to-wiki.arc”)
[fn] (disp-all out-stream . rest)
blank-url (from “html.arc”)
[fn] nil
s.gif
w/stdin (from “arc.arc”)
[mac] (w/stdin str . body)
Opens the stream `str’ for input; normal read input from `body’
is redirected from the stream.
See also w/stdout? w/infile? w/instring? w/socket?
help (from “arc.arc”)
[mac] (help (o name (quote help)))
Prints the documentation for the given symbol. To use, type
(help symbol) ; you may also use (help “string”) to search
all documentation for that string.
push (from “arc.arc”)
[mac] (push x place)
Pushes the value `x’ on the front of the list in `place’.
See also pop? cons?
linkf (from “srv.arc”)
[mac] (linkf text parms . body)
helpsearch (from “arc.arc”)
[fn] (helpsearch str)
Prints all symbols whose documentation matches or partly matches `str’.
empty (from “arc.arc”)
[fn] (empty seq)
Test to see if `seq’ is an empty list or other sequence.
See also no? acons? len?
tems (from “arc.arc”)
[fn] nil
Pretty print templates defined in `templates*’.
See also deftem? inst? templatize? temread? temload?
best (from “arc.arc”)
[fn] (best f seq)
Selects the best element of `seq’ according to `f’.
`f’ is a comparison function between elements of `seq’.
See also max? most?
sort (from “arc.arc”)
[fn] (sort test seq)
Sorts `seq’ according to `test’.
br (from “html.arc”)
[fn] (br (o n 1))
aand (from “arc.arc”)
[mac] (aand . args)
Similar to `and’ but assigns the previous expression to the variable `it’.
See also and? aif? awhen? afn?
err-header (from “srv.arc”)
[fn] (err-header code)
errpage (from “html.arc”)
[fn] (errpage . args)
disable-acct (from “app.arc”)
[fn] (disable-acct user)
load-tables (from “arc.arc”)
[fn] (load-tables file)
Loads several association lists from `file’ into a list of tables or
objects.
See also load-table? read-table?
defsop (from “srv.arc”)
[mac] (defsop name parm auth . body)
w/infile (from “arc.arc”)
[mac] (w/infile var name . body)
Opens the given file `name’ for input, assigning the stream to `var’.
The stream is automatically closed on exit from the `body’.
See also w/outfile? w/instring? w/stdin? w/socket?
nthcdr (from “arc.arc”)
[fn] (nthcdr n xs)
Returns the sublist of `xs’ starting on the `n’th element.
`n’ is 0-based.
See also cut? firstn?
w/stdout (from “arc.arc”)
[mac] (w/stdout str . body)
Opens the stream `str’ for output; normal printed output from `body’
is redirected to the stream.
See also w/stdin? w/outfile? w/outstring?
aformh (from “srv.arc”)
[mac] (aformh f . body)
punc (from “arc.arc”)
[fn] (punc c)
Determines if the given `c’ is punctuation character.
See also whitec? nonwhite? alphadig? punc?
qualified-path (from “files.arc”)
[fn] (qualified-path path)
Returns the fully-qualified path of a possibly relative `path’.
good-login (from “app.arc”)
[fn] (good-login user pw ip)
noisy-each (from “arc.arc”)
[mac] (noisy-each n var val . body)
Performs `body’ for each element of the sequence returned by `expr’,
with each element assigned to `var’; prints a `.’ every `n’ elements.
catch (from “arc.arc”)
[mac] (catch . body)
Catches any value returned by `throw’ within `body’.
See also breakable? point?
before (from “arc.arc”)
[fn] (before x y seq (o i 0))
Determines if `x’ exists before `y’ in `seq’.
indented-code (from “app.arc”)
[fn] (indented-code s i (o newlines 0) (o spaces 0))
expand=list (from “arc.arc”)
[fn] (expand=list terms)
ssplit (from “arc.arc”)
[fn] (ssplit str (o delim whitec) (o keepdelim) (o noblanks))
Split `str’ on chars passing the test `delim’, returning a list of
strings. If `keepdelim’ is non-nil include the delimiters. If
`noblanks’ is non-nil empty strings are excluded.
makeproper (from “arc.arc”)
[fn] (makeproper lst)
Transforms `list’ to a proper list if it is a dotted list.
See also dotted? list?
reassemble-args (from “srv.arc”)
[fn] (reassemble-args req)
caselet (from “arc.arc”)
[mac] (caselet var expr . args)
Matches the result of `expr’ to arguments until one matches.
The result of `expr’ is assigned to `var’.
See also case? if? iflet?
rev (from “arc.arc”)
[fn] (rev xs)
Reverses a copy of the list `xs’
See also copy?
create-acct (from “app.arc”)
[fn] (create-acct user pw)
onlink (from “srv.arc”)
[mac] (onlink text . body)
awhen (from “arc.arc”)
[mac] (awhen expr . body)
Similar to `when’ but assigns the result of ‘expr’ to the variable `it’.
See also when? aif? aand? afn?
urldecode (from “strings.arc”)
[fn] (urldecode s)
new-user-cookie (from “app.arc”)
[fn] nil
firstn (from “arc.arc”)
[fn] (firstn n xs)
Returns the first `n’ elements of the given list `xs’.
See also cut? nthcdr?
ensure-srvdirs (from “srv.arc”)
[fn] nil
w/appendfile (from “arc.arc”)
[mac] (w/appendfile var name . body)
Opens a file `name’ for append, assigning the stream to `var’.
The stream is automatically closed on exit from the `body’.
See also w/outfile? w/infile?
varfield (from “app.arc”)
[fn] (varfield typ id val)
aform (from “srv.arc”)
[mac] (aform f . body)
file-join (from “files.arc”)
[fn] (file-join . parts)
Joins `parts’ into a path string.
rreduce (from “arc.arc”)
[fn] (rreduce f xs (o init initsym))
Applies `f’ to an accumulated result on the elements of `xs’.
Elements are processsed right-to-left.
rflink (from “srv.arc”)
[fn] (rflink f)
tag-options (from “html.arc”)
[fn] (tag-options spec options)
ppr-call (from “pprint.arc”)
[fn] (ppr-call expr col noindent)
redef (from “arc.arc”)
[mac] (redef name parms . body)
Redefine a function. The old function definition may be used within
`body’ as the name `old’.
alphadig (from “arc.arc”)
[fn] (alphadig c)
Determines if the given `c’ is an alphanumeric character.
See also whitec? nonwhite? punc?
subst (from “strings.arc”)
[fn] (subst new old seq)
logout-user (from “app.arc”)
[fn] (logout-user user)
markdown (from “app.arc”)
[fn] (markdown s (o maxurl) (o nolinks))
until (from “arc.arc”)
[mac] (until test . body)
While `test’ is false, perform `body’ in a loop.
See also while?
templatize (from “arc.arc”)
[fn] (templatize tem raw)
Creates an object instantiating a given template containing the
data in the association list `raw’.
See also deftem? inst? temread? temload? temloadall?
vars-form (from “app.arc”)
[fn] (vars-form user fields f done (o button update) (o lasts))
expand= (from “arc.arc”)
[fn] (expand= place val)
read-table (from “arc.arc”)
[fn] (read-table (o i (stdin)) (o eof))
Loads an association list from the stream `i’ into a table or object.
See also load-tables? load-table? write-table? listtab?
load-table (from “arc.arc”)
[fn] (load-table file (o eof))
Loads an association list from `file’ into a table or object.
See also load-tables? read-table? save-table? listtab?
aif (from “arc.arc”)
[mac] (aif expr . body)
Similar to `if’ but assigns the result of ‘expr’ to the variable `it’.
See also if? awhen? aand? afn?
temloadall (from “arc.arc”)
[fn] (temloadall tem file)
Reads all association lists from `file’ and creates a list
of objects instantiating the given template containing the
data in each association list.
See also deftem? inst? templatize? temread? temload?
edit-app (from “prompt.arc”)
[fn] (edit-app user app)
def (from “arc.arc”)
[mac] (def name parms . body)
Defines a function with the given `name’, `parms’, and `body’.
See also fn? mac?
mappend (from “arc.arc”)
[fn] (mappend f . args)
Applies the elements of the sequences to the given function.
Returns a sequence containing the concatenation of the results
of the function.
See also map? join?
defopl (from “app.arc”)
[mac] (defopl name parm . body)
pwd (from “files.arc”)
[fn] nil
Returns the current directory.
w/instring (from “arc.arc”)
[mac] (w/instring var str . body)
Opens the given string `str’ for input, assigning the stream to `var’.
The stream is automatically closed on exit from the `body’.
See also w/outstring? fromstring? w/infile? w/stdin?
w/socket?
trues (from “arc.arc”)
[fn] (trues f seq)
Returns a list with all `nil’s removed.
See also rem? keep?
arg (from “srv.arc”)
[fn] (arg req key)
w/outstring (from “arc.arc”)
[mac] (w/outstring var . body)
Opens a string for output, assigning the stream to `var’.
The stream is automatically closed on exit from the `body’.
The contents of the string can be accessed via (inside `var’)
See also w/instring? tostring? w/outfile? w/stdout?
flink (from “srv.arc”)
[fn] (flink f)
defop (from “srv.arc”)
[mac] (defop name parm . body)
reduce (from “arc.arc”)
[fn] (reduce f xs (o init initsym))
Applies `f’ to an accumulated result on the elements of `xs’.
Elements are processsed left-to-right.
complement (from “arc.arc”)
[mac] (complement f)
Arc expands ~x into (complement x)
whenever the function returns true this returns false.
See also no? isnt? compose?
menu (from “html.arc”)
[fn] (menu name items (o sel nil))
pwfields (from “app.arc”)
[fn] (pwfields (o label login))
on (from “arc.arc”)
[mac] (on var s . body)
Loops across the sequence `s’, assigning each element to `var’,
and providing the current index in `index’.
See also each? forlen?
single (from “arc.arc”)
[fn] (single x)
Determines if `x’ is a list with only one element.
nonwhite (from “arc.arc”)
[fn] (nonwhite c)
Determines if the given `c’ is not a whitespace character.
See also whitec? alphadig? punc?
asv (from “app.arc”)
[fn] (asv (o port 8080))
random-elt (from “arc.arc”)
[fn] (random-elt seq)
Returns an element of `seq’ chosen by random.
See also rand-choice?
varif (from “arc.arc”)
[mac] (varif name (o default))
Returns the value of the variable `name’ if it exists, or `default’
otherwise.
compose (from “arc.arc”)
[mac] (compose . args)
Arc expands x:y:z into (compose x y z)
quick way to write (x(y(z)))
Only used when the call to compose doesn’t occur in functional position.
Composes in functional position are transformed away by ac.
See also complement?
ppr-progn (from “pprint.arc”)
[fn] (ppr-progn expr col noindent)
nor (from “arc.arc”)
[mac] (nor . args)
Computes arguments until one of them returns true, then returns nil,
or else returns true.
expand-metafn-call (from “arc.arc”)
[fn] (expand-metafn-call f args)
cd (from “files.arc”)
[fn] (cd path)
Changes the current directory.
serve1 (from “srv.arc”)
[fn] (serve1 (o port 8080))
serve (from “srv.arc”)
[fn] (serve (o port 8080))
temload (from “arc.arc”)
[fn] (temload tem file)
Reads an association list from `file’ and creates an object
instantiating the given template containing the data in the
association list.
See also deftem? inst? templatize? temread? temloadall?
vals (from “arc.arc”)
[fn] (vals h)
Returns a list of values in the table or object `h’.
See also keys? table?
nbsp (from “html.arc”)
[fn] nil
parsecookies (from “srv.arc”)
[fn] (parsecookies s)
cp (from “files.arc”)
[fn] (cp src dst)
Copies the file `src’ to `dst’.
whenlet (from “arc.arc”)
[mac] (whenlet var expr . body)
Checks if `expr’ is true, and if so, assigns it to `var’ and
performs the `body’.
See also caselet? iflet? when? if?
dotted (from “arc.arc”)
[fn] (dotted x)
Determines if `x’ is a dotted cons pair.
See also acons? alist?
w/socket (from “arc.arc”)
[mac] (w/socket var port . body)
Opens the port for listening, assigning the stream to `var’.
The stream is automatically closed on exit from the `body’.
See also w/infile? w/instring? w/stdin?
w/outfile (from “arc.arc”)
[mac] (w/outfile var name . body)
Opens the given file `name’ for output, assigning the stream to `var’.
The stream is automatically closed on exit from the `body’.
See also w/infile? w/appendfile? w/outstring? w/stdout?
begins (from “strings.arc”)
[fn] (begins seq pat (o start 0))
afn (from “arc.arc”)
[mac] (afn parms . body)
Creates a function which calls itself with the name `self’.
See also fn? rfn? aif? awhen? aand?
parseheader (from “srv.arc”)
[fn] (parseheader lines)
whitec (from “arc.arc”)
[fn] (whitec c)
Determines if the given `c’ is a whitespace character.
See also alphadig? nonwhite? punc?
ellipsize (from “arc.arc”)
[fn] (ellipsize str (o limit 80))
Trims a string `str’ with `…’ if it is longer than the given `limit’.
end-tag (from “html.arc”)
[fn] (end-tag spec)
median (from “arc.arc”)
[fn] (median ns)
Computes the median of an unsorted list.
or (from “arc.arc”)
[mac] (or . args)
Computes arguments until one of them is true and returns that result.
See also and? orf? ormap? check?
opesc (from “html.arc”)
[fn] (opesc key val)
forlen (from “arc.arc”)
[mac] (forlen var s . body)
Loops across the length of the sequence `s’.
See also repeat? each? on?
underlink (from “html.arc”)
[fn] (underlink text (o dest text))
defhook (from “arc.arc”)
[mac] (defhook name . rest)
unmarkdown (from “app.arc”)
[fn] (unmarkdown s)
spanrow (from “html.arc”)
[mac] (spanrow n . body)
keep (from “arc.arc”)
[fn] (keep test seq)
Returns a list with the elements of `seq’ that pass `test’.
See also rem? pull?
cook-user (from “app.arc”)
[fn] (cook-user user)
iflet (from “arc.arc”)
[mac] (iflet var expr then . rest)
Checks if `expr’ is true, and if so, assigns it to `var’ and
performs the `then’ clause.
See also caselet? whenlet? if?
some (from “arc.arc”)
[fn] (some test seq)
Determines if at least one element of `seq’ satisfies `test’.
See also all? mem? in? pos?
listtab (from “arc.arc”)
[fn] (listtab al)
Transforms an association list into a table or object.
See also tablist? alref? assoc?
rfn (from “arc.arc”)
[mac] (rfn name parms . body)
Creates a function which calls itself as `name’.
See also fn? afn?
reload-check (from “srv.arc”)
[fn] nil
merge (from “arc.arc”)
[fn] (merge less? x y)
Merges two sorted lists by `less?’.
ppr (from “pprint.arc”)
[fn] (ppr expr (o col 0) (o noindent nil))
do1 (from “arc.arc”)
[mac] (do1 . args)
Performs the body in sequence, then returns the value of the
first expression.
See also do?
posmatch (from “strings.arc”)
[fn] (posmatch pat seq (o start 0))
split (from “arc.arc”)
[fn] (split seq pos)
Splits `seq’ at offset `pos’, returning a two-element list of the
split.
See also cut?
parseargs (from “srv.arc”)
[fn] (parseargs s)
code-density (from “code.arc”)
[fn] (code-density file)
file-perms (from “files.arc”)
[fn] (file-perms path)
Returns a list of the effective file permssions of `path’.
count (from “arc.arc”)
[fn] (count test x)
Counts the number of elements in `x’ which pass `test’.
enq-limit (from “arc.arc”)
[fn] (enq-limit val q (o limit 1000))
Adds an item to the queue; removes a queue item if `limit’ is
exceeded. See also queue?
start-tag (from “html.arc”)
[fn] (start-tag spec)
let (from “arc.arc”)
[mac] (let var val . body)
Assigns a local variable for the given `body’.
See also with? withs? fn? do?
rand-string (from “arc.arc”)
[fn] (rand-string n)
Generates a random string of letters and numbers, starting with a letter.
metafn (from “arc.arc”)
[fn] (metafn x)
pr-escaped (from “html.arc”)
[fn] (pr-escaped x)
hook (from “arc.arc”)
[fn] (hook name . args)
buts (from “html.arc”)
[fn] (buts name . texts)
testify (from “arc.arc”)
[fn] (testify x)
Creates a test that determines if a given argument is `x’.
See also is?
defop-raw (from “srv.arc”)
[mac] (defop-raw name parms . body)
trav+ (from “arc.arc”)
[mac] (trav+ (go n) s . body)
Traverses an object `s’; the object is named by `n’ and sub-nodes
of the object may be traversed by (`go’ …) in `body’.
See also trav?
p.s. a more lisplike version of pg’s trav
assert (from “arc.arc”)
[mac] (assert . args)
Sets each of the given places to t.
See also wipe? zap? =?
memodate (from “srv.arc”)
[fn] nil
codeflat (from “code.arc”)
[fn] (codeflat file)
tablist (from “arc.arc”)
[fn] (tablist h)
Transforms a table or object `h’ into an association list.
See also listtab? alref? assoc?
ormap (from “arc.arc”)
[fn] (ormap pred seq)
Applies `pred’ to elements of `seq’ until an element passes.
See also or? orf? map?
codetree (from “code.arc”)
[fn] (codetree file)
admin-page (from “app.arc”)
[fn] (admin-page user . msg)
mtime (from “files.arc”)
[fn] (mtime path)
Returns the modification time of the file or directory `path’ in
seconds since the epoch.
tag-if (from “html.arc”)
[mac] (tag-if test spec . body)
commonest (from “arc.arc”)
[fn] (commonest seq)
Returns a two-element list containing the most common element of
`seq’ and the number of times it occured in the sequence.
bestn (from “arc.arc”)
[fn] (bestn n f seq)
Returns a list of the best `n’ elements of seq according to
the comparison function `f’.
See also best?
w/del (from “ffi.arc”)
[mac] (w/del var value del-fn . body)
when (from “arc.arc”)
[mac] (when test . body)
When `test’ is true, do `body’.
See also unless? if? awhen?
qlist (from “arc.arc”)
[fn] (qlist q)
Returns the queue contents as a list. See also queue?
parseurl (from “srv.arc”)
[fn] (parseurl s)
and (from “arc.arc”)
[mac] (and . args)
Evaluates arguments till false is found else returns the last one.
See also or? aand? andf? andmap?
rem-app (from “prompt.arc”)
[fn] (rem-app user app)
w/ffi (from “ffi.arc”)
[mac] (w/ffi name . body)
time (from “arc.arc”)
[mac] (time expr)
Prints the time consumed by the `expr’, returning the result.
case (from “arc.arc”)
[mac] (case expr . args)
Matches the result of `expr’ to arguments until one matches.
See also caselet? if?
admin-gate (from “app.arc”)
[fn] (admin-gate u)
mem (from “arc.arc”)
[fn] (mem test seq)
Returns the sublist of `seq’ whose first element satisfies `test’.
See also find? some? in?
do (from “arc.arc”)
[mac] (do . args)
Evaluates each expression in sequence and returns the result of the
last expression.
See also do1? after?
write-app (from “prompt.arc”)
[fn] (write-app user app exprs)
wipe (from “arc.arc”)
[mac] (wipe . args)
Sets each of the given places to nil.
See also assert? zap? =?
join (from “arc.arc”)
[fn] (join . args)
Joins all list arguments together.
See also cons? +?
opsel (from “html.arc”)
[fn] (opsel key val)
deq (from “arc.arc”)
[fn] (deq q)
Removes and returns an item from a queue. See also queue?
<= (from “arc.arc”)
[fn] (<= . args)
Determines if each argument is less than or equal to succeeding
arguments.
url-for (from “srv.arc”)
[fn] (url-for fnid)
trav (from “arc.arc”)
[mac] (trav x . fs)
Traverses an object `x’; the object is applied to each function
in `fs’, and sub-nodes of the object may be traversed by
(self ) in any of the functions.
See also trav+? treewise? ontree?
qlen (from “arc.arc”)
[fn] (qlen q)
Returns the number of items in a queue. See also queue?
headmatch (from “strings.arc”)
[fn] (headmatch pat seq (o start 0))
empty-elem-tag (from “html.arc”)
[mac] (empty-elem-tag . spec)
counts (from “arc.arc”)
[fn] (counts seq (o c (table)))
Returns a table with elements of `seq’ as keys and the number of
occurences of that element as values.
w/inline (from “ffi.arc”)
[mac] (w/inline code . body)
unless (from “arc.arc”)
[mac] (unless test . body)
When `test’ is not true, do `body’.
See also when? if? no?
srvlog (from “srv.arc”)
[fn] (srvlog type . args)
after (from “arc.arc”)
[mac] (after x . ys)
Ensures that the body is performed after the expression `x’,
even if it fails.
See also do?
pr (from “arc.arc”)
[fn] (pr . args)
Prints the arguments.
See also prn? warn? ero?
defmemo (from “arc.arc”)
[mac] (defmemo name parms . body)
Defines a function that automatically stores the results of calls.
For each set of arguments, this function will only execute once.
If the function is called again with the same arguments, it will
immediately return the stored result for that set of arguments.
See also memo?
rem (from “arc.arc”)
[fn] (rem test seq)
Returns a list with the elements of `seq’ that pass `test’ removed.
See also keep? pull?
eschtml (from “html.arc”)
[fn] (eschtml str)
cdef (from “ffi.arc”)
[mac] (cdef name cname out-type in-types (o finalizer))
isa (from “arc.arc”)
[fn] (isa x y)
Checks if x is of type y.
See also acons? alist? atom?
save-optime (from “srv.arc”)
[fn] (save-optime name elapsed)
mv (from “files.arc”)
[fn] (mv src dst)
Moves the file or directory `src’ to `dst’.
prcookie (from “app.arc”)
[fn] (prcookie cook)
prn (from “arc.arc”)
[fn] (prn . args)
Prints the arguments followed by a newline.
See also pr? warn? ero?
codelines (from “code.arc”)
[fn] (codelines file)
opsym (from “html.arc”)
[fn] (opsym key val)
setforms (from “arc.arc”)
[fn] (setforms expr0)
temread (from “arc.arc”)
[fn] (temread tem (o str (stdin)))
Reads an association list from the stream `str’ and creates an
object instantiating the given template containing the data in
the association list.
See also deftem? inst? templatize? temload? temloadall?
withs (from “arc.arc”)
[mac] (withs parms . body)
Assigns local variables for the given `body’.
The assignments are made in the given order.
See also with? let? fn? do?
thread (from “arc.arc”)
[mac] (thread . body)
Launches the expressions in `body’ in a new thread, returning the
thread ID for that thread.
para (from “html.arc”)
[fn] (para . args)
w/link (from “srv.arc”)
[mac] (w/link expr . body)
whitepage (from “html.arc”)
[mac] (whitepage . body)
n-of (from “arc.arc”)
[mac] (n-of n expr)
Repeats `expr’ `n’ times, then returns the results in a list.
See also repeat?
enq (from “arc.arc”)
[fn] (enq obj q)
Adds `obj’ to a queue. See also queue?
file-size (from “files.arc”)
[fn] (file-size path)
Returns the size, in bytes, of a file `path’.
submit (from “html.arc”)
[fn] (submit (o val submit))
keys (from “arc.arc”)
[fn] (keys h)
Returns a list of keys in the table or object `h’.
See also vals? table?
recstring (from “arc.arc”)
[fn] (recstring test s (o start 0))
Applies the function `test’ on indices of `s’ until `test’ returns true.
See also map? reclist?
odd (from “arc.arc”)
[fn] (odd n)
Determines if a number is odd. See also even?
login-page (from “app.arc”)
[fn] (login-page switch (o msg nil) (o afterward hello-page))
memo (from “arc.arc”)
[fn] (memo f)
Creates a function that will store results of calls to the given
source function.
For each set of arguments, the source function will only be called
once; if the memo’ed function is called again with the same arguments,
it will return the stored result instead of calling the source function.
See also defmemo?
flatlen (from “code.arc”)
[mac] (flatlen . args)
esc<>& (from “html.arc”)
[fn] (esc<>& str)
header (from “srv.arc”)
[fn] (header (o type textmime*) (o code 200))
row (from “html.arc”)
[mac] (row . args)
but (from “html.arc”)
[fn] (but (o text submit) (o name nil))
unique-id (from “srv.arc”)
[fn] (unique-id (o len 8))
gentag (from “html.arc”)
[mac] (gentag . args)
intersperse (from “arc.arc”)
[fn] (intersperse x ys)
Inserts `x’ between elements of `ys’.
opnum (from “html.arc”)
[fn] (opnum key val)
inst (from “arc.arc”)
[fn] (inst tem . args)
Creates an object instantiating a given template.
See also deftem? templatize? temread? temload? temloadall?
reclist (from “arc.arc”)
[fn] (reclist f xs)
Applies the function `f’ on the sublists of `xs’ until `f’ returns true.
See also ormap? andmap? map?
last (from “arc.arc”)
[fn] (last xs)
Returns the last element of `seq’.
prbold (from “html.arc”)
[mac] (prbold . body)
(from “arc.arc”)
[mac] (— place (o i 1))
Decrements `place’ by the given decrement `i’ (defaults to 1).
See also ++? zap? =?
expand (from “arc.arc”)
[fn] (expand expr)
Completely expands all macros in `expr’.
See also macex? mac?
pad (from “arc.arc”)
[fn] (pad val digits (o char ))
textarea (from “html.arc”)
[mac] (textarea name rows cols . body)
tag (from “html.arc”)
[mac] (tag spec . body)
even (from “arc.arc”)
[fn] (even n)
Determines if a number is even. See also odd?
rand-choice (from “arc.arc”)
[mac] (rand-choice . exprs)
Returns the result of one of the given `exprs’, chosen at random.
See also random-elt?
read-app (from “prompt.arc”)
[fn] (read-app user app)
zap (from “arc.arc”)
[mac] (zap op place . args)
Modifies `place’ with the result of `op’ on that `place’.
See also ++? ?=— pull? push? pop? =?
wipe? assert?
reload (from “srv.arc”)
[fn] (reload . paths)
space-eaters (from “code.arc”)
[fn] (space-eaters files)
obj (from “arc.arc”)
[mac] (obj . args)
Creates an object with the specified entries.
See also inst? table?
% [mac] nil
cache (from “arc.arc”)
[fn] (cache timef valf)
Caches the result of a call to `valf’ until a number of seconds
greater than the result of a call to `timef’ have passed.
insortnew (from “arc.arc”)
[mac] (insortnew test elt seq)
Inserts `elt’ into a sequence in the place `seq’, partially sorted
by `test’.
See also reinsert-sorted? sort?
ppr-sexp (from “pprint.arc”)
[fn] (ppr-sexp sexp)
date (from “arc.arc”)
[fn] (date (o time (seconds)))
Returns the date as a string in YYYY-MM-DD format.
tdcolor (from “html.arc”)
[mac] (tdcolor col . body)
whilet (from “arc.arc”)
[mac] (whilet var test . body)
While `test’ is true, perform `body’ in a loop.
The result of `test’ is assigned to `var’.
See also while? whiler? drain?
with (from “arc.arc”)
[mac] (with parms . body)
Assigns a set of local variables for the given `body’.
Assignment is simultaneous.
See also withs? let? fn? do?
prrow (from “html.arc”)
[mac] (prrow . args)
opstring (from “html.arc”)
[fn] (opstring key val)
andmap (from “arc.arc”)
[fn] (andmap pred seq)
Applies `pred’ to elements of `seq’ until an element fails.
See also and? andf? map?
opcolor (from “html.arc”)
[fn] (opcolor key val)
fill-table (from “arc.arc”)
[fn] (fill-table table data)
Fills `table’ with key-value pairs in the `data’ list.
See also table?
queue (from “arc.arc”)
[fn] nil
Creates a queue.
See also enq? deq? qlen? qlist? enq-limit?
len> (from “arc.arc”)
[fn] (len> x n)
ensure-srvinstall (from “srv.arc”)
[fn] nil
userlink (from “app.arc”)
[mac] (userlink user text . body)
respond-err (from “srv.arc”)
[fn] (respond-err str code msg . args)
arformh (from “srv.arc”)
[mac] (arformh f . body)
dedup (from “arc.arc”)
[fn] (dedup xs)
Removes duplicated elements from `xs’.
splitlines (from “app.arc”)
[fn] (splitlines str)
assoc (from “arc.arc”)
[fn] (assoc key al)
Finds a (key value) pair in an associated list.
See also alref? listtab? tablist?
reinsert-sorted (from “arc.arc”)
[fn] (reinsert-sorted test elt seq)
Inserts `elt’ into a sequence `seq’, partially sorted by `test’.
See also insert-sorted? insortnew? sort?
plural (from “strings.arc”)
[fn] (plural n str)
tdright (from “html.arc”)
[mac] (tdright . body)
top40 (from “code.arc”)
[fn] (top40 xs)
string (from “arc.arc”)
[fn] (string . args)
Creates a string from its arguments
See also sym?
alref (from “arc.arc”)
[fn] (alref al key)
Get a value from a key in a associated list.
See also assoc? listtab? tablist?
%% (from “arc.arc”)
[mac] nil
len< (from “arc.arc”)
[fn] (len< x n)
ontable (from “arc.arc”)
[mac] (ontable k v h . body)
Loops through the entries of table or object `h’, with key-value pairs
assigned to `k’ and `v’, respectively.
See also each? keys?
min (from “arc.arc”)
[fn] (min . args)
Returns the lowest argument.
See also max? best? most?
point (from “arc.arc”)
[mac] (point name . body)
Creates a form which may be exited by calling `name’ from within `body’.
See also catch? breakable?
avg (from “arc.arc”)
[fn] (avg ns)
Averages all numbers in `ns’.
abs (from “arc.arc”)
[fn] (abs n)
Returns the absolute value of a number.
See also signop?
all (from “arc.arc”)
[fn] (all test seq)
Determines if all elements of `seq’ satisfy `test’.
See also some?
doctype (from “html.arc”)
[mac] (doctype . args)
load (from “arc.arc”)
[fn] (load file (o hook))
Reads the expressions in `file’ and evaluates them. Read expressions
may be preprocessed by `hook’.
See also require?.
% (from “arc.arc”)
[mac] nil
readall (from “arc.arc”)
[fn] (readall src (o eof nil))
Reads the expressions from the string or stream `src’, and returns a
list of expressions read from the file.
See also read?
doctype-str (from “html.arc”)
[fn] (doctype-str (o name (quote xhtml)) (o version) (o type))
cellpr (from “html.arc”)
[fn] (cellpr x)
ensure-dir (from “arc.arc”)
[fn] (ensure-dir path)
Ensures that the specified directory exists, and creates it if not
yet created.
read (from “arc.arc”)
[fn] (read (o x (stdin)) (o eof nil))
Reads a single expression from a string or stream.
See also readstring1? readfile? readfile1? readall?
readvar (from “app.arc”)
[fn] (readvar typ str (o fail nil))
app-path (from “prompt.arc”)
[fn] (app-path user app)
respond-file (from “srv.arc”)
[fn] (respond-file str file (o code 200))
common-operators (from “code.arc”)
[fn] (common-operators files)
cadr (from “arc.arc”)
[fn] (cadr xs)
Equivalent to (car (cdr xs))
harvest-fnids (from “srv.arc”)
[fn] (harvest-fnids (o n 20000))
check (from “arc.arc”)
[mac] (check x test (o alt))
Returns `x’ if it passes `test’, otherwise returns `alt’.
See also or?
arform (from “srv.arc”)
[mac] (arform f . body)
w/bars (from “arc.arc”)
[mac] (w/bars . body)
Prints out the strings printed by each expression in `body’,
separated by vertical bars.
make-br-fn (from “arc.arc”)
[mac] (make-br-fn body)
Constructs an anonymous procedure with the body `body’; the procedure will
have bound variables of the form _1 … _N, where N is the largest of those
variables used in the function. __ will be a rest parameter, and _ is an
alias for _1. Each variable is declared iff it is used. This is used to
implement the [] anonymous functions.
require (from “arc.arc”)
[fn] (require file)
Loads `file’ if it has not yet been `require’d. Can be fooled by changing
the name ((require “foo.arc”) as opposed to (require “./foo.arc”)), but
this should not be a problem.
See also load?.
insort (from “arc.arc”)
[mac] (insort test elt seq)
Inserts `elt’ into a sequence in the place `seq’ sorted by `test’.
See also insert-sorted? sort?
ero (from “arc.arc”)
[fn] (ero . args)
Outputs `args’ to error output.
while (from “arc.arc”)
[mac] (while test . body)
While `test’ is true, perform `body’ in a loop.
See also until? loop? whilet? whiler? for?
repeat? drain?
prefix (from “arc.arc”)
[fn] (prefix pre str)
Determines if `pre’ is the same as the first part of `str’.
*mbf-free? (from “arc.arc”)
[fn] (*mbf-free? form var)
Checks if the variable named `var’ occurs free (unbound) in `form’.
See also make-br-fn?
divclass (from “html.arc”)
[mac] (divclass name . body)
max (from “arc.arc”)
[fn] (max . args)
Returns the highest argument.
See also min? best? most?
>= (from “arc.arc”)
[fn] (>= . args)
Determines if each argument is greater than or equal to succeeding
arguments.
= (from “arc.arc”)
[mac] (= . args)
Assigns values to variables.
See also assert? wipe? ++? ?=— rotate? defset?
pos (from “arc.arc”)
[fn] (pos test seq (o start 0))
Returns the position of the first element in `seq’ that passes `test’.
See also some?
pagemessage (from “html.arc”)
[fn] (pagemessage text)
mkdir (from “arc.arc”)
[fn] (mkdir path (o parents))
Creates a directory.
If `parents’ is non-nil, parent directories are created as needed.
div (from “html.arc”)
[mac] (div args . body)
widtable (from “html.arc”)
[mac] (widtable w . body)
round (from “arc.arc”)
[fn] (round n)
Rounds off a fractional value to the nearest whole number.
See also roundup? to-nearest?
sptab (from “html.arc”)
[mac] (sptab . body)
handle-post (from “srv.arc”)
[fn] (handle-post i o op n cooks ip)
prompt-page (from “prompt.arc”)
[fn] (prompt-page user . msg)
endmatch (from “strings.arc”)
[mac] (endmatch pat string)
writefileraw (from “arc.arc”)
[fn] (writefileraw val name)
Write a list of bytes in val to a file.
See also writefile1?
cddr (from “arc.arc”)
[fn] (cddr xs)
Equivalent to (cdr (cdr xs))
caar (from “arc.arc”)
[fn] (caar xs)
Equivalent to (car (car xs))
++ (from “arc.arc”)
[mac] (++ place (o i 1))
Increments `place’ by the given increment `i’ (defaults to 1).
See also ?=— zap? =?
list (from “arc.arc”)
[fn] (list . args)
Creates a list from the given parameters.
See also cons? acons?
nonop (from “code.arc”)
[fn] (nonop x)
insert-sorted (from “arc.arc”)
[fn] (insert-sorted test elt seq)
Inserts `elt’ into a sequence `seq’ sorted by `test’.
See also sort? insort? reinsert-sorted?
trtd (from “html.arc”)
[mac] (trtd . body)
cut
(from "arc.arc") [fn] (cut seq start (o end (len seq))) Returns a subsequence of the given `seq' If `end' is negative, it's a 0-based index into the end of the string. For example,> (cut “abcde” 1, -1) “bcd” See also firstn? nthcdr? split? |
to-nearest (from “arc.arc”)
[fn] (to-nearest n quantum)
Rounds off `n’ to the nearest multiple of `quantum’.
See also round? roundup?
admin (from “app.arc”)
[fn] (admin u)
flat (from “arc.arc”)
[fn] (flat x (o stringstoo))
Flattens a nested list.
See also list?
breakable (from “arc.arc”)
[mac] (breakable expr)
Allows a (break …) form to return a value from within the
body of a control structure.
Example:
(breakable:while t
(aif (something) (break it)))
See also catch? point? accum? while?
map (from “arc.arc”)
[fn] (map f . seqs)
Applies the elements of the sequences to the given function.
Returns a sequence containing the results of the function.
See also each? mapeach? map1? mappend? andmap?
ormap? reduce?
attribute (from “html.arc”)
[mac] (attribute tag opt f)
cdata (from “html.arc”)
[mac] (cdata . body)
td (from “html.arc”)
[mac] (td . body)
pull (from “arc.arc”)
[mac] (pull test place)
Removes all elements that pass `test’ from the list in `place’.
See also rem? keep?
opmeth (from “html.arc”)
[mac] (opmeth tag opt)
respond (from “srv.arc”)
[fn] (respond str op args cooks ip (o type))
defset (from “arc.arc”)
[mac] (defset name parms . body)
Defines a setter for the named form.
See also =?
memtable (from “arc.arc”)
[fn] (memtable ks)
Creates a membership table which returns t for each element in `ks’ and
nil otherwise.
writefile1 (from “arc.arc”)
[fn] (writefile1 val name)
Writes the value to the file `name’.
See also writefileraw?
loadq (from “srv.arc”)
[fn] (loadq path)
safe-load-table (from “arc.arc”)
[fn] (safe-load-table filename)
Loads a table from `filename’, blocking any errors.
run-app (from “prompt.arc”)
[fn] (run-app user app)
roundup (from “arc.arc”)
[fn] (roundup n)
Rounds off a fractional value to the nearest absolute highest
whole number.
See also round? to-nearest?
$ (from “arc.arc”)
[mac] ($ . body)
Allows access to the underlying Scheme.
least (from “arc.arc”)
[fn] (least f seq)
Selects the element of `seq’ with the lowest [f _].
`f’ is a score function for elements of `seq’.
See also most?
ontree (from “arc.arc”)
[fn] (ontree f tree)
Applies a function across each node of a list with that list treated
as a binary tree.
See also treewise? trav?
timed-aform (from “srv.arc”)
[mac] (timed-aform lasts f . body)
lpar (from “pprint.arc”)
[fn] nil
Last edited by stefano, Sat May 17 05:23:09 -0700 2008
Home | Edit | New
Versions: