Skip to main content
gamedev.net
🔒 Locked

Lisp Tutorials?

Started by Drevay 14 replies 550+ views
Original Post
Drevay
Drevay
I was wondering if there were any good Common Lisp tutorials, that won''t come up as 404 errors...And another thing, Corman Lisp - I tried to execute some of the examples, but a DOS window didn''t pop up, all that happened was an output on the main project file itself, and I know one of them is supposed to plan a .wav file called hellowin with it, because I searched the file itself. When I renamed it as an .EXE, it complained, and .... didn''t work. Any help?
DigiCode - My solo company in progress.
_________________Politics is the ability to foretell what is going to happen tomorrow, next week, next month and next year. And to have the ability afterwards to explain why it didn't happen. -- Winston ChurchillGDNet-0.2 - rate users the easy way with this nifty Firefox extension. Updated with new features.
bishop_pass
bishop_pass
(load "myprogram.lisp")

___________________________________

"The outside of a horse is good for the inside of a man" - Winston Churchill


[edited by - bishop_pass on April 22, 2003 11:06:07 PM]
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
Drevay
Drevay
Much abliged.


DigiCode - My solo company in progress.
_________________Politics is the ability to foretell what is going to happen tomorrow, next week, next month and next year. And to have the ability afterwards to explain why it didn't happen. -- Winston ChurchillGDNet-0.2 - rate users the easy way with this nifty Firefox extension. Updated with new features.
Drevay
Drevay
Uhmmm.... It said in the .pdf that came with Corman Lisp, that if you put in (+ 20 30) and press the execute key, you will get the results...

Is this on the worksheet? If so, when I press ENTER nothing happens...

*sigh*

EDIT - but when using the Corman Console..the results DO happen..so ..... ..... what is the worksheet used for? How do I compile files in the IDE? Do I have to compile them in the Console?


DigiCode - My solo company in progress.

[edited by - Drevay on April 22, 2003 11:15:15 PM]
_________________Politics is the ability to foretell what is going to happen tomorrow, next week, next month and next year. And to have the ability afterwards to explain why it didn't happen. -- Winston ChurchillGDNet-0.2 - rate users the easy way with this nifty Firefox extension. Updated with new features.
bishop_pass
bishop_pass
Are you using the IDE?

If so, type:
(setq fruits ''(pears apples bananas))

And press the numeric keypad ''ENTER'' key. This executes the statement.

Now, type:
fruits

And press the numeric keypad ''ENTER'' key. fruits will be evaluated, and the list it evaluates to will be printed.

___________________________________

"The outside of a horse is good for the inside of a man" - Winston Churchill
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
bishop_pass
bishop_pass
All Lisp statements are compiled on the fly in Corman Lisp. In other Lisp implementations, this isn''t always the case, but the compile function will compile for you. compile is another function, just like + or * is.

___________________________________

"The outside of a horse is good for the inside of a man" - Winston Churchill
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
Drevay
Drevay
Ahhh I see, very interesting! Wow, that's a neat way to associate one word with a list, it's almost artistic!

Oh and, since I have a laptop, I had to press the function key + the enter key, to get the numeric enter key, bit different but meh, who cares!

EDIT - Yes, I was wondering why does it print a line of characters twice (ie - a string) -- for example --

(write-line "Hello, this is your master speaking...")

will print out as -

Hello, this is your master speaking...
"Hello, this is your master speaking..."

Why is that?

DigiCode - My solo company in progress.

[edited by - Drevay on April 22, 2003 11:30:54 PM]
_________________Politics is the ability to foretell what is going to happen tomorrow, next week, next month and next year. And to have the ability afterwards to explain why it didn't happen. -- Winston ChurchillGDNet-0.2 - rate users the easy way with this nifty Firefox extension. Updated with new features.
bishop_pass
bishop_pass
quote:
Original post by Drevay
Ahhh I see, very interesting! Wow, that''s a neat way to associate one word with a list, it''s almost artistic!

The general goal of your initial sessions with Lisp should be with symbols and lists, such as the fruits example, as opposed to typical C or C++ sessions which involve "Hello World" and factorial examples.

___________________________________

"The outside of a horse is good for the inside of a man" - Winston Churchill
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
SabreMan
SabreMan
quote:
Original post by Drevay
Oh and, since I have a laptop, I had to press the function key + the enter key, to get the numeric enter key, bit different but meh, who cares!

You can also select the code you wish to execute and press shift+Enter.
quote:

EDIT - Yes, I was wondering why does it print a line of characters twice

Because you are in the REPL (the interactive environment), it performs the print to standard output (which is the REPL), and it prints the return value to the REPL. So, the first line is the side-effect of write-line, and the second is the return value.
bishop_pass
bishop_pass
quote:
Original post by Drevay
(write-line "Hello, this is your master speaking...")

*sigh*

You''re going to pretend you''re programming with a language like C or C++, aren''t you?

Don''t. Start right in with a different mentality.
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
DerekSaw
DerekSaw
quote:
Original post by Drevay
Why is that?



One is printing out the string, another is the 'value' of the expression.

[EDIT] Ooops, already have answer in previous few post.

[edited by - DerekSaw on April 23, 2003 6:52:34 AM]
"after many years of singularity, i'm still searching n the event horizon" o
Cedric
Cedric
I found that this tutorial was good enough to start: Lisp Primer. But some of the more knowledgeable Lispers might find it inadequate, I don''t know.

As a related note, I initially began with Guy Steele''s Common Lisp and regretted it. The book doesn''t know itself if it wants to be a comprehensive tutorial, a reference, or a language specification, so it''s not recommended.

Cédric
Pouya
Pouya
Awwww


  
(defun create-account (sock) (
(setlocal
(un (strnum (conn-getdata sock "un" "0")))
(name (conn-getdata sock "name" ""))
(pass (conn-getdata sock "
password" ""))
)
(log sock (str+ "
Creating new account <" name ">"))
(if (| (! (user-exists un))
(str!= (user-getname un false false) "
")
(user-online un))
(begin
(conn-send sock "
Very funny.\r\n" CAPS_NONE)
(conn-close sock)
) (begin
(user-setname un name)
(user-setalias un name)
(user-setshowname un name)
(user-setpass un pass)
(level-addstats 1 un)
(conn-send sock "
Account created successfully\r\n" CAPS_NONE)
(conn-setidlelimit sock 3600)
(conn-setreciever sock "
def-conn-message")
(user-setconn un sock)
(user-login un)
))
))



Download my new game: notavirus.jpg.exe Thanks ^___^!
DerekSaw
DerekSaw
quote:
Original post by bishop_pass
The general goal of your initial sessions with Lisp should be with symbols and lists[...]


You mean a
(Hello world)
or

(setq greeting '(Hello world))
greeting

?



[edited by - DerekSaw on April 23, 2003 10:58:45 PM]
"after many years of singularity, i'm still searching n the event horizon" o
bishop_pass
bishop_pass
Yes. I think that using Lisp to work with symbols and lists will get you ahead faster and get you thinking differently as opposed to thinking in terms of strings and printing. This goes a long way towards helping you think in terms of symbolic expressions, parsed data (you''re working with parsed data, instead of strings), code as data, symbols as data, etc.

___________________________________

"The outside of a horse is good for the inside of a man" - Winston Churchill
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.