1 \documentclass{article
}
5 \title{XLISP-STAT
2.1 Release
3\
\Beta Release Notes
}
6 \author{Luke Tierney\
\School of Statistics\
\University of Minnesota
}
9 \newcommand{\mytilde}{\~
{ }}
11 \newcommand{\param}[1]{{\em $<$
#1$>$
}}
13 \newcommand{\funindex}[1]{\index{#1 function@
{\tt #1} function
}}
14 \newcommand{\specindex}[1]{\index{#1 special form@
{\tt #1} special form
}}
15 \newcommand{\macindex}[1]{\index{#1 macro@
{\tt #1} macro
}}
16 \newcommand{\varindex}[1]{\index{#1 variable@
{\tt #1} variable
}}
17 \newcommand{\varstarindex}[1]{\index{#1 variable@
{\tt *
#1*
} variable
}}
18 \newcommand{\constindex}[1]{\index{#1 constant@
{\tt #1} constant
}}
19 \newcommand{\lkeyindex}[1]{\index{#1 lambda keyword@
{\tt \&
#1} lambda keyword
}}
20 \newcommand{\setfindex}[1]{\index{#1 setf form@
{\tt #1} setf form
}}
21 \newcommand{\keywordindex}[1]{\index{#1 keyword@
{\tt :
#1} keyword
}}
22 \newcommand{\typeindex}[1]{\index{#1 type@
{\tt #1} type
}}
23 \newcommand{\typelistindex}[1]{\index{#1 type@
{\tt (
#1)
} type
}}
24 \newcommand{\lfmtdirindex}[1]{\index{#1 format directive@
{\tt \mytilde#1} format directive
}}
25 \newcommand{\lerrtypeindex}[1]{\index{#1 error type@
{\tt #1} error type
}}
26 \newcommand{\lfeatureindex}[1]{\index{#1 feature@
{\tt #1} feature
}}
28 \newcommand{\lfun}[1]{{\tt #1}\funindex{#1}}
29 \newcommand{\lspec}[1]{{\tt #1}\specindex{#1}}
30 \newcommand{\lmac}[1]{{\tt #1}\macindex{#1}}
31 \newcommand{\lvar}[1]{{\tt #1}\varindex{#1}}
32 \newcommand{\lvarstar}[1]{{\tt *
#1*
}\varstarindex{#1}}
33 \newcommand{\lconst}[1]{{\tt #1}\constindex{#1}}
34 \newcommand{\llkey}[1]{{\tt \&
#1}\lkeyindex{#1}}
35 \newcommand{\lsetf}[1]{{\tt (setf
#1)
}\setfindex{#1}}
36 \newcommand{\lkeyword}[1]{{\tt :
#1}\keywordindex{#1}}
37 \newcommand{\ltype}[1]{{\tt #1}\typeindex{#1}}
38 \newcommand{\ltypelist}[1]{{\tt (
#1)
}\typelistindex{#1}}
39 \newcommand{\lfmtdir}[1]{{\tt \mytilde#1}\lfmtdirindex{#1}}
40 \newcommand{\lerrtype}[1]{{\tt #1}\lerrtypeindex{#1}}
41 \newcommand{\lfeature}[1]{{\tt #1}\lerrtypeindex{#1}}
43 \newcommand{\CL}{Common Lisp
}
44 \newcommand{\XWIN}{{\em X11
}}
45 \newcommand{\XL}{XLISP
}
46 \newcommand{\TAXL}{XLISP-PLUS
2.1g
}
47 \newcommand{\XLS}{XLISP-STAT
}
48 \newcommand{\NIL}{{\tt nil
}}
49 \newcommand{\TRUE}{{\tt t
}}
51 \newenvironment{note
}{\begin{quotation
}\noindent\em{}}{\end{quotation
}}
52 \newenvironment{warning
}{\begin{quotation
}\noindent\em{}}{\end{quotation
}}
54 \newenvironment{note
}{\begin{quotation
}}{\end{quotation
}}
55 \newenvironment{warning
}{\begin{quotation
}}{\end{quotation
}}
58 \newenvironment{CLSpec
}[2]{%
61 {#1} \hfill [{\em {#2}}]\\
\begin{latexonly
}\em{}}%
70 \section{Introduction
}
71 This note outlines some of the changes in the new
\XLS\ release from
72 Release
2. There are a large number of minor changes, mostly in the
73 basic
\XL\ system. These changes move the basic
\XL\ closer to
\CL, and
74 include the addition of packages, multiple values, other improvements
75 from
\TAXL, and a byte code compiler. Wherever possible, changes have
76 been made in such a way as to maintain backward compatibility. In a
77 few, hopefully minor, cases this was not possible; these cases should
81 If you notice anything that has changed and is not mentioned here,
82 please let me know. If any change causes exceptional grief, please let
87 \section{Changes to System Features
}
88 \subsection{Debugging and Evaluation
}
89 \label{Subsection:Debugging
}
90 The error handling in
\XLS\ is now based on the
\CL\ condition system.
91 When debugging is turned on, an error enters a break loop. The break
92 loop presents a list of the available restarts, and the function
93 \lfun{continue
} can be used to select a restart:
95 Error: illegal zero argument
97 To continue, type (continue n), where n is an option number:
98 0: Return to break level
1.
99 1: Return to Lisp Toplevel.
102 When debugging is not turned on, an indication of the function in
103 which the error occurred is printed before the system returns to the
106 Error: illegal zero argument
107 Happened in: #<Subr-/: #c49e20>
111 The
\lfun{baktrace
} function now accepts a second optional argument
112 that determines whether it prints function arguments or not. Supplying
113 \NIL\ as this argument suppresses argument printing. The default value
114 for this argument is the value of the special variable
115 \lvarstar{baktrace-print-arguments
}.
117 The back trace does not show entries for byte compiled functions or
118 internal functions called from byte compiled code.
120 The old
\lfun{step
} function has been replaced by a new one from the
121 the stepper file included in
\TAXL. Detailed documentation for this
122 new
\lfun{step
} is given in Appendix
\ref{Appendix:Stepper
}. The
123 Macintosh version of
\lfun{step
} no longer has a dialog interface.
125 The action taken in response to a user interrupt is now customizable.
126 If the value of the special variable
\lvarstar{interrupt-action
} is
127 \NIL, interrupts are ignored. Otherwise, the value should be a
128 function of no arguments that is called in response to an interrupt.
129 The default value is the
\lfun{top-level
} function that returns to the
132 Debugging may be affected by the handling of macros. If the special
133 variable
\lvarstar{displace-macros
} is non-
\NIL, then macros are spliced
134 into the code after they are expanded. This means macros are only
135 expanded once and can significantly improve speed of interpreted code.
136 But it may make code used in stepping less readable, so it may be
137 useful to set this variable to
\NIL\ during debugging.
139 \XL\ can now be more strict in checking for keywords. If
140 \lvarstar{strict-keywords
} is non-
\NIL, then specifying keyword
141 arguments not defined for a function signals an error unless the
142 function is defined using
\llkey{allow-other-keys
} or the keyword
143 arguments include
\lkeyword{allow-other-keys
} with a non-
\NIL\ value.
144 If the value of
\lvarstar{strict-keywords
} is
\NIL, then unmatched
145 keywords are always ignored. For now, this is the default setting.
148 Some graphical control over the system option variables, choosing
149 restarts, etc. is clearly needed.
152 \subsection{Top Level and Saved Workspaces
}
153 It is now possible to save workspaces and customize the initialization
154 and top level functions. The function
\lfun{save-workspace
} takes a
155 single argument, the name of the saved workspace file. It closes all
156 windows and menus, creates the saved workspace, and exits from the
157 system. The workspace file is created with a
{\tt .wks
} extension.
159 On UNIX, and eventually MS Windows, a saved workspace can be loaded by
160 specifying
{\tt -w
}{\it file.wks
} (with no spaces) as a command line
161 argument. On a Macintosh, you can double click a workspace. If no
162 workspace argument is given, the workspace named
{\tt xlisp.wks
} in the
163 startup directory is used if one is available. Otherwise, a file
{\tt
164 init.lsp
} is loaded. (So
{\tt init.lsp
} is not loaded if a workspace
165 is found). It is currently not possible to load a new workspace once
166 the system has started up.
168 After loading a workspace or the
{\tt init.lsp
} file, files on the
169 command line (or files that where double clicked on the Macintosh) are
170 loaded. The command line used to start up
\XLS\ is also made available
171 as a list of strings in the variable
\lvarstar{command-line
}. (On the
172 Macintosh this variable currently does not contain anything useful.)
173 Next, the functions of no arguments in the list that is the value of
174 \lvarstar{startup-functions
} is called. One of the functions in the
175 default value of this variable is responsible for loading the
{\tt
176 statinit.lsp
} file. Finally, the function
\lvarstar{top-level-loop
} is
177 called. This function is called again each time the system is reset to
180 The installed versions of xlispstat are now set up to start from a
181 default
{\tt xlisp.wks
} saved workspace rather than by loading a set
182 of
{\tt .lsp
} files. Compiled versions of files needed less frequently
183 and help information are still kept in a library and loaded on demand.
186 The basic objective here is to make startup and the top level
187 customizable. The details are likely to change somewhat as I get
188 things straightened out on the Mac and Windows versions.
191 The ability to save workspaces (and to byte compile files) creates a
192 problem for using
\verb|#+| and
\verb|#-| to test for runtime
193 properties. These tests occur when a file is read. But a file can be
194 read on a computer with a
color display and the definitions can then
195 be used from a saved workspace on a monochrome display, for example.
196 As a result,
\verb|#+| and
\verb|#-| should only be used for
197 properties, such as the operating system type, that will not change
198 from one invocation to another. Runtime tests, such as the function
199 \lfun{screen-has-
color} should be used instead. All system files
200 should have been rewritten with this in mind.
203 \subsection{IEEE NaN's and infinites
}
204 Three constants are defined to support IEEE NaN's and infinities:
207 \lconst{positive-infinity
} &
\lconst{negative-infinity
} &
208 \lconst{not-a-number
}
211 When printing an infinity or a NaN when
\lvarstar{print-escape
} is
212 \NIL, the appropriate symbol is printed using the
{\tt \#.
} read
218 This insures that all numbers are printed in a readable form, even
219 infinities. All NaN's are printed identically, there is no provision
220 for preserving variations among NaN's.
222 There is currently no provision for checking for a NaN or infinity.
223 There probably ought to be lisp equivalents of the IEEE-recommended
224 functions
{\tt isnan
} and
{\tt finite
}.
226 At present the symbols used here are external in the XLISP
227 package.As they are nonstandard, they should probably be internal in
231 \subsection{New Garbage Collector and Memory Requirements
}
232 The original mark-and-sweep collector of
\XL\ has been replaced by an
233 in-place two-generation generational collector. This means that there
234 are now two types of garbage collections, minor and major ones. Minor
235 collections occur relatively frequently but are very fast. Major ones
236 occur rather rarely in typical usage, and are only marginally slower
237 than mark-and-sweep collections. The net effect should be to reduce
238 garbage collection pauses significantly.
240 In addition, the system is more aggressive about allocating more space
241 when a substantial fraction of the allocated space is in use. This
242 should also reduce the number of collections, but may lead to greater
243 process memory growth. The impact on limited memory systems such as a
244 Macintosh with a small partition is not clear at this point.
246 The new garbage collector requires more storage space per Lisp node.
247 The overall requirements are increased by around
30\%-
50\%. The default
248 partition on the Macintosh will therefore be increased to
3M.
250 \subsection{Missing and Non-Numerical Data in Graphs
}
251 It is now possible to give plotting functions data sequences that
252 contain non-numerical values, such as missing value codes. Points
253 with one or more non-numerical coordinates are marked internally as
254 masked. This means they are not drawn and are not considered for the
255 calculation of scaling information.
257 Any non-numerical lisp item can be used as a missing data code, but
258 \NIL\ should be avoided since it also represents the empty list and
259 can cause confusion in vectorized operations.
261 \subsection{Working Directories and Directory Function
}
262 The function
\lfun{get-working-directory
} returns a string naming the
263 current working directory. The function
\lfun{set-working-directory
}
264 sets the working directory to the directory specified by its string
265 argument. If the change of directory succeeds,
\TRUE\ is returned.
266 Otherwise,
\NIL\ is returned.
268 On the Macintosh these functions will fail if the length of the
269 directory name is greater than
255.
271 A minimal version of the
\lfun{directory
} function is now available.
272 The wildcard character for all versions is
{\tt *
} -- even for the
273 macintosh. By default,
\lfun{directory
} only lists regular files. If a
274 non-
\NIL\ value is given for the
\lkeyword{all
} keyword argument, then
275 all files and directories are included. Thus
278 (directory "*" :all t)
280 should list all regular files and all files, respectively, in the
281 current working directory.
283 \subsection{Version Information
}
284 In addition to the feature
\lfeature{xlisp
}, starting with release
3.39
285 the new version also defines
\lfeature{xlisp-plus
}. The constants
286 \lconst{xls-major-release
} and
\lconst{xls-minor-release
} contain
287 the major and minor release numbers of the executable. For release
288 3.39, for example, these are
3 and
39, respectively.
290 \subsection{Content Backgrounds
}
291 The protocol used by the standard
\lkeyword{redraw-content
} methods
292 has been augmented to support maintaining a background for plot
293 contents. Instead of erasing the content area before drawing the
294 content, these methods now send the
\lkeyword{clear-content
} message.
295 The default method for this method clears the content area. By
296 overriding this method, you can draw any background you want to
299 Unless you want to handle clearing the background yourself, you should
300 begin your method with a call to
\lfun{call-next-method
}
302 A simple example: The code
304 (setf p (plot-points (normal-rand '(
10 10))))
306 (defmeth p :clear-content ()
308 (send self :frame-rect
50 50 100 100))
310 sets up a plot that contains a rectangle in its background.
312 This new protocol is still experimental and may change if a better
315 \section{Changes in Specific Implementations
}
317 \subsection{Changes in the UNIX/X11 Version
}
318 The initial workspace and the default directory can be specified on
319 the commandline as
{\tt -w
}{\em file.wks
} and
{\tt -d
}{\em dir
},
322 Upon startup of the
\XWIN\/ version of
\XLS\ the system merges
323 resources found in file
326 /usr/lib/X11/app-defaults/Xlisp
328 then ones found in the file
{\tt Xlisp
} in the directory named by the
329 environment variable
{\tt XAPPLRESDIR
}, and finally the resources of
330 the display. Resources can thus be specified in all three places, with
331 the display's resources having highest precedence.
333 The functions
\lfun{popen
} and
\lfun{pclose
} from
{\tt winterp
} have
334 been added to the UNIX version to allow streams connected to processes
337 The interface to these functions may change.
340 \subsection{Macintosh Changes and System
7 Support
}
341 Several options can now be set in a preferences file. This file is a
342 text file, is must be called
{\bf XLS Preferences
}, and it must be
343 located in the same folder as the application. Each line in the file
344 represents an option specification. The first word identifies the
345 option, the remaining words make up the option data. The option names
346 currently supported are
349 {\bf EditFontName
} &
{\bf EditFontSize
} &
{\bf EditFontStyle
}\\
350 {\bf ListenerFontName
} &
{\bf ListenerFontSize
} &
{\bf ListenerFontStyle
}\\
351 {\bf GraphFontName
} &
{\bf GraphFontSize
} &
{\bf GraphFontStyle
}\\
352 {\bf Workspace
} &
{\bf Color
}
355 the
{\bf Workspace
} entry specifies a default workspace to use. Unless
356 specified separately, listener font properties are identical to editor
357 font ones. As an example, a preferences file containing the entries
361 Workspace Alliance Drive:MPW:Programs:New XLS:xlisp.wks
364 specifies a
12-point bold italic Courier font for editor windows, an
365 alternative workspace, and turns
color off. Turning
color off may be
366 useful if the screen size and number of colors used would require too
367 much memory for the background buffer.
369 The dashed line separating system apple menu items from application
370 items is now supplied internally -- a dash item is now no longer
371 necessary. This should result in a single dash under both System
6 and
374 Under Macintosh System
7 \XLS\ now continues to operate while in
375 background. If the variable
\lvarstar{use-notifier
} is not
\NIL, then
376 notification occurs when a modal dialog is to be opened or when the
377 system tries to read from the listener. The notification consists of a
378 beep, a flashing icon on the system menu, and a diamond marking the
379 application name in the system menu.
381 Minimal support for examining processes on the current computer and
382 for sending local or remote apple events is now available. The
383 function
\lfun{launch-application
} takes either a file name string
384 argument or an application signature argument and launches the
385 corresponding application. By default the application is launched in
386 foreground; specifying an optional argument as non-
\NIL\ causes the
387 application to be launched in background. The value returned is a
388 process information record if the launch succeeds, or
\NIL\ if the
389 launch fails. Process information is currently encoded as a list of
390 the process name, process signature, process serial number, time of
391 process start and run time of the process. This representation may
394 Currently applications can only be found by signature if they are
395 located on the boot volume.
397 Application signatures used by
\lfun{launch-application
} are integers
398 representing four-character character constants. The function
399 \lfun{encode-signature
} converts strings with the corresponding string
400 of characters to the signature code. For example,
402 > (encode-signature "X1St")
405 computes the signature code for
{\tt X1St
}, the signature for
\XLS.
407 A list of process information records for all running processes is
408 returned by
\lfun{get-process-list
}, and
\lfun{get-front-process
}
409 returns the process information for the current front process. The
410 \lfun{set-front-process
} function takes a process name string,
411 signature code, or process information record and makes the
412 corresponding process the front process. If the argument is a string
413 or integer, then the first process, if any, with the corresponding
414 name or signature is used.
416 \XLS\ now responds to the four required Apple events (Open
417 Application, Open Documents, Print Documents, and Quit Application).
418 The Print event is ignored. Currently new workspaces can only be
419 opened at startup (i.~e. as part of the initial high level event), but
420 text files can be opened by double clicking them or dragging them onto
421 the
\XLS\ icon at any time. In addition, the Do Script event is
422 supported (class
{\tt 'misc'
}, event
{\tt 'dosc'
}). This event takes a
423 direct parameter that is a string and interprets it as a lisp
424 expression. The expression is evaluated, the result is printed to a
425 string, and the string is returned as the direct parameter of the
426 result. For example, if you have the
{\tt Alpha
} shareware editor,
427 then from a Tcl shell window you can send an apple event to a running
428 \XLS\ process asking
\XLS\ to make a system beep sound:
430 Alpha
.5.55> dosc -c 'X1St' -s "(sysbeep)"
434 You can also send Apple events to processes on the same or on remote
435 computers using the function
\lfun{send-apple-event
}. At the moment
436 this function allows you to send events that contain parameters that
437 are strings, integers, or floating point numbers. If a result is
438 expected it should contain no required parameters or a required direct
439 parameter that can be coerced to a string. In particular, this allows
440 Do Script events to be sent to other
\XLS\ processes. The
441 \lfun{send-apple-event
} function has three required parameters, two
442 four-character strings specifying the event class and type, and an
443 address specifier for the event's receiver. The address can be
445 \item The symbol
\TRUE, which means the current application is the
447 \item A string representing a process name on the local computer.
448 \item An integer representing the signature code of a process on the
450 \item A process information record as returned by
451 \lfun{launch-application
} or by
\lfun{get-process-list
}.
452 \item A target specifier as returned by
453 \lfun{browse-apple-event-targets
} or by
454 \lfun{get-apple-event-target
}.
456 Several keyword arguments are also accepted:
458 \item \lkeyword{data
}: Either
\NIL, the default, or a string to be
459 used as the direct parameter of the event, or a list of lists. If a
460 list of lists is used, then the sublists must contain two items, a key
461 string identifying the parameter (such as
{\tt "----"
} for a direct
462 parameter) and the data item. Data items can be integers, floating
463 point numbers or strings.
464 \item \lkeyword{wait-reply
}: Wait for a reply if non-
\NIL, the default.
465 \item \lkeyword{timeout
}: The symbol
\TRUE\ for the default timeout
466 (about a minute), an integer for a specific value, or
\NIL\ for no timeout.
467 If not supplied, the default timeout is used.
468 \item \lkeyword{can-switch-layer
}: Whether or not the receiver should
469 be allowed to come to the front if it requires interaction.
473 (send-apple-event "aevt" "abou" "Finder")
475 sends the Finder an apple event asking it to present its
{\bf About
476 This Macintosh
} dialog box.
478 To locate a target on the local machine or a machine on the network
479 you can use the interactive
\lfun{browse-apple-event-targets
}
480 function. This function presents a dialog box that lists available
481 processes for all Macintoshes on a local network; if the local network
482 is connected to an internet the dialog also presents a list of
483 AppleTalk zones to choose from. Several keyword arguments are
484 available for controlling the appearance of the dialog:
486 \item \lkeyword{prompt
}: A prompt string to show at the top of the dialog.
487 \item \lkeyword{application-list-label
}: A string to show over the
489 \item \lkeyword{type
}: The connection type, which defaults to
{\tt
492 By default, all targets with suitable permissions are shown. The set
493 of targets can also be restricted with two additional keyword
496 \item \lkeyword{name
}: A string specifying the name of the application
497 to link to. Only applications with this name are shown.
498 \item \lkeyword{signature
}: An integer signature code. Only
499 applications with this signature are shown.
501 You can also locate applications to link to without using a dialog
502 box. The
\lfun{get-apple-event-target-list
} function returns a list
503 of all targets available on a particular machine. By default the local
504 machine is examined. Alternatives can be specified by keyword
507 \item \lkeyword{object
}: The name of a macintosh.
508 \item \lkeyword{type
}: The connection type, which defaults to
{\tt
510 \item \lkeyword{zone
}: An AppleTalk zone name.
512 The function
\lfun{get-apple-event-target
} returns a single target, or
513 \NIL\ if none is found. It requires one argument, an application name
514 string or signature code, and also accepts the same keyword arguments
515 as
\lfun{get-apple-event-target-list
}. If there are several possible
516 matches for the name or signature given, an arbitrary choice is
519 As an example, suppose an
\XLS\ process is running on another
520 Macintosh named
{\tt "Fred's Macintosh"
} and that all permissions are
521 suitably set. We can send a
{\tt sysbeep
} command to this Macintosh
524 (let* ((sig (encode-signature "X1St"))
525 (target (get-apple-event-target :object "Fred's Macintosh")))
527 (send-apple-event "misc" "dosc" target :data "(sysbeep)")))
529 If successful, the expression returns the string
{\tt "NIL"
}.
532 The support included for Apple events is rather minimal. The main
533 reason I have not yet made it more extensive is that I don't know
534 what kinds of events will be most useful for communicating with
535 other applications. If anyone has any ideas or would like to help
536 extending this, please let me know.
539 One problem that comes up on the Macintosh is the need to account for
540 the screen size. Currently a background bitmap the size and depth of
541 the primary screen is allocated within the partition. The size of this
544 \frac{\mbox{width
}\times\mbox{height
}\times\mbox{depth
}}{8}.
546 For a $
512\times320$ monochrome display this is fairly trivial, and a
547 3M partition should be adequate for most purposes (though this of
548 course depends on what is loaded). But for a $
1024\times1024$ display
549 using
32-bit
color, this is
4M. At the moment, this calculation needs
550 to be done manually and you need to make adjustments to your partition
551 accordingly. I will try to come up with a better solution in the
554 The
\lfun{open-file-dialog
} function now accepts a third optional
555 parameter for specifying the file types to show. If this parameter is
556 \NIL, all files are shown. If it is a string or a list of strings,
557 only files of the corresponding types are shown.The sefault is
{\tt
558 "TEXT"
}. At present,at most four types can be given; this limitation
559 will be removed in the future.
561 \subsection{Changes in the Microsoft Windows Version
}
562 The new standard version for Microsoft Windows now requires at least a
563 386 processor and Windows version
3.1. This version is still based on
564 16 bit windows and hence still has the same limitations on vector
565 sizes as previous versions. In addition, a Win32 version is now
566 available that removes some of these limitation.
568 In line with the use on Windows
3.1 as the base, accelerators for the
569 edit menu items in WXLS and in LSPEDIT have changed to the ones used
570 in the
3.1 accessories Write and Notepad:
{\em Ctrl-X
} for Cut,
{\em
571 Ctrl-C
} for Copy, etc.. The interrupt key combination is now
{\em
572 Ctrl-Break
}. The functions
\lfun{open-file-dialog
} and
573 \lfun{set-file-dialog
} now use the new standard Windows open and save
574 dialogs and also optionally set the working directory to the directory
575 containing the selected file.
577 The listener has been modified so that is can now hold a more
578 reasonable amount of text and should no longer run out of memory.
580 Modeless dialogs, such as slider dialogs, are now MDI clients rather
583 The need to set environment variables has been eliminated. Instead,
584 information about the location of startup files can now be placed in a
585 private initialization file,
{\tt wxls.ini
} for the
16-bit version and
586 {\tt wxls32.ini
} for the
32-bit version, in the Windows system
587 directory. This file can contain several variables in sections
{\tt
588 [Xlisp
]},
{\tt [Listener
]}, and
{\tt [Graphics
]}:
591 Section & Variables\\
593 {\tt [Xlisp
]} &
{\tt Libdir
},
{\tt Workspace
}\\
594 {\tt [Listener
]} &
{\tt Font
},
{\tt FontSize
}\\
595 {\tt [Graphics
]} &
{\tt Font
},
{\tt FontSize
},
{\tt Color
}\\
599 The
{\tt Libdir
} variable should be set to the directory containing
600 the executable and runtime files; this should be done at installation
601 time by loading
{\tt config.lsp
}. The
{\tt Workspace
} variable allows
602 an alternate initial workspace to be specified. Both can be overridden
603 on the command line by specifying
{\tt -d
} or
{\tt -w
} options,
604 respectively. The
{\tt Color
} variable can be used to turn
color use
605 off if allocating a
color background buffer would require too much
606 memory. As an example, a
{\tt wxls.ini
} file containing
611 Font="Courier New Bold"
616 specifies a library directory, a listener font, and turns
color off.
618 The initial workspace and the default directory can also be specified
619 on the commandline as
{\tt -w
}{\em file.wks
} and
{\tt -d
}{\em dir
},
622 A very minimal DDE interface is provided. The interface is very simple
623 and based on DDEML. As a server, WXLS allows to connections to the
624 topic
{\tt XLISP-STAT
} under the service name
{\tt XLISP-STAT
}. It
625 accepts two kinds of transactions:
627 \item Execute transactions in which the command is a sequence of lisp
628 expressions. The LSPEDIT application sends the current selection as
629 an execute transaction when the
{\bf Eval Selection
} menu item is
631 \item Request transactions or the item
{\tt VALUE
}. This returns a
632 string with a printed representation of the value returned by the
633 last expression in the most recent execute transaction of the
636 As a client, there are three functions you can use that correspond
637 fairly closely to their DDEML equivalents:
\lfun{dde-connect
},
638 \lfun{dde-disconnect
}, and
\lfun{dde-client-transaction
}.
640 \lfun{dde-connect
} takes two arguments, strings naming a service and
641 a topic. The topic string is optional; it defaults to the service
642 string. The return value is a descriptor of the conversation if the
643 connection is established, otherwise it is
\NIL. At the moment
644 conversation descriptors are integer indices into a table, and the
645 number of concurrent conversation is limited to
30. This may change.
647 \lfun{dde-disconnect
} takes a conversation descriptor and attempts to
648 close the conversation. If successful it returns
\TRUE, otherwise
\NIL.
649 If dde-disconnect is called with no arguments then all currently
650 active conversations are terminated. In this case the return value is
651 \TRUE\ if any are terminated,
\NIL\ if not.
653 \lfun{dde-client-transaction
} requires a conversation descriptor as
654 its first argument. The remaining arguments are keyword arguments:
656 \item \lkeyword{type
}: should be
\lkeyword{request
} or
657 \lkeyword{execute
}; default is
\lkeyword{execute
}.
658 \item \lkeyword{data
}: a string, currently only used by execute
660 \item \lkeyword{item
}: an item name string, currently only used by
661 request transactions.
662 \item \lkeyword{timeout
}: a positive integer specifying the timeout in
663 milliseconds. The default is
60000.
665 The return value is
\TRUE\ if the transaction is successful,
\NIL\ if
668 As an example, you could have WXLS communicate with WXLS by DDE (why
669 you would want to I do not know, but it works):
671 > (dde-connect "xlisp-stat")
673 > (dde-client-transaction
0 :data "(+
1 2)")
675 > (dde-client-transaction
0 :type :request :item "value")
680 You can also communicate with the program manager:
682 > (dde-connect "progman")
684 > (dde-client-transaction
0 :data "
[ShowGroup(Main,
1)
]")
686 > (dde-client-transaction
0 :type :request :item "Groups")
690 Microsoft C/C++
7.0\r
691 Software Development Kit
3.1\r
694 Borland C++
4.0 Online Books
\r
700 XLISP-STAT Programs
\r
705 The first transaction is an execute transaction that opens the Main
706 group's window. The second is a request that obtains a list of the
709 This DDE interface is experimental and may change. For the moment it
710 seems adequate for providing configuring the integration of WXLS
711 into Windows during setup.
714 The functions
\lfun{msw-get-profile-string
} and
715 \lfun{msw-write-profile-string
} can be used to access and modify user
716 preference information. They require three and four arguments,
717 respectively. The first and second arguments specify the section and
718 item names as strings, and the last argument specifies the preference
719 file name. A preference file name of
\NIL\ refers to the system
720 preference file. For
\lfun{msw-write-profile-string
} the third
721 argument is a new value. This can be a string or
\NIL; if it is
\NIL,
722 the entry is deleted. This function deletes a section if the item
725 The function
\lfun{msw-win-exec
} is a synonym for the
\lfun{system
}
726 function. On failure it now returns two values:
\NIL\ and a numerical
727 error code. The
\lfun{msw-win-help
} function has been modified to use
728 keyword symbols to identify help request types.
730 Both
16-bit and
32-bit versions can use DLL's, but only
16-bit and
731 32-bit DLL's, respectively.
733 \section{Improvements in Common Lisp Support
}
734 This section outlines changes in
\CL\ compatibility. The subsections
735 are numbered according to the chapters of Steele
\cite{CLtL2
}.
736 Detailed descriptions of standard functions and macros are given in
739 \subsection{Introduction
}
742 \subsection{Data Types
}
743 Vectors and arrays containing typed elements, such as fixnums or
744 floats, are now partially supported. This support will be completed in
747 Other new data types are hash tables and packages.
749 \subsection{Scope and Extent
}
750 \label{Subsection:Scope
}
751 The handling of
\lspec{block
}/
\lspec{return-from
} and
752 \lspec{tagbody
}/
\lspec{go
} has been fixed to give the block names and
753 go tags lexical scope, in compliance with the
\CL\ specification. In
754 the previous implementation they had dynamic scope.
756 \subsection{Type Specifiers
}
757 The
\lfun{typep
} function accepts specialized type specifications,
758 such as
{\tt (member
1 2 3)
} or
{\tt (vector t *)
}. New type names can
759 be defined using the
\lmac{deftype
} macro.
761 The function
\lfun{coerce
} has been modified to be more
\CL\
762 compliant. In particular, it is no longer possible to use it to coerce
763 an array to a list. The effect of the old coercion can be achieved
764 with the new
\lfun{array-to-nested-list
} function.
766 \subsection{Program Structure
}
767 Special variables are now available. Variables that have been
768 proclaimed special using the
\lfun{proclaim
} function or that were
769 defined using
\lmac{defvar
},
\lmac{defparameter
}, or
770 \lmac{defconstant
} are dynamically scoped in all uses. It is not
771 possible to declare variables special locally, but
\lmac{progv
} can be
772 used for making variables locally special.
774 The macro
\lmac{defvar
} now leaves unbound variable unbound if it is
775 not given a value argument.
777 Proper keyword argument handling is now possible; see Section
778 \ref{Subsection:Debugging
} for more details.
780 The special form
\lspec{eval-when
} for controlling time of evaluation
781 is now defined. It is defined in accordance with the revised
782 definition of Steele
\cite{CLtL2
}.
784 \subsection{Predicates
}
785 The
\lfun{functionp
} now follows the new specification in Steele
786 \cite{CLtL2
}. Only internal functions (
{\tt SUBR
}'s), byte compiled
787 functions, and function closures result in a non-
\NIL\ value. In
788 particular,
\NIL\ is returned for symbols and lambda expressions.
790 The function
\lfun{bit-vector-p
} has been added for compatibility with
791 some software; it always returns
\NIL.
793 The macros
\lmac{and
} and
\lmac{or
} now return multiple values if the
794 final expression does.
796 \subsection{Control Structure
}
797 As mentioned in Section
\ref{Subsection:Scope
}, block names and go
798 targets are now properly lexically scoped.
800 A number of functions, macros and special forms have been modified to
801 return multiple values when appropriate. These are
803 \begin{tabular
}{llllllll
}
826 \lspec{unwind-protect
} &
831 Functions can now be defined to return multiple values using the
832 \lfun{values
} function. If a function is defined as
834 (defun f (x y) (values x y))
836 then it returns two values:
842 Values beyond the first are ignored when the value of a function is
843 passed as an argument:
848 It is also possible to return no values; the implicit first value when
849 used as a function argument is
\NIL:
855 Returning no values is one way to suppress printing if no meaningful
856 value is returned; for example, the
\lfun{pprint
} function returns no
859 Several macros and special forms are available for capturing multiple
860 values. You can collect them in a list with
861 \lmac{multiple-value-list
},
863 > (multiple-value-list (f
1 2))
866 access one specific value by position with
\lmac{nth-value
},
868 > (nth-value
0 (f
1 2))
870 > (nth-value
1 (f
1 2))
872 > (nth-value
2 (f
1 2))
875 bind them to variables with
\lmac{multiple-value-bind
},
877 > (multiple-value-bind (a b) (f
1 2) (list b a))
880 or pass them as arguments to a function with
\lspec{multiple-value-call
},
882 > (multiple-value-call #'+ (f
1 2))
885 Multiple values can also be produced with
\lfun{values-list
} and
886 captured with
\lspec{multiple-value-prog1
} and
887 \lmac{multiple-value-setq
}.
889 The assignment macros
\lmac{psetf
} and
\lmac{rotatef
} and the macro
890 \lfun{typecase
} are now available.
892 The assignment macro
\lmac{setf
} has been re-implemented as a macro,
893 both in the interpreter and a compiler. The function
894 \lfun{get-setf-method
} has been added and is used both by
\lmac{setf
}
895 and by new versions of macros like
\lmac{push
} and
\lmac{incf
}. The
896 lmac
{setf
} macro should now work with place forms that use
899 The standard macro version of
\lmac{setf
} introduces a number of
900 temporary variables to avoid multiple evaluation of forms in a setf
901 expression. This can slow down interpreted code (it does not affect
902 compiled code since unnecessary bindings are optimized out). To
903 reduce the impact of this, the special variable
904 \lvarstar{simplify-setf
} can be set to a non
\NIL\ value. When this
905 variable is not
\NIL,
\lmac{setf
} substitutes the value expressions
906 for these variables. In principle this can cause multiple evaluation
907 of some subform, but it will not for any of the standard setf methods.
908 This behavior is equivalent to the behavior of the previous internal
909 version of
\lmac{setf
}. The setault value of
\lvarstar{simplify-setf
}
910 in the interpreter it
\TRUE. The compiler should set it to
\NIL, but
913 The function
\lfun{special-form-p
} has been added. It returns
\TRUE\
914 if its symbol argument has a global function binding that is of type
915 {\tt FSUBR
}; otherwise it returns
\NIL.
918 Macros can now be defined to use the
\llkey{environment
},
919 \llkey{whole
} and
\llkey{body
} lambda list keywords. The functions
920 \lfun{macroexpand
} and
\lfun{macroexpand-
1} accept an optional
921 environment argument, which should only be an environment captured
922 with an
\llkey{environment
} argument to a macro or an environment
923 passed to an evalhook function. Expansion is done using this
924 environment if supplied; otherwise, the null environment is used.
926 Macros allow destructuring in their required arguments, not in any
927 other arguments. The macro
\lmac{destructuring-bind
} is also
928 available. The
\llkey{whole
} lambda keyword may not be used in this
929 macro. Steele
\cite{CLtL2
} says it may, but I think this is an error.
931 The
\lmac{define-compiler-macro
} macro is available for defining
932 macros to be expanded only at compile time.
934 The function
\lfun{macro-function
} is available. Macros have been
935 modified to use a macro function of two arguments, the form to be
936 expanded and the environment.
\lfun{macro-function
} returns this
937 function when its symbol argument names a macro.
939 The functions
\lfun{variable-information
} and
940 \lfun{function-information
} for accessing environment information and
941 \lfun{augment-environment
} for changing environment information have
942 been added. The functions
\lfun{parse-macro
} and
\lfun{enclose
} are
945 A simple implementation of
\lspec{symbol-macrolet
} has been added. It
946 has not been extensively tested. It is currently not part of the
947 standard initial workspace but set up to be autoloaded when called.
948 Code using
\lspec{symbol-macrolet
} will be completely macro expanded,
949 which means some standard macros implemented as special forms in the
950 interpreter will be replaced by macros and expanded. The code may
951 therefore be a bit slow when interpreted, but speed of compiled code
954 \subsection{Declarations
}
955 The special form
\lspec{declare
} is available, but all declarations
956 are currently ignored by the interpreter and the compiler, including
957 special declarations.
959 It may be fairly easy to add proper handling of special declarations
960 to the byte code compiler, but adding it to the interpreter will cut
961 speed unless the code is rewritten in the spirit of macro
965 The function
\lfun{proclaim
} is available. Currently only special
966 proclamations have an effect. There is no portable way to take back a
967 special proclamation.
969 Macros for the special forms
\lspec{locally
} and
\lmac{the
} are
970 available. They currently ignore declaration and type information.
973 The functions
\lfun{keywordp
},
\lfun{gentemp
}, and
974 \lfun{get-properties
} have been added. The
\lfun{getf
} function has
975 been fixed to search for property identifiers only in even positions
976 in a property list, and the
\lsetf{getf
} form has been added. The
977 macro
\lmac{remf
} has also been added.
979 The function
\lfun{gensym
} has not yet been changed to follow the new
980 specification, but probably will be.
982 \subsection{Packages
}
983 \XL\ now uses the
\CL\ package system for name space management. The
984 functions
\lfun{apropos
},
\lfun{apropos-list
},
\lfun{intern
}, and
985 \lfun{unintern
} have been modified accordingly.
987 A package is a collection of symbols, with some symbols considered
988 internal and others external, or exported. The system is always ``in''
989 some package, the current package, which is the value of the variable
990 \lvarstar{package
}. Packages can ``use'' other packages. When in a
991 package, all symbols of that package, internal or external, and all
992 external symbols of other packages used by that package are considered
993 accessible. Accessible symbols can be referenced by their name and are
994 printed using only their name. Inaccessible symbols can still be
995 referenced and printed using a package name qualifier and a colon,
996 {\tt :
}, or double colon,
{\tt ::
} separator. An external symbol in a
997 package is referenced or printed as
999 \param{package
}:
\param{name
}
1001 and an internal symbol as
1003 \param{package
}::
\param{name
}
1005 Thus
{\tt foo:bar
} is the external symbol with name
{\tt "BAR"
} in the
1006 package named
{\tt "FOO"
}, and
{\tt foo::baz
} is the internal symbol
1007 with name
{\tt "BAZ"
} in the
{\tt "FOO"
} package.
1009 The default package is the package named
{\tt "USER"
}. This package
1010 has several nicknames that can be used to refer to it:
1012 > (package-nicknames "USER")
1013 ("CL-USER" "COMMON-LISP-USER")
1015 It uses the
{\tt "XLISP"
} package,
1017 (package-use-list "USER")
1019 > (package-nicknames "XLISP")
1020 ("CL" "COMMON-LISP" "LISP")
1022 Another standard package is the
{\tt "KEYWORD"
} package. Keywords are
1023 placed in this package as internal symbols and are made constants with
1024 values equal to themselves. Symbols in this package are always
1025 referenced and printed as a colon followed by the symbol name. So
{\tt
1026 :test
} is the symbol with name
{\tt "TEST"
} in the keyword package.
1028 Packages are usually constructed using the
\lmac{defpackage
} macro.
1029 The current package is usually set with the
\lmac{in-package
} macro.
1030 Both typically appear in a file, followed by some export commands. For
1031 example, a file containing the lines
1033 (defpackage "MYPACK" (:use "XLISP"))
1035 (in-package "MYPACK")
1044 constructs a new package
{\tt "MYPACK"
} with external symbols
{\tt a
}
1045 and
{\tt b
} and internal symbols
{\tt c
} and
{\tt d
}. It is not
1046 necessary to save and restore the old package since the
\lfun{load
}
1047 function restores the current package to the value it had before the
1050 When a package other than the
{\tt "USER"
} package is the current
1051 package, the standard listener top level loop adds the package name to
1054 > (in-package "XLISP"")
1056 XLISP> (in-package "USER")
1061 Other functions and macros to support the use of packages are
1063 \begin{tabular
}{llll
}
1064 \lfun{delete-package
} &
1065 \lfun{do-all-symbols
} &
1066 \lmac{do-external-symbols
} &
1067 \lmac{do-symbols
} \\
1068 \lfun{find-all-symbols
} &
1069 \lfun{find-package
} &
1070 \lfun{find-symbol
} &
1072 \lfun{list-all-packages
} &
1073 \lfun{make-package
} &
1074 \lfun{package-name
} &
1075 \lfun{package-shadowing-symbols
} \\
1076 \lfun{package-used-by-list
} &
1077 \lfun{package-valid-p
} &
1079 \lfun{rename-package
} \\
1081 \lfun{shadowing-import
} &
1082 \lfun{symbol-package
} &
1084 \lfun{unuse-package
} &
1090 Details of the assignment of system and statistical symbols to
1091 packages and of package naming are likely to change in the near
1092 future and should not be relied upon.
1095 \subsection{Numbers
}
1096 The functions
\lfun{ceiling
},
\lfun{floor
},
\lfun{round
}, and
1097 \lfun{truncate
} now return two values in accordance with the
\CL\
1098 specification. The second value is the remainder of the operation.
1100 The vectorized version only returns one value for a compound
1101 argument. This is consistent with the idea that the vectorization
1102 can be defined with a mapping function. It is not clear whether this
1103 is the right decision, and it may change.
1106 The functions
\lfun{make-random-state
} and
\lfun{random-state-p
} have
1107 been changed to use new random number generators; see Section
1108 \ref{Subsection:Random
}
1110 The following vectorized arithmetic functions have been added:
1112 \begin{tabular
}{llllllllll
}
1125 The macros
\lmac{decf
} and
\lmac{incf
} have also been added.
1127 \subsection{Characters
}
1128 The function
\lfun{alpha-char-p
} has been added.
1130 \subsection{Sequences
}
1131 Sequence functions have been improved and expanded. The following
1132 functions have been modified to operate on lists and all vector types,
1135 \begin{tabular
}{llllllll
}
1136 \lfun{concatenate
} &
1148 \lfun{remove-duplicates
} &
1152 The following functions have been added:
1154 \begin{tabular
}{llllll
}
1156 \lfun{count-if-not
} &
1157 \lfun{delete-duplicates
} &
1160 \lfun{find-if-not
} \\
1163 \lfun{position-if
} &
1164 \lfun{position-if-not
} &
1169 Most keyword arguments specified in Steele
\cite{CLtL2
} are supported,
1170 except that not all functions that should support the
1171 \lkeyword{from-end
} keyword yet.
1173 The
\lfun{complement
} function for negating a predicate has been added.
1176 The functions
\lfun{mapcan
} and
\lfun{mapcon
} are now functions
1179 The following list functions have been added:
1181 \begin{tabular
}{lllll
}
1184 \lfun{list-length
} &
1186 \lfun{nintersection
} \\
1188 \lfun{nset-difference
} &
1189 \lfun{nset-exclusive-or
} &
1193 \lfun{nsubst-if-not
} &
1196 \lfun{set-exclusive-or
} \\
1205 Setf forms for the positional accessors
\lfun{fifth
},
\ldots,
1206 \lfun{tenth
} have also been added.
1208 The macro
\lmac{pop
} is now available.
1210 \subsection{Hash Tables
}
1211 Hash tables are now provided, with the interface functions
1213 \begin{tabular
}{llll
}
1216 \lfun{hash-table-count
} &
1217 \lfun{hash-table-p
} \\
1218 \lfun{hash-table-rehash-size
} &
1219 \lfun{hash-table-rehash-threshold
} &
1220 \lfun{hash-table-size
} &
1221 \lfun{hash-table-test
} \\
1222 \lfun{make-hash-table
} &
1227 Any test predicate is allowed, but the standard ones,
\lfun{eq
},
1228 \lfun{eql
}, and
\lfun{equal
} have internal implementations that should
1229 make them reasonably fast.
1232 Arrays can now be restricted to certain element types. This allows for
1233 more compact storage of arrays of specialized types. The standard
1234 element types supported are
1236 \begin{tabular
}{llllll
}
1240 \ltypelist{complex fixnum
} &
1241 \ltypelist{complex float
}
1244 In addition, the following nonstandard types are supported for
1245 communicating with C programs:
1247 \begin{tabular
}{llllll
}
1255 \ltype{c-dcomplex
} &
1258 Other types are considered equivalent to
{\tt t
}.
1260 The
\lfun{array-element-type
} function returns the element type of an
1261 array, The
\lkeyword{element-type
} keyword can be used with
1262 \lfun{make-array
} to construct an array of the specified type.
1265 The support for typed vectors is not yet complete. It is more or
1266 less complete for the basic
\XL\ system, but has not yet been
1267 completely integrated in the statistical code. Eventually the linear
1268 algebra routines and the foreign function interface will be changed
1269 to rely on these routines in order to minimize conversion to and
1270 from C data. The details of the supported types may need to be
1271 changed as this evolves.
1274 The functions
\lfun{row-major-aref
} and
\lfun{svref
} have been added.
1277 At present, vectors with fill pointers and adjustable arrays are not
1278 supported. One or both may be added.
1281 \subsection{Strings
}
1282 The functions
\lfun{nstring-capitalize
},
\lfun{schar
},
1283 \lfun{string-capitalize
}, and
\lfun{string-search
} have been added.
1285 \subsection{Structures
}
1286 The
\lmac{defstruct
} macro allows constructor, predicate and print
1287 functions to be specified. Inheritance of other structures through the
1288 \lfun{include
} keyword is supported, and produces proper subtype
1289 relationships. BOA constructors are not supported.
1291 \subsection{The Evaluator
}
1292 The
\lfun{applyhook
} function and the
\lvarstar{applyhook
} variable
1293 are now available. Both
\lfun{eval
} and
\lfun{evalhook
} now use the
1294 null lexical environment for evaluation.
1296 \subsection{Streams
}
1297 The
\lfun{force-output
} function now allows arbitrary stream
1298 arguments. Simple versions of
\lfun{clear-output
} and
1299 \lfun{finish-output
} are now available. The functions
1300 \lfun{fresh-line
} and the corresponding format directive are now
1301 available. The functions
\lfun{input-stream-p
},
\lfun{open-stream-p
},
1302 \lfun{output-stream-p
}, and the macro
\lmac{with-open-stream
} have
1305 \subsection{Input/Output
}
1306 Printing of floating point numbers by the
\lfun{print
} function now
1307 follows the
\CL\ standard. This means floating point numbers always
1308 contain a decimal point and are generally printed with around
18
1309 digits on a system with
64-bit double precision floating point
1310 numbers. This insures that printed numbers can be read back in to
1311 produce essentially identical values (slightly more digits would be
1312 needed to insure absolute equality).
1314 This change may produce output that some find to unreadable. It
1315 would be good to be able to control the number of digits used for
1316 floating point printing. At present there is a back door mechanism:
1317 the variable
\lvarstar{float-format
} can be set to a C format
1318 string, which will then be used. The old printing approach is
1319 equivalent to setting this variable to
{\tt "\%g"
}. I do not know
1320 how to implement such an option portably in
\CL\ and I am not sure
1321 how important it is, since all model summaries and things like
1322 \lfun{print-matrix
} use
\lfun{format
}. If this turns out to be
1323 useful and important, I will change the mechanism to use a
\CL\
1324 format string instead of a C one.
1327 Several new print and read control variables are now used. These are
1329 \begin{tabular
}{lll
}
1330 \lvarstar{print-array
} &
1331 \lvarstar{print-case
} &
1332 \lvarstar{print-circle
} \\
1333 \lvarstar{print-escape
} &
1334 \lvarstar{print-gensym
} &
1335 \lvarstar{print-length
} \\
1336 \lvarstar{print-level
} &
1337 \lvarstar{print-readably
} &
1338 \lvarstar{read-suppress
}
1341 Two nonstandard variables are also used. If
1342 \lvarstar{print-symbol-package
} is non-
\NIL, all symbols are printed
1343 with package qualifiers. The variable
\lvarstar{readtable-case
} can be
1344 used to set the case of the readtable.
1346 The readtable case should be part of the readtable; this will
1347 probably be changed to comply with
\CL.
1350 The functions
\lfun{read
},
\lfun{read-char
},
\lfun{read-byte
}, and
1351 \lfun{read-line
} now support
{\tt eof-error-p
} arguments.
1353 The reader now uses the keyword package as the default package while
1354 processing a features expression specified with the
{\tt \#+
} or
{\tt
1355 \#-
} read macros. This means that
{\tt \#+fred
} and
{\tt \#+:fred
}
1356 are equivalent. The standard symbols in the
\lvarstar{features
} list
1357 have been changed to keyword symbols.
1359 The
\lfun{format
} function has been changed to handle the
\lfmtdir{E
},
1360 \lfmtdir{F
}, and
\lfmtdir{G
} directives in accordance with the
\CL\
1361 specification. A number of format directives have been added. The new
1362 format directives are
1365 \lfmtdir{O
},
\lfmtdir{X
} & octal and hexadecimal output\\
1366 \lfmtdir{\&
} & fresh line\\
1367 \lfmtdir{T
} & tabulate\\
1368 \lfmtdir{(
},
\lfmtdir{)
} & case conversion\\
1369 \lfmtdir{*
} & argument skipping\\
1370 \lfmtdir{?
} & indirection\\
1371 \lfmtdir{[},
\lfmtdir{;
},
\lfmtdir{]} & conditional expression\\
1372 \lfmtdir{\
{},
\lfmtdir{\
}} & iteration\\
1373 \lfmtdir{|
} & page separator
1377 Very minimal implementations of the following functions have been added:
1379 \begin{tabular
}{llll
}
1382 \lfun{write-string
} &
1383 \lfun{write-to-string
} \\
1384 \lfun{parse-integer
} &
1385 \lfun{prin1-to-string
} &
1386 \lfun{princ-to-string
} &
1388 \lfun{read-from-string
} &
1392 \subsection{File System interface
}
1393 The functions
\lfun{delete-file
},
\lfun{file-length
},
1394 \lfun{probe-file
},
\lfun{truename
},
\lfun{rename-file
}, and
\lfun{file-write-date
} have been added.
1396 There is no separate pathname type; pathnames are currently just
1397 strings. Minimal versions of the following pathname functions have
1400 \begin{tabular
}{llll
}
1401 \lfun{make-pathname
} &
1402 \lfun{merge-pathnames
} &
1404 \lfun{parse-namestring
} \\
1406 \lfun{pathname-device
} &
1407 \lfun{pathname-directory
} &
1408 \lfun{pathname-host
} \\
1409 \lfun{pathname-name
} &
1410 \lfun{pathname-type
} &
1411 \lfun{pathname-version
}
1414 The variable
\lvarstar{default-pathname-defaults
} is used for default
1418 Error handling now uses the condition system; see Section
1419 \ref{Subsection:Conditions
} for details.
1421 \subsection{Miscellaneous Features
}
1422 The
\lfun{step
} function has been replaced by a new implementation.
1423 Details are given in Appendix
\ref{Appendix:Stepper
}.
1425 The standard function
\lfun{function-lambda-expression
} replaces
1426 \lfun{get-lambda-expression
}.
1428 A very rudimentary
\lfun{describe
} functions is available; it will be
1429 improved in the future.
1431 A byte code compiler for
\XL\ is included in Release
3. For code that
1432 spend much time in tight loops, the compiler can lead to significant
1435 The interface to the compiler is through two functions,
\lfun{compile
}
1436 and
\lfun{compile-file
}. Suppose
{\tt f
} is defined as
1438 (defun f (x) (+ x
1))
1443 #<Closure-F: #c6741c>
1447 #<Byte-Code-Closure: #c73644>
1450 \lfun{compile
} can also be used to compile a lambda expression:
1452 > (compile nil '(lambda (x) (+ x
1)))
1453 #<Byte-Code-Closure: #d77350>
1456 The function
\lfun{compile-file
} takes a file name string as its
1457 required argument. If the file has no extension, a
{\tt .lsp
}
1458 extension is added. It compiles the file into a file with a
{\tt .fsl
}
1459 extension. When
\lfun{load
} is given a string
{\tt "fred"
} as its
1460 argument, it first looks for
{\tt "fred.fsl"
} and then for
{\tt
1461 "fred.lsp"
}. If both are present, the
{\tt .fsl
} files is used if it
1462 is newer than the
{\tt .lsp
} file; otherwise the
{\tt .lsp
} file is
1466 Currently the compiler ignores all declarations, including special
1467 declarations, and all proclamations other than special ones. Future
1468 versions will use inline and optimize declarations to choose among
1469 code generation strategies.
1472 The
{\tt .fsl
} files produced by the compiler contain ordinary lisp
1473 expressions that are read in by the reader. Constants are printed out
1474 with
\lvarstar{print-circle
} and
\lvarstar{print-readably
} turned on.
1475 This should be sufficient, but if things get confused by a lot of
1476 messing with packages, it may help to also turn on
1477 \lvarstar{print-symbol-package
}. This can be done by supplying the
1478 \lkeyword{print-symbol-package
} keyword argument to
1479 \lfun{compile-file
} with a non-
\NIL\ value.
1481 The function
\lfun{compiled-function-p
} returns true for internal
1482 compiled functions (
{\tt SUBR
}'s) or byte compiled functions.
1484 The compiler is based on CPS conversion (see, for example, Friedman,
1485 Wand and Haynes
\cite{FriedmanWandHaynes92
}). The design is based on
1486 the
{\em ORBIT
}\/ compiler as described in Krantz et
1487 al.~
\cite{KrantzEtAl86
} and on Brooks, Gabriel and Steele
1488 \cite{BrooksGabrielSteele82
}.
1490 At this point the compiler does not do anything special for
1491 vectorized arithmetic or anything else statistical. In the future I
1492 will explore adding optimizations designed to deal with problems
1493 specific to statistical usage. The basic design should make this
1498 No changes -- not implemented. The subset of loop from Peter Norvig's
1499 \cite{Norvig92
} book should work with at most minor modifications.
1501 \subsection{Pretty Print
}
1502 No changes -- not implemented. The XP pretty pringing package from the
1503 CMU lisp archives can be made to work with minor modifications.
1506 No changes -- not implemented. The closette subset of CLOS from the
1507 AMOP book can be made to work with minor modifications.
1509 \subsection{Conditions
}
1510 \label{Subsection:Conditions
}
1511 \XLS\ now uses an implementation of the
\CL\ condition system for
1512 error handling. The functions
\lfun{error
},
\lfun{cerror
},
1513 \lfun{warn
}, and
\lfun{signal
} signal errors, continuable errors,
1514 warnings, or general conditions, respectively.
1516 The macro
\lmac{ignore-errors
} takes an expression argument and
1517 returns either the values of that expression in the current environment
1518 if there is no error, or the values
\NIL\ and the error condition
1521 > (ignore-errors (values
1 2))
1524 > (ignore-errors (error ``an error''))
1526 #<Condition SIMPLE-ERROR:
13023072>
1529 The macros
\lfun{assert
} and
\lfun{check-type
} for type and predicate
1530 checking and the macros
\lfun{ccase
},
\lfun{ctypecase
} signal
1531 continuable errors. The macros
\lmac{check-type
},
\lmac{ccase
},
1532 \lmac{ctypecase
},
\lfun{ecase
}, and
\lfun{etypecase
} signal errors of
1533 type
\lerrtype{type-error
}.
1535 At this point the implementations of these macros are bare bones and
1536 may not actually provide continuable errors or the right error type
1537 but that should be changed soon.
1540 Conditions handlers are set up and used with the functions and macros
1542 \begin{tabular
}{lll
}
1543 \lmac{define-condition
} &
1544 \lfun{make-condition
} &
1545 \lmac{handler-bind
} \\
1546 \lmac{handler-case
} &
1547 \lmac{with-condition-restarts
}
1551 Restarts can be manipulated using the following functions and macros:
1553 \begin{tabular
}{llll
}
1554 \lfun{compute-restarts
} &
1555 \lfun{find-restart
} &
1556 \lfun{invoke-restart
} &
1557 \lfun{invoke-restart-interactively
} \\
1558 \lfun{muffle-warning
} &
1559 \lfun{restart-bind
} &
1560 \lfun{restart-case
} &
1561 \lfun{restart-name
} \\
1562 \lfun{store-value
} &
1564 \lfun{with-simple-restart
}
1568 The function
\lfun{invoke-debugger
} provides a low level interface to
1571 All standard predefined condition types are implemented, including the
1575 \lfun{cell-error-name
} &
1576 \lfun{simple-condition-format-arguments
} \\
1577 \lfun{simple-condition-format-string
} &
1578 \lfun{type-error-datum
} \\
1579 \lfun{type-error-expected-type
} &
1582 Conditions are currently implemented as structures and therefore do
1583 not support multiple inheritance.
1585 For the most part internal errors still signal errors of type
1586 \lerrtype{simple-error
}. This will be changed eventually. One
1587 exception is unbound variable and unbound function errors -- these
1588 are already of types
\lerrtype{unbound-variable
} and
1589 \lerrtype{unbound-function
}, respectively. This may eventually be
1590 used to define a more sophisticated autoload facility.
1594 Currently stack overflow errors are not signalled at the system
1595 state where they occur, because trying to handle them without any
1596 stack space would lead to an infinite error recursion. Instead they
1597 are signaled from the most recent
\lmac{handler-bind
}, in such a way
1598 as to insure that a stack overflow in a handler is caught in the
1599 next most recent one.
1601 In the future, I will try to generate low stack errors that allow a
1602 limited amount of exploring the system state before a real overflow
1603 occurs. I think this can be done fairly easily without a performance
1604 penalty, but I'm not sure yet.
1608 \section{Changes in the Statistical System
}
1609 \subsection{New Random Number Generators
}
1610 \label{Subsection:Random
}
1611 Three new generators in addition to the original lagged Fibonacci
1612 generator are now available. The generators are identified by an
1615 \item[0] The original XLISP-STAT generator, Marsaglia's portable
1616 generator from CMLIB. This is a lagged Fibonacci generator.
1617 \item[1] L'Ecuyer's
\cite{LEcuyer86
} version of the Wichmann-Hill
1618 \cite{WichmannHill82
} generator, also used in Bratley, Fox and
1619 Schrage,
\cite[program UNIFL
]{BratleyFoxSchrage
}.
1620 \item[2] Marsaglia's Super-Duper, as used in
{\em S
}.
1621 \item[3] Combined Tausworthe generator of Tezuka and L'Ecuyer
1622 \cite{TezukaLEcuyer91
}.
1624 The default generator is generator
1. Generator
0 has a period of
1625 $
2^
{32}$. All three new generators have periods on the order of
1628 Random states are now printed as
1631 #$(
1 #(
2147483562 0 11716 54063))
1633 The function
\lfun{make-random-state
} produces a new seed from the
1634 current generator when called with the argument
{\tt t
}. An
1635 alternate generator can be specified by supplying an appropriate
1636 integer as a second argument:
1638 > (make-random-state t)
1639 #$(
1 #(
2147483562 0 11716 54088))
1640 > (make-random-state t
2)
1641 #$(
2 #(
2147483647 0 0 11715 0 54105))
1644 When
\lfun{make-random-state
} is called with an old state vector, a new
1645 state for generator
0 is returned.
1647 \subsection{Changes in the Object System
}
1648 The object system now uses a method cache that should significantly
1649 improve dispatch for methods in deep object hierarchies.
1651 To help with compilation, the way in which the current object is
1652 passed to functions
\lfun{slot-value
},
\lfun{call-next-method
} and
1653 \lfun{call-next-method
} has changed. These functions should only be
1654 called in the dynamic extent of a method call. Their use outside of
1655 this scope, for example in a function closure returned by a method, is
1658 The current implementation uses a dynamic binding to store the
1659 current object. This works, but makes tail recursion optimization on
1660 methods impossible. I may need to make a major change in which
1661 things like
\lfun{slot-value
} and
\lfun{call-next-method
} become
1662 macros. The main implication of this is that
{\tt (apply
1663 \#'call-next-method ...)
} constructs won't work and will have to
1664 be handled by something like an
{\tt apply-next-method
} macro. Since
1665 this is likely to break a fair bit of code I will think about it
1666 before doing it, but at this point a change along these lines look
1670 A more substantial revision of the object system may occur soon in
1671 which the current system remains more or less unchanged but becomes
1672 just one possible system among many supported by a metaobject
1673 protocol. This should allow experimentation with variations in the
1674 object system that might be helpful.
1677 \subsubsection{Changes in the Linear Algera System
}
1678 Substantial internal changes have been mad in the linear algebra
1679 system. These should result in improved performance in fitting large
1680 regression and generalized linear models.
1682 The overall plan is to eliminate allocation of data structures at the
1683 internal C level. Instead, data structures for efficient linear
1684 algebra computations are allocated at the Lisp level as typed arrays.
1685 These are operated on by low level functions, which in many cases are
1686 simple front ends to LINPACK or BLAS routines. Standard functions,
1687 such as
\lfun{qr-decomp
} are built as Lisp-level wrappers around these
1688 lower level routines. Once the lower level is cleaned up it will be
1689 documented so that users have the option of managing their own
1690 allocation and directly using the low level routines.
1693 \subsection{Other Changes
}
1694 The generalized linear model system is now part of the standard
1695 distribution. The
{\tt :display
} methods for all model objects and
1696 the
\lfun{print-matrix
} function have been changed to use the new
1697 \lfmtdir{G
} format implementation.
1699 At the moment the number of digits printed is fixed at
6. I may make
1700 this a user-settable option.
1703 The function
\lfun{eigen
} is now based on the EISPACK
{\tt rs
}
1706 The function
\lfun{reset-system
} can be used to reset the state of
1707 various internal system parameters. If you write your own top level
1708 loop, you can call this when your loop is restarted if it looks like
1711 The need for this function is not quite clear yet -- it may be dropped.
1714 The function
\lfun{system-has-windows
} returns non-
\NIL\ if a window
1715 system is available at runtime. This should be used on UNIX systems
1716 rather than a readtime method, such as
{\tt \#+windows
}.
1718 \section{Deleted Functions
}
1719 The function
\lfun{load-help
} and the
\XWIN\ support function
1720 \lfun{make-fake-menu-bar
} are no longer generally available. Their
1721 symbols are internal to the XLISP package.
1724 The assignment of internal symbols to packages is likely to change in
1725 the near future and should not be relied upon.
1728 The functions
\lfun{get-lambda-expression
},
\lfun{num-to-string
}, and
1729 \lfun{strcat
} have been removed since similar
\CL\ functions are
1730 available. You should use
\lfun{function-lambda-expression
},
1731 \lfun{prin1-to-string
} and
\lfun{concatenate
} instead.
1734 \section{The Step Function
}
1735 \label{Appendix:Stepper
}
1737 This is a slightly modified version of the file
{\tt stepper.doc
}
1738 from the
\TAXL\ distribution.
1741 The new step debugger, written by Ray Comas (
{\tt comas@math.lsa.umich.edu
})
1742 and modified by Tom Almy, was inspired by the
{\tt step.lsp
} stepper
1743 included with
\XL\
2.1, originally written by Jonathan Engdahl (
{\tt
1744 jengdahl
} on
{\em BIX
}). This version has the ability to set/reset
1745 breakpoints, and a few bells and whistles.
1747 To invoke the stepper:
1749 (step (form with args))
1751 The stepper will stop and print every form, then wait for user input.
1752 Forms are printed compressed, i.e. to a depth and length of
3. This
1753 may be changed by assigning the desired depth and length values to
1754 \lvarstar{stepper-depth
} and
\lvarstar{stepper-length
} before invoking the
1755 stepper, or from within the stepper via the
{\tt .
} and
{\tt \#
}
1758 For example, suppose you have the following defined:
1761 (if (or (eql n
1) (eql n
2))
1763 (+ (fib (- n
2)) (fib (- n
1)))))
1765 Then
{\tt (step (fib
4))
} will produce the following:
1768 1 >==> (if (or (eql n
1) (eql n
2))
1 ...) :
1770 The colon is the stepper's prompt. For a list of commands, type
{\tt h
}.
1775 n or space - next form
1776 s or <cr> - step over form
1777 f FUNCTION - go until FUNCTION is called
1778 b FUNCTION - set breakpoint at FUNCTION
1779 b <list> - set breakpoint at each function in list
1780 c FUNCTION - clear breakpoint at FUNCTION
1781 c <list> - clear breakpoint at each function in list
1782 c *all* - clear all breakpoints
1783 g - go until a breakpoint is reached
1784 u - go up; continue until enclosing form is done
1785 w - where am I? -- backtrace
1786 t - toggle trace on/off
1787 q - quit stepper, continue execution
1788 p - pretty-print current form (uncompressed)
1789 e - print environment
1790 x <expr> - execute expression in current environment
1791 r <expr> - execute and return expression
1792 # nn - set print depth to nn
1793 . nn - set print length to nn
1794 h - print this summary
1796 Breakpoints may be set with the
{\tt b
} command. You may set
1797 breakpoints at one function, e.g.
\verb|b FOO<cr>| sets a breakpoint
1798 at the function
{\tt FOO
}, or at various functions at once, e.g.
1799 \verb|b (FOO FIE FUM)<cr>| sets breakpoints at the functions
{\tt
1800 FOO
},
{\tt FIE
}, and
{\tt FUM
}. Breakpoints are cleared with the
1801 {\tt c
} command in an analogous way. Furthermore, a special form of
1802 the
{\tt c
} command,
\verb|c *all* <cr>|, clears all previously set
1803 breakpoints. Breakpoints are remembered from one invocation of step
1804 to the next, so it is only necessary to set them once in a debugging
1807 The
{\tt g
} command causes execution to proceed until a breakpoint is
1808 reached, at which time more stepper commands can be entered.
1810 The
{\tt f
} command sets a temporary breakpoint at one function, and
1811 causes execution to proceed until that function is called.
1813 The
{\tt u
} command continues execution until the form enclosing the
1814 current form is done, then re-enters the stepper.
1816 The
{\tt w
} command prints a back trace.
1818 The
{\tt q
} command quits and causes execution to continue
1821 Entry and exit to functions are traced after a
{\tt g
},
{\tt f
},
{\tt
1822 u
}, or
{\tt q
} command. To turn off tracing, use the
{\tt t
}
1823 command which toggles the trace on/off. Also, with trace off, the
1824 values of function parameters are not printed.
1826 The
{\tt s
} command causes the current form to be evaluated.
1828 The
{\tt n
} command steps into the current form.
1830 The
{\tt .
} and
{\tt \#
} commands change the compression of displayed
1831 forms. E.g. in the previous example:
1833 1 >==> (if (or (eql n
1) (eql n
2))
1 ...) : .
2
1834 1 >==> (if (or (eql n ...) ...) ...) :
1836 changes the print length to
2, and
1838 1 >==> (if (or (eql n ...) ...) ...) : #
2
1839 1 >==> (if (or #\# ...) ...) :
1841 changes the print depth to
2.
1843 To print the entire form use the
{\tt p
} command, which pretty-prints
1846 The
{\tt e
} command causes the current environment to be printed;
1848 The
{\tt x
} command causes an expression to be executed in the current
1849 environment. Note that this permits the user to alter values while
1850 the program is running, and may affect execution of the program.
1852 The
{\tt r
} command causes the value of the given expression to be
1853 returned, i.e. makes it the return value of the current form.
1856 The stepper will not produce proper printout for
\lspec{go
} if the
1857 jump is outside the most enclosing
\lspec{tagbody
}, and the tag
1858 arguments of
\lspec{catch
}/
\lspec{throw
} must either be symbols or
1859 quoted symbols. No attempt is made here to correctly handle tracing
1860 of
\lspec{unwind-protect
}, either.
1863 \begin{thebibliography
}{99}
1864 \bibitem{BratleyFoxSchrage
}
1865 {\sc Bratley, P., Fox, B.~L., and Schrage, L.~E.
} (
1987),
{\em A
1866 Guide to Simulation\/
} (
2nd ed.), New York, NY: Springer-Verlag.
1867 \bibitem{BrooksGabrielSteele82
}
1868 {\sc Brooks, R.~A., Gabriel, R.~P, and Steele, G.~L.
} (
1982), ``An
1869 optimizing compiler for lexically scoped LISP,''
{\em Proc. Symp.
1870 on Compiler Construction, ACM SIGPLAN Notices
} 17,
6,
261--
275.
1871 \bibitem{FriedmanWandHaynes92
}
1872 {\sc Friedman, D.~P, Wand, M. and Haynes, C.~T.
} (
1992),
{\em
1873 Essentials of Programming Languages
}, Cambridge, MA: MIT Press.
1874 \bibitem{KrantzEtAl86
}
1875 {\sc Krantz, D.~A., Kelsey, R., Rees, J.~A., Hudak, P., Philbin, J.,
1876 and Adams, N.~I.
} (
1986), ``Orbit: An optimizing compiler for
1877 Scheme,''
{\em Proc. SIGPLAN '
86 Symp. on Compiler Construction,
1878 SIGPLAN Notices
} 21,
7,
219--
223.
1880 {\sc L'Ecuyer, P.
} (
1986), ``Efficient and portable combined random
1881 number generators,''
{\em Communications of the ACM
}\/
31,
742--
749.
1883 {\sc Norvig, P.
} (
1992),
{\em Paradigms of Artificial Intelligence
1884 Programming: Case Studies in Common Lisp
}, San Mateo, CA: Morgan
1887 {\sc Steele, Guy L.
} (
1990),
{\em Common Lisp: The Language
},
1888 second edition, Bedford, MA: Digital Press.
1889 \bibitem{TezukaLEcuyer91
}
1890 {\sc Tezuka, S. and L'Ecuyer, P.
} (
1991), ``Efficient and port\-able
1891 combined Tauseworthe random number generators,''
{\em ACM
1892 Transactions on Modeling and Computer Simulation
}\/
1,
99-
112.
1893 \bibitem{WichmannHill82
}
1894 {\sc Wichmann, B.~A. and Hill, I.~D.
} (
1982) ``An efficient and
1895 portable pseudo-random number generator,'' (Corr: V33 p123),
{\em
1896 Applied Statistics
}\/
31,
188--
190.
1897 \end{thebibliography
}
1907 %SET-SYMBOL-FUNCTION
1912 CPS-ANY-REFERENCES-P
1914 CPS-CALL-NODE-FUNCTION
1917 CPS-LAMBDA-NODE-ARGLIST
1918 CPS-LAMBDA-NODE-BODY
1919 CPS-LAMBDA-NODE-LAMBDA-LIST
1920 CPS-LAMBDA-NODE-NAME
1929 CPS-NODE-SIMPLIFIED-P
1931 CPS-SET-LAMBDA-NODE-ARGLIST
1932 CPS-SET-LAMBDA-NODE-LAMBDA-LIST
1933 CPS-SET-LAMBDA-NODE-NAME
1934 CPS-SET-LEAF-NODE-COUNT
1935 CPS-SET-LEAF-NODE-VALUE
1936 CPS-SET-NODE-CHILDREN
1939 CPS-SET-NODE-SIMPLIFIED
1945 GET-INTERNAL-GC-TIME & New\\
1946 GET-LAMBDA-NAME & New?\\
1948 STACK-VALUE & New \\