0

I am newbie in lisp I have installed Clisp in my ubuntu 14.04 machine and SBCL too.

My Program in TextEditor looks like this:

( hello world )

but i am getting the following error:

 user@user:~/Desktop/lisp$ ./test.lisp
    ./test.lisp: line 1: i: command not found
3
  • 1
    Based on your reported error, you have not included the full file. Please run cat test.lisp and paste the full output of that command into your question. Commented Sep 5, 2015 at 18:33
  • 1
    How did you come up with that test program? (hello world) says you want to execute a command hello with argument world. Lisp doesn't have a built-in hello command. You should find a tutorial and follow that. Commented Sep 5, 2015 at 19:36
  • 3
    If you are new to Common Lisp, you probably should have a look at Common Lisp: A Gentle Introduction to Symbolic Computation (which includes exercises) or Practical Common Lisp (which gets practical quite early). Commented Sep 5, 2015 at 19:47

2 Answers 2

2

With CLISP under a unix (like Ubuntu) you can simply add a shebang to the top of your file #!/path/to/clisp and in Ubuntu that would be #!/usr/bin/clisp and it will execute the code as a script.

You need the file to contain proper Common Lisp file like:

#!/usr/bin/clisp
(princ "Hello, world!")

And make the file executable with chmod 755 <filename>. Unless you have placed it in one of the directories in $PATH you'll need to enter the path to it. From the directory of the file simply ./<filename> would suffice.

Sign up to request clarification or add additional context in comments.

Comments

2

You need to run clisp test.lisp

2 Comments

It is giving error : *** - EVAL: undefined function I
maybe you want (print "hello world")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.