picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

refM.html (22751B)


      1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
      2 <html lang="en">
      3 <head>
      4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      5 <title>M</title>
      6 <link rel="stylesheet" href="doc.css" type="text/css">
      7 </head>
      8 <body>
      9 
     10 <h1>M</h1>
     11 
     12 <dl>
     13 
     14 <dt><a name="*Msg"><code>*Msg</code></a>
     15 <dd>A global variable holding the last recently issued error message. See also
     16 <code><a href="ref.html#errors">Error Handling</a></code>, <code><a
     17 href="refE.html#*Err">*Err</a></code> and <code><a
     18 href="ref_.html#^">^</a></code>.
     19 
     20 <pre><code>
     21 : (+ 'A 2)
     22 !? (+ 'A 2)
     23 A -- Number expected
     24 ?
     25 :
     26 : *Msg
     27 -> "Number expected"
     28 </code></pre>
     29 
     30 <dt><a name="+Mis"><code>+Mis</code></a>
     31 <dd>Prefix class to explicitly specify validation functions for <code><a
     32 href="refR.html#+relation">+relation</a></code>s. Expects a function that takes
     33 a value and an entity object, and returns <code>NIL</code> if everything is
     34 correct, or an error string. See also <a href="ref.html#dbase">Database</a>.
     35 
     36 <pre><code>
     37 (class +Ord +Entity)            # Order class
     38 (rel pos (+Mis +List +Joint)    # List of positions in that order
     39    ((Val Obj)
     40       (when (memq NIL Val)
     41          "There are empty positions" ) )
     42    ord (+Pos) )
     43 </code></pre>
     44 
     45 <dt><a name="macro"><code>(macro prg) -> any</code></a>
     46 <dd>Substitues all <code><a href="refP.html#pat?">pat?</a></code> symbols in
     47 <code>prg</code> (using <code><a href="refF.html#fill">fill</a></code>), and
     48 executes the result with <code><a href="refR.html#run">run</a></code>. Used
     49 occasionally to call functions which otherwise do not evaluate their arguments.
     50 
     51 <pre><code>
     52 : (de timerMessage (@N . @Prg)
     53    (setq @N (- @N))
     54    (macro
     55       (task @N 0 . @Prg) ) )
     56 -> timerMessage
     57 : (timerMessage 6000 (println 'Timer 6000))
     58 -> (-6000 0 (println 'Timer 6000))
     59 : (timerMessage 12000 (println 'Timer 12000))
     60 -> (-12000 0 (println 'Timer 12000))
     61 : (more *Run)
     62 (-12000 2616 (println 'Timer 12000))
     63 (-6000 2100 (println 'Timer 6000))
     64 -> NIL
     65 : Timer 6000
     66 Timer 12000
     67 ...
     68 </code></pre>
     69 
     70 <dt><a name="made"><code>(made ['lst1 ['lst2]]) -> lst</code></a>
     71 <dd>Initializes a new list value for the current <code><a
     72 href="refM.html#make">make</a></code> environment. All list elements already
     73 produced with <code><a href="refC.html#chain">chain</a></code> and <code><a
     74 href="refL.html#link">link</a></code> are discarded, and <code>lst1</code> is
     75 used instead. Optionally, <code>lst2</code> can be specified as the new linkage
     76 cell, otherwise the last cell of <code>lst1</code> is used. When called without
     77 arguments, <code>made</code> does not modify the environment. In any case, the
     78 current list is returned.
     79 
     80 <pre><code>
     81 : (make
     82    (link 'a 'b 'c)         # Link three items
     83    (println (made))        # Print current list (a b c)
     84    (made (1 2 3))          # Discard it, start new with (1 2 3)
     85    (link 4) )              # Link 4
     86 (a b c)
     87 -> (1 2 3 4)
     88 </code></pre>
     89 
     90 <dt><a name="mail"><code>(mail 'any 'cnt 'sym1 'sym2|lst1 'sym3 'lst2 . prg)'</code></a>
     91 <dd>Sends an eMail via SMTP to a mail server at host <code>any</code>, port
     92 <code>cnt</code>. <code>sym1</code> should be the "from" address,
     93 <code>sym2|lst1</code> the "to" address(es), and <code>sym3</code> the subject.
     94 <code>lst2</code> is a list of attachments, each one specified by three elements
     95 for path, name and mime type. <code>prg</code> generates the mail body with
     96 <code><a href="refP.html#prEval">prEval</a></code>. See also <code><a
     97 href="refC.html#connect">connect</a></code>.
     98 
     99 <pre><code>
    100 (mail "localhost" 25                               # Local mail server
    101    "a@bc.de"                                       # "From" address
    102    "abu@software-lab.de"                           # "To" address
    103    "Testmail"                                      # Subject
    104    (quote
    105       "img/go.png" "go.png" "image/png"            # First attachment
    106       "img/7fach.gif" "7fach.gif" "image/gif" )    # Second attachment
    107    "Hello,"                                        # First line
    108    NIL                                             # (empty line)
    109    (prinl (pack "This is mail #" (+ 3 4))) )       # Third line
    110 </code></pre>
    111 
    112 <dt><a name="make"><code>(make .. [(made 'lst ..)] .. [(link 'any ..)] ..) -> any</code></a>
    113 <dd>Initializes and executes a list-building process with the <code><a
    114 href="refM.html#made">made</a></code>, <code><a
    115 href="refC.html#chain">chain</a></code>, <code><a
    116 href="refL.html#link">link</a></code> and <code><a
    117 href="refY.html#yoke">yoke</a></code> functions, and returns the result list.
    118 For efficiency, pointers to the head and the tail of the list are maintained
    119 internally.
    120 
    121 <pre><code>
    122 : (make (link 1) (link 2 3) (link 4))
    123 -> (1 2 3 4)
    124 : (make (made (1 2 3)) (link 4))
    125 -> (1 2 3 4)
    126 </code></pre>
    127 
    128 <dt><a name="map"><code>(map 'fun 'lst ..) -> lst</code></a>
    129 <dd>Applies <code>fun</code> to <code>lst</code> and all successive CDRs. When
    130 additional <code>lst</code> arguments are given, they are passed to
    131 <code>fun</code> in the same way. Returns the result of the last application.
    132 See also <code><a href="refM.html#mapc">mapc</a></code>, <code><a
    133 href="refM.html#maplist">maplist</a></code>, <code><a
    134 href="refM.html#mapcar">mapcar</a></code>, <code><a
    135 href="refM.html#mapcon">mapcon</a></code>, <code><a
    136 href="refM.html#mapcan">mapcan</a></code> and <code><a
    137 href="refF.html#filter">filter</a></code>.
    138 
    139 <pre><code>
    140 : (map println (1 2 3 4) '(A B C))
    141 (1 2 3 4) (A B C)
    142 (2 3 4) (B C)
    143 (3 4) (C)
    144 (4) NIL
    145 -> NIL
    146 </code></pre>
    147 
    148 <dt><a name="map/3"><code>map/3</code></a>
    149 <dd><a href="ref.html#pilog">Pilog</a> predicate that returns a list and
    150 subsequent CDRs of that list, after applying the <code><a
    151 href="refG.html#get">get</a></code> algorithm to that object and the following
    152 arguments. Often used in database queries. See also <code><a
    153 href="refL.html#lst/3">lst/3</a></code>.
    154 
    155 <pre><code>
    156 : (? (db nr +Ord 1 @Ord) (map @L @Ord pos))
    157  @Ord={3-7} @L=({4-1} {4-2} {4-3})
    158  @Ord={3-7} @L=({4-2} {4-3})
    159  @Ord={3-7} @L=({4-3})
    160 -> NIL
    161 </code></pre>
    162 
    163 <dt><a name="mapc"><code>(mapc 'fun 'lst ..) -> any</code></a>
    164 <dd>Applies <code>fun</code> to each element of <code>lst</code>. When
    165 additional <code>lst</code> arguments are given, their elements are also passed
    166 to <code>fun</code>. Returns the result of the last application. See also
    167 <code><a href="refM.html#map">map</a></code>, <code><a
    168 href="refM.html#maplist">maplist</a></code>, <code><a
    169 href="refM.html#mapcar">mapcar</a></code>, <code><a
    170 href="refM.html#mapcon">mapcon</a></code>, <code><a
    171 href="refM.html#mapcan">mapcan</a></code> and <code><a
    172 href="refF.html#filter">filter</a></code>.
    173 
    174 <pre><code>
    175 : (mapc println (1 2 3 4) '(A B C))
    176 1 A
    177 2 B
    178 3 C
    179 4 NIL
    180 -> NIL
    181 </code></pre>
    182 
    183 <dt><a name="mapcan"><code>(mapcan 'fun 'lst ..) -> lst</code></a>
    184 <dd>Applies <code>fun</code> to each element of <code>lst</code>. When
    185 additional <code>lst</code> arguments are given, their elements are also passed
    186 to <code>fun</code>. Returns a (destructively) concatenated list of all results.
    187 See also <code><a href="refM.html#map">map</a></code>, <code><a
    188 href="refM.html#mapc">mapc</a></code>, <code><a
    189 href="refM.html#maplist">maplist</a></code>, <code><a
    190 href="refM.html#mapcar">mapcar</a></code>, <code><a
    191 href="refM.html#mapcon">mapcon</a></code>, <code><a
    192 href="refF.html#filter">filter</a></code>.
    193 
    194 <pre><code>
    195 : (mapcan reverse '((a b c) (d e f) (g h i)))
    196 -> (c b a f e d i h g)
    197 </code></pre>
    198 
    199 <dt><a name="mapcar"><code>(mapcar 'fun 'lst ..) -> lst</code></a>
    200 <dd>Applies <code>fun</code> to each element of <code>lst</code>. When
    201 additional <code>lst</code> arguments are given, their elements are also passed
    202 to <code>fun</code>. Returns a list of all results. See also <code><a
    203 href="refM.html#map">map</a></code>, <code><a
    204 href="refM.html#mapc">mapc</a></code>, <code><a
    205 href="refM.html#maplist">maplist</a></code>, <code><a
    206 href="refM.html#mapcon">mapcon</a></code>, <code><a
    207 href="refM.html#mapcan">mapcan</a></code> and <code><a
    208 href="refF.html#filter">filter</a></code>.
    209 
    210 <pre><code>
    211 : (mapcar + (1 2 3) (4 5 6))
    212 -> (5 7 9)
    213 : (mapcar '((X Y) (+ X (* Y Y))) (1 2 3 4) (5 6 7 8))
    214 -> (26 38 52 68)
    215 </code></pre>
    216 
    217 <dt><a name="mapcon"><code>(mapcon 'fun 'lst ..) -> lst</code></a>
    218 <dd>Applies <code>fun</code> to <code>lst</code> and all successive CDRs. When
    219 additional <code>lst</code> arguments are given, they are passed to
    220 <code>fun</code> in the same way. Returns a (destructively) concatenated list of
    221 all results. See also <code><a href="refM.html#map">map</a></code>, <code><a
    222 href="refM.html#mapc">mapc</a></code>, <code><a
    223 href="refM.html#maplist">maplist</a></code>, <code><a
    224 href="refM.html#mapcar">mapcar</a></code>, <code><a
    225 href="refM.html#mapcan">mapcan</a></code> and <code><a
    226 href="refF.html#filter">filter</a></code>.
    227 
    228 <pre><code>
    229 : (mapcon copy '(1 2 3 4 5))
    230 -> (1 2 3 4 5 2 3 4 5 3 4 5 4 5 5)
    231 </code></pre>
    232 
    233 <dt><a name="maplist"><code>(maplist 'fun 'lst ..) -> lst</code></a>
    234 <dd>Applies <code>fun</code> to <code>lst</code> and all successive CDRs. When
    235 additional <code>lst</code> arguments are given, they are passed to
    236 <code>fun</code> in the same way. Returns a list of all results. See also
    237 <code><a href="refM.html#map">map</a></code>, <code><a
    238 href="refM.html#mapc">mapc</a></code>, <code><a
    239 href="refM.html#mapcar">mapcar</a></code>, <code><a
    240 href="refM.html#mapcon">mapcon</a></code>, <code><a
    241 href="refM.html#mapcan">mapcan</a></code> and <code><a
    242 href="refF.html#filter">filter</a></code>.
    243 
    244 <pre><code>
    245 : (maplist cons (1 2 3) '(A B C))
    246 -> (((1 2 3) A B C) ((2 3) B C) ((3) C))
    247 </code></pre>
    248 
    249 <dt><a name="maps"><code>(maps 'fun 'sym ['lst ..]) -> any</code></a>
    250 <dd>Applies <code>fun</code> to all properties of <code>sym</code>. When
    251 additional <code>lst</code> arguments are given, their elements are also passed
    252 to <code>fun</code>. Returns the result of the last application. See also
    253 <code><a href="refP.html#putl">putl</a></code> and <code><a
    254 href="refG.html#getl">getl</a></code>.
    255 
    256 <pre><code>
    257 : (put 'X 'a 1)
    258 -> 1
    259 : (put 'X 'b 2)
    260 -> 2
    261 : (put 'X 'flg T)
    262 -> T
    263 : (getl 'X)
    264 -> (flg (2 . b) (1 . a))
    265 : (maps println 'X '(A B))
    266 flg A
    267 (2 . b) B
    268 (1 . a) NIL
    269 -> NIL
    270 </code></pre>
    271 
    272 <dt><a name="mark"><code>(mark 'sym|0 ['NIL | 'T | '0]) -> flg</code></a>
    273 <dd>Tests, sets or resets a mark for <code>sym</code> in the database (for a
    274 second argument of <code>NIL</code>, <code>T</code> or <code>0</code>,
    275 respectively), and returns the old value. The marks are local to the current
    276 process (not stored in the database), and vanish when the process terminates. If
    277 the first argument is zero, all marks are cleared.
    278 
    279 <pre><code>
    280 : (pool "db")
    281 -> T
    282 : (mark '{1} T)      # Mark
    283 -> NIL
    284 : (mark '{1})        # Test
    285 -> T                 # -> marked
    286 : (mark '{1} 0)      # Unmark
    287 -> T
    288 : (mark '{1})        # Test
    289 -> NIL               # -> unmarked
    290 </code></pre>
    291 
    292 <dt><a name="match"><code>(match 'lst1 'lst2) -> flg</code></a>
    293 <dd>Takes <code>lst1</code> as a pattern to be matched against
    294 <code>lst2</code>, and returns <code>T</code> when successful. Atoms must be
    295 equal, and sublists must match recursively. Symbols in the pattern list with
    296 names starting with an at-mark "<code>@</code>" (see <code><a
    297 href="refP.html#pat?">pat?</a></code>) are taken as wildcards. They can match
    298 zero, one or more elements, and are bound to the corresponding data. See also
    299 <code><a href="refC.html#chop">chop</a></code>, <code><a
    300 href="refS.html#split">split</a></code> and <code><a
    301 href="refF.html#fill">fill</a></code>.
    302 
    303 <pre><code>
    304 : (match '(@A is @B) '(This is a test))
    305 -> T
    306 : @A
    307 -> (This)
    308 : @B
    309 -> (a test)
    310 : (match '(@X (d @Y) @Z) '((a b c) (d (e f) g) h i))
    311 -> T
    312 : @X
    313 -> ((a b c))
    314 : @Y
    315 -> ((e f) g)
    316 : @Z
    317 -> (h i)
    318 </code></pre>
    319 
    320 <dt><a name="max"><code>(max 'any ..) -> any</code></a>
    321 <dd>Returns the largest of all <code>any</code> arguments. See also <a
    322 href="refM.html#min">min</a> and <a href="ref.html#cmp">Comparing</a>.
    323 
    324 <pre><code>
    325 : (max 2 'a 'z 9)
    326 -> z
    327 : (max (5) (2 3) 'X)
    328 -> (5)
    329 </code></pre>
    330 
    331 <dt><a name="maxKey"><code>(maxKey 'tree ['any1 ['any2]]) -> any</code></a>
    332 <dd>Returns the largest key in a database tree. If a minimal key
    333 <code>any1</code> and/or a maximal key <code>any2</code> is given, the largest
    334 key from that range is returned. See also <code><a
    335 href="refT.html#tree">tree</a></code>, <code><a
    336 href="refL.html#leaf">leaf</a></code>, <code><a
    337 href="refM.html#minKey">minKey</a></code> and <code><a
    338 href="refG.html#genKey">genKey</a></code>.
    339 
    340 <pre><code>
    341 : (maxKey (tree 'nr '+Item))
    342 -> 7
    343 : (maxKey (tree 'nr '+Item) 3 5)
    344 -> 5
    345 </code></pre>
    346 
    347 <dt><a name="maxi"><code>(maxi 'fun 'lst ..) -> any</code></a>
    348 <dd>Applies <code>fun</code> to each element of <code>lst</code>. When
    349 additional <code>lst</code> arguments are given, their elements are also passed
    350 to <code>fun</code>. Returns that element from <code>lst</code> for which
    351 <code>fun</code> returned a maximal value. See also <code><a
    352 href="refM.html#mini">mini</a></code> and <code><a
    353 href="refS.html#sort">sort</a></code>.
    354 
    355 <pre><code>
    356 : (setq A 1  B 2  C 3)
    357 -> 3
    358 : (maxi val '(A B C))
    359 -> C
    360 : (maxi                          # Symbol with largest list value
    361    '((X)
    362       (and (pair (val X)) (size @)) )
    363    (all) )
    364 -> pico
    365 </code></pre>
    366 
    367 <dt><a name="member"><code>(member 'any 'lst) -> any</code></a>
    368 <dd>Returns the tail of <code>lst</code> that starts with <code>any</code> when
    369 <code>any</code> is a member of <code>lst</code>, otherwise <code>NIL</code>.
    370 See also <code><a href="refM.html#memq">memq</a></code>, <code><a
    371 href="refA.html#assoc">assoc</a></code> and <code><a
    372 href="refI.html#idx">idx</a></code>.
    373 
    374 <pre><code>
    375 : (member 3 (1 2 3 4 5 6))
    376 -> (3 4 5 6)
    377 : (member 9 (1 2 3 4 5 6))
    378 -> NIL
    379 : (member '(d e f) '((a b c) (d e f) (g h i)))
    380 -> ((d e f) (g h i))
    381 </code></pre>
    382 
    383 <dt><a name="member/2"><code>member/2</code></a>
    384 <dd><a href="ref.html#pilog">Pilog</a> predicate that succeeds if the the first
    385 argument is a member of the list in the second argument. See also <code><a
    386 href="refE.html#equal/2">equal/2</a></code> and <code><a
    387 href="refM.html#member">member</a></code>.
    388 
    389 <pre><code>
    390 :  (? (member @X (a b c)))
    391  @X=a
    392  @X=b
    393  @X=c
    394 -> NIL
    395 </code></pre>
    396 
    397 <dt><a name="memq"><code>(memq 'any 'lst) -> any</code></a>
    398 <dd>Returns the tail of <code>lst</code> that starts with <code>any</code> when
    399 <code>any</code> is a member of <code>lst</code>, otherwise <code>NIL</code>.
    400 <code><a href="ref_.html#==">==</a></code> is used for comparison (pointer
    401 equality). See also <code><a href="refM.html#member">member</a></code>, <code><a
    402 href="refM.html#mmeq">mmeq</a></code>, <code><a
    403 href="refA.html#asoq">asoq</a></code>, <code><a
    404 href="refD.html#delq">delq</a></code> and <a href="ref.html#cmp">Comparing</a>.
    405 
    406 <pre><code>
    407 : (memq 'c '(a b c d e f))
    408 -> (c d e f)
    409 : (memq (2) '((1) (2) (3)))
    410 -> NIL
    411 </code></pre>
    412 
    413 <dt><a name="meta"><code>(meta 'obj|typ 'sym ['sym2|cnt ..]) -> any</code></a>
    414 <dd>Fetches a property value <code>any</code>, by searching the property lists
    415 of the classes and superclasses of <code>obj</code>, or the classes in
    416 <code>typ</code>, for the property key <code>sym</code>, and by applying the
    417 <code><a href="refG.html#get">get</a></code> algorithm to the following optional
    418 arguments. See also <code><a href="refV.html#var:">var:</a></code>.
    419 
    420 <pre><code>
    421 : (setq A '(B))            # Be 'A' an object of class 'B'
    422 -> (B)
    423 : (put 'B 'a 123)
    424 -> 123
    425 : (meta 'A 'a)             # Fetch 'a' from 'B'
    426 -> 123
    427 </code></pre>
    428 
    429 <dt><a name="meth"><code>(meth 'obj ['any ..]) -> any</code></a>
    430 <dd>This function is usually not called directly, but is used by <code> <a
    431 href="refD.html#dm">dm</a></code> as a template to initialize the
    432 <code>VAL</code> of message symbols. It searches for itself in the methods of
    433 <code>obj</code> and its classes and superclasses, and executes that method. An
    434 error <code>"Bad message"</code> is issued if the search is unsuccessful. See
    435 also <a href="ref.html#oop">OO Concepts</a>, <code><a
    436 href="refM.html#method">method</a></code>, <code><a
    437 href="refS.html#send">send</a></code> and <code><a
    438 href="refT.html#try">try</a></code>.
    439 
    440 <pre><code>
    441 : meth
    442 -> 67283504    # Value of 'meth'
    443 : stop>
    444 -> 67283504    # Value of any message
    445 </code></pre>
    446 
    447 <dt><a name="method"><code>(method 'msg 'obj) -> fun</code></a>
    448 <dd>Returns the function body of the method that would be executed upon sending
    449 the message <code>msg</code> to the object <code>obj</code>. If the message
    450 cannot be located in <code>obj</code>, its classes and superclasses,
    451 <code>NIL</code> is returned. See also <a href="ref.html#oop">OO Concepts</a>,
    452 <code><a href="refS.html#send">send</a></code>, <code><a
    453 href="refT.html#try">try</a></code>, <code><a
    454 href="refM.html#meth">meth</a></code>, <code><a
    455 href="refS.html#super">super</a></code>, <code><a
    456 href="refE.html#extra">extra</a></code>, <code><a
    457 href="refC.html#class">class</a></code>.
    458 
    459 <pre><code>
    460 : (method 'mis> '+Number)
    461 -> ((Val Obj) (and Val (not (num? Val)) "Numeric input expected"))
    462 </code></pre>
    463 
    464 <dt><a name="methods"><code>(methods 'sym) -> lst</code></a>
    465 <dd>(Debug mode only) Returns a list of method specifications for the object or
    466 class <code>sym</code>, as they are inherited from <code>sym</code>'s classes
    467 and superclasses. See also <a href="ref.html#oop">OO Concepts</a>, <code><a
    468 href="refD.html#dep">dep</a></code>, <code><a
    469 href="refC.html#class">class</a></code> and <code><a
    470 href="refC.html#can">can</a></code>.
    471 
    472 <pre><code>
    473 : (more (methods '+Joint))
    474 (keep> . +Joint)
    475 (lose> . +Joint)
    476 (rel> . +Joint)
    477 (mis> . +Joint)
    478 (T . +Joint)
    479 (revise> . +relation)
    480 (print> . +relation)
    481 (zap> . +relation)
    482 (del> . +relation)
    483 (put> . +relation)
    484 (has> . +relation)
    485 (ele> . +relation)
    486 </code></pre>
    487 
    488 <dt><a name="min"><code>(min 'any ..) -> any</code></a>
    489 <dd>Returns the smallest of all <code>any</code> arguments. See also <a
    490 href="refM.html#max">max</a> and <a href="ref.html#cmp">Comparing</a>.
    491 
    492 <pre><code>
    493 : (min 2 'a 'z 9)
    494 -> 2
    495 : (min (5) (2 3) 'X)
    496 -> X
    497 </code></pre>
    498 
    499 <dt><a name="minKey"><code>(minKey 'tree ['any1 ['any2]]) -> any</code></a>
    500 <dd>Returns the smallest key in a database tree. If a minimal key
    501 <code>any1</code> and/or a maximal key <code>any2</code> is given, the smallest
    502 key from that range is returned. See also <code><a
    503 href="refT.html#tree">tree</a></code>, <code><a
    504 href="refL.html#leaf">leaf</a></code>, <code><a
    505 href="refM.html#maxKey">maxKey</a></code> and <code><a
    506 href="refG.html#genKey">genKey</a></code>.
    507 
    508 <pre><code>
    509 : (minKey (tree 'nr '+Item))
    510 -> 1
    511 : (minKey (tree 'nr '+Item) 3 5)
    512 -> 3
    513 </code></pre>
    514 
    515 <dt><a name="mini"><code>(mini 'fun 'lst ..) -> any</code></a>
    516 <dd>Applies <code>fun</code> to each element of <code>lst</code>. When
    517 additional <code>lst</code> arguments are given, their elements are also passed
    518 to <code>fun</code>. Returns that element from <code>lst</code> for which
    519 <code>fun</code> returned a minimal value. See also <code><a
    520 href="refM.html#maxi">maxi</a></code> and <code><a
    521 href="refS.html#sort">sort</a></code>.
    522 
    523 <pre><code>
    524 : (setq A 1  B 2  C 3)
    525 -> 3
    526 : (mini val '(A B C))
    527 -> A
    528 </code></pre>
    529 
    530 <dt><a name="mix"><code>(mix 'lst cnt|'any ..) -> lst</code></a>
    531 <dd>Builds a list from the elements of the argument <code>lst</code>, as
    532 specified by the following <code>cnt|'any</code> arguments. If such an argument
    533 is a number, the <code>cnt</code>'th element from <code>lst</code> is taken,
    534 otherwise that argument is evaluated and the result is used.
    535 
    536 <pre><code>
    537 : (mix '(a b c d) 3 4 1 2)
    538 -> (c d a b)
    539 : (mix '(a b c d) 1 'A 4 'D)
    540 -> (a A d D)
    541 </code></pre>
    542 
    543 <dt><a name="mmeq"><code>(mmeq 'lst 'lst) -> any</code></a>
    544 <dd>Returns the tail of the second argument <code>lst</code> that starts with a
    545 member of the first argument <code>lst</code>, otherwise <code>NIL</code>.
    546 <code><a href="ref_.html#==">==</a></code> is used for comparison (pointer
    547 equality). See also <code><a href="refM.html#member">member</a></code>, <code><a
    548 href="refM.html#memq">memq</a></code>, <code><a
    549 href="refA.html#asoq">asoq</a></code> and <code><a
    550 href="refD.html#delq">delq</a></code>.
    551 
    552 <pre><code>
    553 : (mmeq '(a b c) '(d e f))
    554 -> NIL
    555 : (mmeq '(a b c) '(d b x))
    556 -> (b x)
    557 </code></pre>
    558 
    559 <dt><a name="money"><code>(money 'num ['sym]) -> sym</code></a>
    560 <dd>Formats a number <code>num</code> into a digit string with two decimal
    561 places, according to the current <code><a
    562 href="refL.html#locale">locale</a></code>. If an additional currency name is
    563 given, it is appended (separated by a space). See also <code><a
    564 href="refT.html#telStr">telStr</a></code>, <code><a
    565 href="refD.html#datStr">datStr</a></code> and <code><a
    566 href="refF.html#format">format</a></code>.
    567 
    568 <pre><code>
    569 : (money 123456789)
    570 -> "1,234,567.89"
    571 : (money 12345 "EUR")
    572 -> "123.45 EUR"
    573 : (locale "DE" "de")
    574 -> NIL
    575 : (money 123456789 "EUR")
    576 -> "1.234.567,89 EUR"
    577 </code></pre>
    578 
    579 <dt><a name="more"><code>(more 'lst ['fun]) -> flg</code></a>
    580 <dt><code>(more 'cls) -> any</code>
    581 <dd>(Debug mode only) Displays the elements of <code>lst</code> (first form), or
    582 the type and methods of <code>cls</code> (second form). <code>fun</code>
    583 defaults to <code><a href="refP.html#print">print</a></code>. In the second
    584 form, the method definitions of <code>cls</code> are pretty-printed with
    585 <code><a href="refP.html#pp">pp</a></code>. After each step, <code>more</code>
    586 waits for console input, and terminates when a non-empty line is entered. In
    587 that case, <code>T</code> is returned, otherwise (when end of data is reached)
    588 <code>NIL</code>. See also <code><a href="refQ.html#query">query</a></code> and
    589 <code><a href="refS.html#show">show</a></code>.
    590 
    591 <pre><code>
    592 : (more (all))                         # Display all internal symbols
    593 inc>
    594 leaf
    595 nil
    596 inc!
    597 accept.                                # Stop
    598 -> T
    599 
    600 : (more (all) show)                    # 'show' all internal symbols
    601 inc> 67292896
    602    *Dbg ((859 . "lib/db.l"))
    603 
    604 leaf ((Tree) (let (Node (cdr (root Tree)) X) (while (val Node) (setq X (cadr @) Node (car @))) (cddr X)))
    605    *Dbg ((173 . "lib/btree.l"))
    606 
    607 nil 67284680
    608    T (((@X) (^ @ (not (-> @X)))))
    609 .                                      # Stop
    610 -> T
    611 
    612 : (more '+Link)                        # Display a class
    613 (+relation)
    614 
    615 (dm mis> (Val Obj)
    616    (and
    617       Val
    618       (nor (isa (: type) Val) (canQuery Val))
    619       "Type error" ) )
    620 
    621 (dm T (Var Lst)
    622    (unless (=: type (car Lst)) (quit "No Link" Var))
    623    (super Var (cdr Lst)) )
    624 
    625 -> NIL
    626 </code></pre>
    627 
    628 <dt><a name="msg"><code>(msg 'any ['any ..]) -> any</code></a>
    629 <dd>Prints <code>any</code> with <code><a
    630 href="refP.html#print">print</a></code>, followed by all <code>any</code>
    631 arguments (printed with <code><a href="refP.html#prin">prin</a></code>) and a
    632 newline, to standard error. The first <code>any</code> argument is returned.
    633 
    634 <pre><code>
    635 : (msg (1 a 2 b 3 c) " is a mixed " "list")
    636 (1 a 2 b 3 c) is a mixed list
    637 -> (1 a 2 b 3 c)
    638 </code></pre>
    639 
    640 </dl>
    641 
    642 </body>
    643 </html>