Slide 8.f: Programming Exercise II: calculating a string expression
Slide 9.a: XML (eXtensible Markup Language)
Home

Using Lisp


  1. Check the Lisp Help Pages.

  2. There Are Two Ways to Execute Lisp Commands:

    • Interactive-mode:
    • Activate the Lisp interpreter and interactively execute Lisp commands. For example,
        gandalf> clisp
      
         i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
         I I I I I I I      8     8   8           8     8     o  8    8
         I  \ `+' /  I      8         8           8     8        8    8
          \  `-+-'  /       8         8           8      ooooo   8oooo
           `-__|__-'        8         8           8           8  8
               |            8     o   8           8     o     8  8
         ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8
       
       Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
       Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
       Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
       Copyright (c) Bruno Haible, Sam Steingold 1999-2000
       Copyright (c) Sam Steingold, Bruno Haible 2001-2006
       
       [1]> (format t "Hello, World!")
       Hello, World!
       NIL
      
       [2]> (load  "inf-to-pre.lsp")
       ;; Loading file inf-to-pre.lsp ...
       ;; Loaded file inf-to-pre.lsp
       T
      
       [3]> (compile-file  "inf-to-pre.lsp") 
       ;; Compiling file /home/wenchen/public_html/course/common/lisp/inf-to-pre.lsp ...
       ;; Wrote file /home/wenchen/public_html/course/common/lisp/inf-to-pre.fas
       0 errors, 0 warnings
       #P"/home/wenchen/public_html/course/common/lisp/inf-to-pre.fas" ;
       NIL ;
       NIL
      
       [4]> (load  "inf-to-pre.fas")
       ;; Loading file inf-to-pre.fas ...
       ;; Loaded file inf-to-pre.fas
       T
      
       [5]> ((inf-to-pre '(1 + 2 * 3))
       (+ 1 (* 2 3))
      
       [6]> (exit)
       Bye.
      
       gandalf>

    • Batch-mode:
      1. Create a Lisp program such as HelloWorld.lsp .

      2. Execute the program. For example,
         gandalf> clisp  HelloWorld.lsp
         Hello, World!
         gandalf>