3yt4frr3y 

3yt4frr3y 


Output:

Unhandled TYPE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                  {10005184C3}>:
  The value
    5
  is not of type
    STRING
  when binding STRING

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10005184C3}>
0: (WRITE-LINE 5 70206198609764) [external]
1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (WRITE-LINE (+ 2 3)) #<NULL-LEXENV>)
2: (EVAL-TLF (WRITE-LINE (+ 2 3)) 0 NIL)
3: ((LABELS SB-FASL::EVAL-FORM :IN SB-INT:LOAD-AS-SOURCE) (WRITE-LINE (+ 2 3)) 0)
4: ((LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) (WRITE-LINE (+ 2 3)) :CURRENT-INDEX 0)
5: (SB-C::%DO-FORMS-FROM-INFO #<CLOSURE (LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) {10015416CB}> #<SB-C::SOURCE-INFO {1001541693}> SB-C::INPUT-ERROR-IN-LOAD)
6: (SB-INT:LOAD-AS-SOURCE #<SB-SYS:FD-STREAM for "file /box/script.lisp" {1001532ED3}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading")
7: ((FLET SB-FASL::THUNK :IN LOAD))
8: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<CLOSURE (FLET SB-FASL::THUNK :IN LOAD) {7FB44F0EF69B}> #<SB-SYS:FD-STREAM for "file /box/script.lisp" {1001532ED3}>)
9: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<SB-SYS:FD-STREAM for "file /box/script.lisp" {1001532ED3}> NIL)
10: (LOAD #<SB-SYS:FD-STREAM for "file /box/script.lisp" {1001532ED3}> :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
11: ((FLET SB-IMPL::LOAD-SCRIPT :IN SB-IMPL::PROCESS-SCRIPT) #<SB-SYS:FD-STREAM for "file /box/script.lisp" {1001532ED3}>)
12: ((FLET SB-UNIX::BODY :IN SB-IMPL::PROCESS-SCRIPT))
13: ((FLET "WITHOUT-INTERRUPTS-BODY-2" :IN SB-IMPL::PROCESS-SCRIPT))
14: (SB-IMPL::PROCESS-SCRIPT "script.lisp")
15: (SB-IMPL::TOPLEVEL-INIT)
16: ((FLET SB-UNIX::BODY :IN SAVE-LISP-AND-DIE))
17: ((FLET "WITHOUT-INTERRUPTS-BODY-7" :IN SAVE-LISP-AND-DIE))
18: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))

unhandled condition in --disable-debugger mode, quitting

Common Lisp online compiler

Write, Run & Share Common Lisp code online using OneCompiler's Common Lisp online compiler for free. It's one of the robust, feature-rich online compilers for Common Lisp language, running the latest Common Lisp version 5.3. Getting started with the OneCompiler's Common Lisp editor is easy and fast. The editor shows sample boilerplate code when you choose language as Common Lisp and start coding.

Read inputs from stdin

OneCompiler's Common Lisp online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample Common Lisp program which takes name as input and prints hello message with your name.

(setq name (read))
(princ "Hello ")
(write name)

About Common Lisp

Common Lisp is a generic language suitable for a wide range of industry applications. It is often referred as Programmable programming language because of it's high extensibility, machine independence, extensive control structures, dynamic updation of programs etc.

Common LISP was invented by John McCarthy in 1958 and was first implemenyted by Steve Russell on an IBM 704 computer.

Syntax help

Variables

  • Global variables are declared using defvar keyword and these variables will be in effect until a new value is assigned.
  • Type declaration is not required in LISP

Example

(defvar x 10)
(write x)
  • Local variables are declared with in a function or a procedure. The scope of local variables will be only in that function.
  • let and progare used to declare local variables.

Syntax

(let ((var1  value1) (var2  value2).. (varn  valuen))<expressions>)
  • You can also create global and local variables using setq

Example

(setq a 10)

Loops

1. Loop:

This is the simplest looping mechanism in LISP. This allows the execute the set of statements repeatedly until a return statement is encountered.

Syntax

(loop (s-expressions))

2. For:

For loop is used to iterate a set of statements based on a condition.

(loop for loop-variable in <a list>
   do (action)
)

3. Do:

Do is also used to iterate a set of statements and then check the condition

(do ((var1    val1   updated-val1)
      (var2   val2   updated-val2)
      (var3   val3   updated-val3)
   ...)
   (test return-value)
   (s-expressions)
)

4. Dotimes:

Dotimes is used to iterate for fixed number of iterations.

Syntax:

(dotimes (n val)
  statements