From: Max Jagger
Subject: How to PURE LISP for GRAPHICS and INPUT!
Date: 
Message-ID: <6p7dk3-60r2.ln1@news.infowest.com>
Hi everyone,

    I am a programmer who has dipped my toe into the water of Lisp.  I am
researching all sorts of programming languages, so I decided to take a quick
look at Lisp to see what it can do.

Thoughts:
    Pure Lisp is a grand tool for transforming an input to an output.
    Pure Lisp is not built with other ends in mind, so it doesn't suit
traditional graphical or UI applications.

I invented a new idea to solve that.  The following is a prototype of the
new idea:

(window
  (size 500 600)
  (color (if (MouseDown button1) (RGB 255 255 (Random 256) ) (get-color
self) ) )
  (button (name 'button1) (caption "change color") (pos 100 100) )
)

Explanation:

1. In Pure Lisp, everything is an expression.  There are no commands.  The
code presented is a pure expression--a graphical expression.

2. The Read-Eval-Print loop normally evaluates math and string expressions,
and prints the result as a number or string.
The graphical expression is evaluated, and prints a window with a button as
it output--a graphical output.

3. The color of the window is an expression that evaluates to a new random
color when the mouse is pressed down on button1.

Principals:

1. Elements like window, button, color, and caption are like graphical
equivalents to of +, -, /, and *.  Each is considered a graphical function
that returns a graphical result.  In fact, the whole UI of a program can be
made into 1 large expression.

2.  Input into the window is the keyboard and mouse state (and maybe state
from other threads, such as progress).  The window is a function that
accepts the keyboard and mouse state as input parameters and prints a
graphical result.  This does mean that the window function must be
re-evaluated every time the keyboard and mouse input parameters change,
though, just like in the Read-Eval-Print loop for a math expression, where
you must call the expression, passing different parameters to get the new
result.

3.  Pure Graphical Lisp replaces number/text input parameters with
mouse/keyboard input parameters, and prints a UI rather than a text result.

This leads us to an interesting Idea.  To provide capability X and Y in
Lisp, we just provide X<->Y transformation capability.  All of the sudden,
Lisp seems much more interesting to me!  Who knows what other applications
there are for transformation!

I believe Pure Lisp is somewhat similar to the way our brain behaves.  We
transform all our sensory input (senses, emotions, greed) to action output.
That also makes another case for Lisp in AI!

Cheers!

    ~ Max Jagger

From: Pascal Bourguignon
Subject: Re: How to PURE LISP for GRAPHICS and INPUT!
Date: 
Message-ID: <87d5e365ix.fsf@thalassa.informatimago.com>
"Max Jagger" <·········@gmail.com> writes:
> [...]
> I invented a new idea to solve that.  The following is a prototype of the
> new idea:
>
> (window
>   (size 500 600)
>   (color (if (MouseDown button1) (RGB 255 255 (Random 256) ) (get-color
> self) ) )
>   (button (name 'button1) (caption "change color") (pos 100 100) )
> )
> [...]
> This leads us to an interesting Idea.  To provide capability X and Y in
> Lisp, we just provide X<->Y transformation capability.  All of the sudden,
> Lisp seems much more interesting to me!  Who knows what other applications
> there are for transformation!
> [...]

Indeed, you've understood the power of lisp: you can invent your own
Domain Specific Language (DSL), write your program in it, and later,
write some lisp code to translate your DSL constructs to lisp
construct to have it run.

For another example, see this post by Alan Crowe:
Message-ID: <··············@cawtech.freeserve.co.uk>
(use groups.google.com / Avanced group search and search by Message-ID.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we. -- Georges W. Bush
From: Jacques Chester
Subject: Re: How to PURE LISP for GRAPHICS and INPUT!
Date: 
Message-ID: <44745506@dnews.tpgi.com.au>
Pascal Bourguignon wrote:
> 
> For another example, see this post by Alan Crowe:
> Message-ID: <··············@cawtech.freeserve.co.uk>
> (use groups.google.com / Avanced group search and search by Message-ID.

Ye olde public service/karma whoring post with
link to the abovementioned:

http://groups.google.com/group/comp.lang.lisp/msg/a827235ce7466a92

Cheers,

JC.
From: Pascal Bourguignon
Subject: Re: How to PURE LISP for GRAPHICS and INPUT!
Date: 
Message-ID: <874pzf5kyn.fsf@thalassa.informatimago.com>
Jacques Chester <·······@chester.id.au> writes:

> Pascal Bourguignon wrote:
>> For another example, see this post by Alan Crowe:
>> Message-ID: <··············@cawtech.freeserve.co.uk>
>> (use groups.google.com / Avanced group search and search by Message-ID.
>
> Ye olde public service/karma whoring post with
> link to the abovementioned:
>
> http://groups.google.com/group/comp.lang.lisp/msg/a827235ce7466a92


Ok, but then: 

 +~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-+
/                                                        \
\    Give a fish to a man, he'll eat one day;            /
/   Teach a man how to fish, he'll eat all his life.     \
\                                                        /
 +_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-+


;; Here is how to fish:

(asdf:oos 'asdf:load-op :trivial-http)

(defpackage "GOOGLE-GROUP"
  (:use "COMMON-LISP")
  (:export "URL-FOR-MESSAGE-ID"))
(in-package "GOOGLE-GROUP")

(defun url-for-message-id (message-id)
  (destructuring-bind (response header body)
      (trivial-http:http-get
       (format nil "http://groups.google.com/groups?selm=~A"
               (trivial-http:escape-url-query message-id)))
    (case response
      ((301) (cdr (assoc :location header)))
      (otherwise (error "Unexpected reponse code ~A~%~S~%~S~%"
                         response header body)))))


;; For example:

(in-package "COMMON-LISP-USER")
(print
 (GOOGLE-GROUP:URL-FOR-MESSAGE-ID ···············@cawtech.freeserve.co.uk")) 

;-)


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

WARNING: This product warps space and time in its vicinity.