Similarly, pressing Control-C in Lisp halts whatever is presently running and returns you to the command line.Īfter you press Control-C, the command line changes to a "subsidiary" command line to reflect that you are in a break or error condition. Pressing Control-C in a Unix shell or at a DOS prompt halts the current running process and returns you to the command line. Think of the Lisp command line like the command line in a Unix shell or at a DOS prompt. Here are the command lines in Lispworks and in clisp. Lisp has a command line where you type in things to execute. In the previous examples, the very last line is the command line. +- ooooo 8oooooo ooo8ooo ooooo 8Ĭopyright (c) Bruno Haible, Michael Stoll 1992, 1993Ĭopyright (c) Bruno Haible, Marcus Daniels 1994-1997Ĭopyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998Ĭopyright (c) Bruno Haible, Sam Steingold 1999-2000Ĭopyright (c) Sam Steingold, Bruno Haible 2001-2010 I i i i i i i ooooo o ooooooo ooooo ooooo Loading text file /usr/local/lispworks_6.1/lib/6-1-0-0/private-patches/load.lisp Loading text file /usr/local/lispworks_6.1/lib/6-1-0-0/config/siteinit.lisp LispWorks(R): The Common Lisp Programming EnvironmentĬopyright (C) 1987-2011 LispWorks Ltd. It is mostly in the public domain some portions are provided underīSD-style licenses. SBCL is free software, provided as is, with absolutely no warranty. More information about SBCL is available at. This is SBCL 1.2.12, an implementation of ANSI Common Lisp. This fires up an implementation of lisp called CLISP. On zeus, you start lisp by typing clisp at the command line. ![]() This fires up an implementation of lisp called LispWorks. On osf1 or mason2, you start lisp by typing lisp at the command line. SBCL is a very popular one, and you start it (typically) by typing sbcl on the command line. On your laptop you have several options for running Lisp. If the cell is divided by a line, as is shown at right, then this indicates two different examples. Text shown in red are remarks - do not type them. Text shown in black indicates stuff that is printed back to you. Text shown in blue you are responsible for typing, with a Return at the end of the line. The table cell to the right shows what you type, and the output, for this tutorial. Notably this tutorial does not teach macros, CLOS, the condition system, much about packages and symbols, or very much I/O. The goal of this tutorial is not to teach you many of those powerful features: rather it's to teach you just enough of Lisp that you can get up and coding quickly if you have a previous background in a procedural language such as C or Java. Is evaluated and the condition (foo-p foo) is true, then the form1 and form2 are grouped as though they were contained within a progn.Lisp is a deep language with many unusual and powerful features. This means that a form like (when (foo-p foo) For instance, the when and unless macros, which are essentially one-sided if forms, describe their behavior in terms of an implicit progn. ![]() Some forms use implicit progns to describe their behavior. In contrast, some grouping expressions only return the primary value of the result-producing form. Progn is also valuable in that it returns all the values of the last form. ![]() This can be important when writing macros that expand into multiple forms that should all be processed as top level forms. In addition to grouping a series of forms, progn also has the important property that if the progn form is a top-level form, then all the forms within it are processed as top level forms. If there are no forms within the progn, then nil is returned: (progn) For instance, in the following, (print 'hello) is evaluated (and its result is ignored), and then 42 is evaluated and its result ( 42) is returned: (progn The general purpose special operator progn is used for evaluating zero or more forms.
0 Comments
Leave a Reply. |