Lisp links thread

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
Post Reply
adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Post by adam »

yeah, i hear lisp can be compiled as well for extra speed.

if you like dsp (with sound anyway) then snd might be worth a look, it's a sound editor that uses scheme as a scripting language, once again this is a bit 3rd hand from me, since i gave up trying to compile it on osx really quick (well, it needs fink to run & i had trouble with fink, i've still got half an installation lurking on my drive and no idea how to fix it or get rid of it)

http://ccrma.stanford.edu/software/snd/

edit... & Naughty Dog used their own lisp dialect called GOAL to write several ps2 games... sony bought them out partially to get their hands on their code (to use in other studios), then found they couldn't use it because lisp is a bit non-standard ;-)

http://ynniv.com/blog/2005/12/lisp-in-g ... x-and.html
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Post by teamonkey »

I've just had a go with DrScheme and I was pleased to find that there's an Allegro PLaneT module.

http://www.rafkind.com/jon/allegro-scheme/

It's been many years since I've used Allegro but it used to be pretty good. It was written by Shawn Hargreaves, who is now part of the XNA core team at Microsoft.
adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Post by adam »

thanks, that looks really good... might have to have a go with it :D
User avatar
failrate
Baaaaaa!
Baaaaaa!
Posts: 2354
Joined: Sun May 23, 2004 6:54 am 0
Location: Sandy Eggo
Contact:

Post by failrate »

Ratchet & Clank and Sly Cooper 2 used Scheme for scripting. Look for "A Picture Worth a Thousand Bugs" for the Sly Cooper 2 GDC talk audio or transcript. Really good explanation of a robust mission system.
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Post by teamonkey »

failrate wrote:Ratchet & Clank and Sly Cooper 2 used Scheme for scripting. Look for "A Picture Worth a Thousand Bugs" for the Sly Cooper 2 GDC talk audio or transcript. Really good explanation of a robust mission system.
Found here.
adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Post by adam »

thanks, i was looking for that yesterday :D
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Post by teamonkey »

adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Post by adam »

thankyou sir, that reminded me to post this one (from the history of lisp):

http://www-formal.stanford.edu/jmc/hist ... 0000000000
adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Post by adam »

one chaps adventures in buying a Lisp Machine (old computers that used lisp as the os)...
http://lists.tunes.org/archives/lispm/2 ... 00010.html

edit... this isn't the link i thought it was, theres a much more interesting one elsewhere that goes into the full ins & outs,
adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Post by adam »

http://artfulcode.nfshost.com/files/wra ... art-1.html

wrapping-a-c-library-in-lisp-part-1 ;-)
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Post by GoatFoam »

adam wrote:http://artfulcode.nfshost.com/files/wrapping-a-c-library-in-lisp-part-1.html

wrapping-a-c-library-in-lisp-part-1 ;-)
Have I mentioned the general depravity of lisp programmers yet?

Need more caffiene before I can read lisp syntax today.
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Post by GoatFoam »

I just got a book on functional data structures.

Will let you know how I get on with it.
adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Post by adam »

thanks :D
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Post by teamonkey »

I done a macroes! It took hours to get right (mainly because of the hideous un-lisp-like blob that I was trying to parse) but I learned a lot about list trees and the way that macros do things.

Anyway, the real reason for this post is that I've just grokked (amb) and it's a belter. :D

Fixnum describes it in a very boring, difficult way and then obscures it away behind other macros. It seems to me that (amb) is a tool that's so powerful that it's really worth knowing. So I managed to find this (explanation in Ruby) and A/B (explanations in C). These were also pretty complex, but the content of the four pages interfered constructively. Bear in mind that I've never done any Prolog before, so this might be old news.

In essence, there are two rules:
1. (amb) = FAIL! - calling amb with no parameters is considered a fail
2. (amb 'a 'b 'c) - amb takes a list of parameters and will return one of them. The one that it returns is the first one that doesn't FAIL.

So what you do is you assign values to your vars and then run them through a simple program to see if they meet all the conditions. Hey presto - the results just fall out automatically!

A simple example - you have three vars a,b,c which can each equal the values 1-5. Find a combination where a*b*c=12.

Code: Select all

> (let ((a (amb 1 2 3 4 5))
        (b (amb 1 2 3 4 5))
        (c (amb 1 2 3 4 5)))

    (if
     (not (= (* a b c) 12))
          (amb))

    (display (list a b c)))
-
(1 3 4)
Another example is the map colours one in fixnum where the actual algorithm boils down to:

Code: Select all

          ;the color of a country
          ;should not be the color of
          ;any of its neighbors
          (for-each
           (lambda (c)
             (assert
              (not (memq (cadr c)
                         (caddr c)))))
           countries)
(assert returns (amb) if false).
adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Post by adam »

that looks good, i imagine (amb) could be run over both data & code (since they're the same thing in lisp), so "find the combination of functions that creates this result" or something like that..
Post Reply