3 :revdate: {sys:date "+%Y-%m-%d %H:%M:%S"}
7 lsp-misc.a - Misceallaneous useful functions.
11 .With packnl (example)
12 packnl _main.lsp_ *-A lsp-misc.a*
17 (archive "lsp-misc.a") +
22 *lsp-misc.a* provides a few global utility functions.
28 The *prog1* function is like a *begin* function except that it returns
29 the value of the first term rather than the last.
31 (die [_N_ [_term_]])::
33 The *die* function printes to stderr the join of term values as
34 strings with space separation, and if _N_ is a number, then the
35 function exits the program with that return code.
37 .Example of stderr logging
38 (die nil 'This "is" 'printed "to stderr")
41 Print binary byte as octal or as ASCII character [32-126].
44 Print string as a succesion of +octal-byte+.
47 Return byte code as printable (string) or as code (number).
51 Return a list of human-byte elements from a list of byte codes but
52 also joining consecutive string elements to form packed strings.
56 This newlisp module provides Functional Object-Oriented Programming
57 (FOOP) modelling support.
59 FOOP is an abstraction overlay using the newlisp context notion as a
60 simile to the _class_ notion in genuine object-oriented programming
61 languages. This is set out in newlisp by means of the representation
62 principle that an instance of a FOOP "class" (i.e. context) is a list
63 headed by the context itself, and followed by the "member values".
65 FOOP further includes by the "method invocation" syntax where a
66 function is preceded by ':' and then followed by the instance
67 concerned before actual function arguments. That instance is then
68 stoved away as implicitly available via the (self) function, and the
69 member values accessible via index, e.g. the term (self 3) refers to
70 the third member of the instance. The self references are
71 destructively assignable with setf.
73 This modelling support adds member name declaration together with
74 automatic getter and setter defintions. The (FOOP ...) term is used
75 for declaring member names in order. For example:
79 *FOOP* is like a language extension to declare the field names of a
80 FOOP class, and thereby gain "get" and "set" functions generated with
81 the respective naming formats (:%name obj) and (:!name obj value).
86 (FOOP here there more)
87 (define (EX HERE THERE MORE) (list (context) HERE THERE MORE))
103 Ralph Ronnquist <ralph.ronnquist@gmail.com>